Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9fa2894
refactor: Share EVM Utils
alarso16 Dec 15, 2025
a1d7571
refactor: align PointerTo functions
JonathanOppenheimer Dec 15, 2025
7eb6a03
refactor: remove additional pointer helper
JonathanOppenheimer Dec 15, 2025
dd0c874
chore: lint
JonathanOppenheimer Dec 15, 2025
52f5f65
chore: lint
JonathanOppenheimer Dec 15, 2025
27bd7df
chore: lint
JonathanOppenheimer Dec 15, 2025
b3ca14c
fix: nit
alarso16 Dec 17, 2025
92481c4
Merge remote-tracking branch 'origin/master' into alarso16/shared-utils
alarso16 Dec 17, 2025
8ab7b07
fix: remove other evm helper
JonathanOppenheimer Dec 18, 2025
98337b9
refactor: move pointer function to avalanchego utils
JonathanOppenheimer Dec 18, 2025
8a0b2a9
refactor: move pointer function to avalanchego utils
JonathanOppenheimer Dec 18, 2025
4899b18
refactor: remove avalanche pointer functions
JonathanOppenheimer Dec 18, 2025
3ea19c3
refactor: retype delay excess
JonathanOppenheimer Dec 18, 2025
5b97b5b
Merge branch 'alarso16/shared-utils' into JonathanOppenheimer/cleanup…
JonathanOppenheimer Dec 18, 2025
8d3342a
chore: lint
JonathanOppenheimer Dec 18, 2025
9e161ce
fix: fix precompilebind test
JonathanOppenheimer Dec 18, 2025
9415c2a
Merge remote-tracking branch 'origin/master' into alarso16/shared-utils
alarso16 Dec 19, 2025
d458c28
Merge remote-tracking branch 'origin/alarso16/shared-utils' into Jona…
JonathanOppenheimer Dec 19, 2025
fa38c15
Merge remote-tracking branch 'origin' into JonathanOppenheimer/cleanu…
JonathanOppenheimer Jan 6, 2026
30996ca
fix: imports
JonathanOppenheimer Jan 6, 2026
7f2844b
chore: correct header year
JonathanOppenheimer Jan 6, 2026
0090c2f
Merge remote-tracking branch 'origin' into JonathanOppenheimer/cleanu…
JonathanOppenheimer Jan 8, 2026
17d7a81
style: revert delay excess retype
JonathanOppenheimer Jan 9, 2026
b49ca61
style: austin feedback
JonathanOppenheimer Jan 9, 2026
e564de4
Merge branch 'master' into JonathanOppenheimer/cleanup-ptr-to
JonathanOppenheimer Jan 9, 2026
3431ce3
fix: revert go mod changes
JonathanOppenheimer Jan 9, 2026
e774033
style: do not rename import
JonathanOppenheimer Jan 13, 2026
bc974e8
Merge branch 'master' into JonathanOppenheimer/cleanup-ptr-to
JonathanOppenheimer Jan 13, 2026
50c80bc
Merge branch 'master' into JonathanOppenheimer/cleanup-ptr-to
JonathanOppenheimer Jan 13, 2026
f3b4885
Merge branch 'master' into JonathanOppenheimer/cleanup-ptr-to
JonathanOppenheimer Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/google/renameio/v2 v2.0.0
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/gorilla/rpc v1.2.0
github.com/gorilla/rpc v1.2.1
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/holiman/uint256 v1.2.4
github.com/huin/goupnp v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk=
github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ=
github.com/gorilla/rpc v1.2.1 h1:yC+LMV5esttgpVvNORL/xX4jvTTEUE30UZhZ5JF7K9k=
github.com/gorilla/rpc v1.2.1/go.mod h1:uNpOihAlF5xRFLuTYhfR0yfCTm0WTQSQttkMSptRfGk=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
Expand Down
6 changes: 3 additions & 3 deletions graft/coreth/core/genesis_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
"github.com/ava-labs/avalanchego/graft/coreth/params"
"github.com/ava-labs/avalanchego/graft/coreth/params/extras"
"github.com/ava-labs/avalanchego/graft/coreth/params/paramstest"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/rawdb"
"github.com/ava-labs/libevm/core/types"
Expand Down Expand Up @@ -68,8 +68,8 @@ func TestGenesisEthUpgrades(t *testing.T) {
},
&extras.ChainConfig{
NetworkUpgrades: extras.NetworkUpgrades{
ApricotPhase1BlockTimestamp: utils.NewUint64(0),
ApricotPhase2BlockTimestamp: utils.NewUint64(0),
ApricotPhase1BlockTimestamp: utils.PointerTo[uint64](0),
ApricotPhase2BlockTimestamp: utils.PointerTo[uint64](0),
},
},
)
Expand Down
10 changes: 5 additions & 5 deletions graft/coreth/core/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/ava-labs/avalanchego/graft/coreth/precompile/contracts/warp"
"github.com/ava-labs/avalanchego/graft/coreth/triedb/pathdb"
"github.com/ava-labs/avalanchego/graft/evm/firewood"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/avalanchego/vms/evm/sync/customrawdb"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/core/rawdb"
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestSetupGenesis(t *testing.T) {

func testSetupGenesis(t *testing.T, scheme string) {
apricotPhase1Config := params.Copy(params.TestApricotPhase1Config)
params.GetExtra(&apricotPhase1Config).ApricotPhase1BlockTimestamp = utils.NewUint64(100)
params.GetExtra(&apricotPhase1Config).ApricotPhase1BlockTimestamp = utils.PointerTo[uint64](100)
var (
customghash = common.HexToHash("0x1099a11e9e454bd3ef31d688cf21936671966407bc330f051d754b5ce401e7ed")
customg = Genesis{
Expand All @@ -91,7 +91,7 @@ func testSetupGenesis(t *testing.T, scheme string) {
)

rollbackApricotPhase1Config := params.Copy(&apricotPhase1Config)
params.GetExtra(&rollbackApricotPhase1Config).ApricotPhase1BlockTimestamp = utils.NewUint64(90)
params.GetExtra(&rollbackApricotPhase1Config).ApricotPhase1BlockTimestamp = utils.PointerTo[uint64](90)
oldcustomg.Config = &rollbackApricotPhase1Config
tests := []struct {
name string
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestNetworkUpgradeBetweenHeadAndAcceptedBlock(t *testing.T) {
require.Greater(block.Time, bc.lastAccepted.Time())

activatedGenesis := customg
apricotPhase2Timestamp := utils.NewUint64(51)
apricotPhase2Timestamp := utils.PointerTo[uint64](51)
updatedApricotPhase2Config := params.Copy(params.TestApricotPhase1Config)
params.GetExtra(&updatedApricotPhase2Config).ApricotPhase2BlockTimestamp = apricotPhase2Timestamp

Expand Down Expand Up @@ -275,7 +275,7 @@ func TestGenesisWriteUpgradesRegression(t *testing.T) {

params.GetExtra(genesis.Config).UpgradeConfig.PrecompileUpgrades = []extras.PrecompileUpgrade{
{
Config: warp.NewConfig(utils.NewUint64(51), 0, false),
Config: warp.NewConfig(utils.PointerTo[uint64](51), 0, false),
},
}
_, _, err = SetupGenesisBlock(db, trieDB, genesis, genesisBlock.Hash(), false)
Expand Down
8 changes: 4 additions & 4 deletions graft/coreth/core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import (
"github.com/ava-labs/avalanchego/graft/coreth/plugin/evm/upgrade/ap1"
"github.com/ava-labs/avalanchego/graft/coreth/plugin/evm/upgrade/ap3"
"github.com/ava-labs/avalanchego/graft/coreth/plugin/evm/upgrade/cortina"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/upgrade"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/avalanchego/vms/evm/acp176"
"github.com/ava-labs/libevm/common"
"github.com/ava-labs/libevm/consensus/misc/eip4844"
Expand Down Expand Up @@ -283,8 +283,8 @@ func TestStateProcessorErrors(t *testing.T) {
},
&extras.ChainConfig{
NetworkUpgrades: extras.NetworkUpgrades{
ApricotPhase1BlockTimestamp: utils.NewUint64(0),
ApricotPhase2BlockTimestamp: utils.NewUint64(0),
ApricotPhase1BlockTimestamp: utils.PointerTo[uint64](0),
ApricotPhase2BlockTimestamp: utils.PointerTo[uint64](0),
},
},
),
Expand Down Expand Up @@ -391,7 +391,7 @@ func GenerateBadBlock(parent *types.Block, engine consensus.Engine, txs types.Tr
}
if configExtra.IsGranite(header.Time) {
headerExtra := customtypes.GetHeaderExtra(header)
headerExtra.TimeMilliseconds = utils.NewUint64(timeMS)
headerExtra.TimeMilliseconds = utils.PointerTo(timeMS)
}
if configExtra.IsApricotPhase4(header.Time) {
headerExtra := customtypes.GetHeaderExtra(header)
Expand Down
2 changes: 1 addition & 1 deletion graft/coreth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ require (
github.com/google/renameio/v2 v2.0.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/rpc v1.2.0 // indirect
github.com/gorilla/rpc v1.2.1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
github.com/huin/goupnp v1.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions graft/coreth/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/rpc v1.2.0 h1:WvvdC2lNeT1SP32zrIce5l0ECBfbAlmrmSBsuc57wfk=
github.com/gorilla/rpc v1.2.0/go.mod h1:V4h9r+4sF5HnzqbwIez0fKSpANP0zlYd3qR7p36jkTQ=
github.com/gorilla/rpc v1.2.1 h1:yC+LMV5esttgpVvNORL/xX4jvTTEUE30UZhZ5JF7K9k=
github.com/gorilla/rpc v1.2.1/go.mod h1:uNpOihAlF5xRFLuTYhfR0yfCTm0WTQSQttkMSptRfGk=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
Expand Down
6 changes: 3 additions & 3 deletions graft/coreth/internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (
"github.com/ava-labs/avalanchego/graft/coreth/params"
"github.com/ava-labs/avalanchego/graft/coreth/plugin/evm/upgrade/ap3"
"github.com/ava-labs/avalanchego/graft/coreth/rpc"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/libevm/accounts"
"github.com/ava-labs/libevm/accounts/keystore"
"github.com/ava-labs/libevm/common"
Expand Down Expand Up @@ -796,8 +796,8 @@ func TestEstimateGas(t *testing.T) {
func TestCall(t *testing.T) {
// Enable BLOBHASH opcode in Cancun
cfg := *params.TestChainConfig
cfg.ShanghaiTime = utils.NewUint64(0)
cfg.CancunTime = utils.NewUint64(0)
cfg.ShanghaiTime = utils.PointerTo[uint64](0)
cfg.CancunTime = utils.PointerTo[uint64](0)
t.Parallel()
// Initialize test accounts
var (
Expand Down
24 changes: 12 additions & 12 deletions graft/coreth/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"math/big"

"github.com/ava-labs/avalanchego/graft/coreth/params/extras"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/utils"
"github.com/ava-labs/libevm/libevm"
ethparams "github.com/ava-labs/libevm/params"
)
Expand Down Expand Up @@ -96,8 +96,8 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
CancunTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
CancunTime: utils.PointerTo[uint64](0),
},
extras.TestChainConfig,
)
Expand Down Expand Up @@ -333,7 +333,7 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
},
extras.TestDurangoChainConfig,
)
Expand All @@ -354,8 +354,8 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
CancunTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
CancunTime: utils.PointerTo[uint64](0),
},
extras.TestEtnaChainConfig,
)
Expand All @@ -376,8 +376,8 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
CancunTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
CancunTime: utils.PointerTo[uint64](0),
},
extras.TestFortunaChainConfig,
)
Expand All @@ -398,8 +398,8 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
CancunTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
CancunTime: utils.PointerTo[uint64](0),
},
extras.TestGraniteChainConfig,
)
Expand All @@ -420,8 +420,8 @@ func initialiseChainConfigs() {
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ShanghaiTime: utils.NewUint64(0),
CancunTime: utils.NewUint64(0),
ShanghaiTime: utils.PointerTo[uint64](0),
CancunTime: utils.PointerTo[uint64](0),
},
extras.TestHeliconChainConfig,
)
Expand Down
6 changes: 3 additions & 3 deletions graft/coreth/params/config_extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"math/big"

"github.com/ava-labs/avalanchego/graft/coreth/params/extras"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/upgrade"
"github.com/ava-labs/avalanchego/utils"
)

const (
Expand Down Expand Up @@ -80,11 +80,11 @@ func SetEthUpgrades(c *ChainConfig) error {
// We only mark Shanghai and Cancun as enabled if we have marked them as
// scheduled.
if durango := extra.DurangoBlockTimestamp; durango != nil && *durango < unscheduledActivation {
c.ShanghaiTime = utils.NewUint64(*durango)
c.ShanghaiTime = utils.PointerTo(*durango)
}

if etna := extra.EtnaTimestamp; etna != nil && *etna < unscheduledActivation {
c.CancunTime = utils.NewUint64(*etna)
c.CancunTime = utils.PointerTo(*etna)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions graft/coreth/params/config_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/require"

"github.com/ava-labs/avalanchego/graft/coreth/params/extras"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/upgrade/upgradetest"
"github.com/ava-labs/avalanchego/utils"
)

func TestMain(m *testing.M) {
Expand All @@ -22,7 +22,7 @@ func TestMain(m *testing.M) {

func TestSetEthUpgrades(t *testing.T) {
genesisBlock := big.NewInt(0)
genesisTimestamp := utils.NewUint64(initiallyActive)
genesisTimestamp := utils.PointerTo(initiallyActive)
tests := []struct {
fork upgradetest.Fork
expected *ChainConfig
Expand Down
8 changes: 4 additions & 4 deletions graft/coreth/params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
"time"

"github.com/ava-labs/avalanchego/graft/coreth/params/extras"
"github.com/ava-labs/avalanchego/graft/evm/utils"
"github.com/ava-labs/avalanchego/utils"
ethparams "github.com/ava-labs/libevm/params"
)

Expand Down Expand Up @@ -119,7 +119,7 @@ func TestCheckCompatible(t *testing.T) {
headTimestamp: 0,
wantErr: &ethparams.ConfigCompatError{
What: "ApricotPhase5 fork block timestamp",
StoredTime: utils.NewUint64(0),
StoredTime: utils.PointerTo[uint64](0),
NewTime: nil,
RewindToTime: 0,
},
Expand All @@ -131,7 +131,7 @@ func TestCheckCompatible(t *testing.T) {
headTimestamp: 100,
wantErr: &ethparams.ConfigCompatError{
What: "ApricotPhase5 fork block timestamp",
StoredTime: utils.NewUint64(0),
StoredTime: utils.PointerTo[uint64](0),
NewTime: nil,
RewindToTime: 0,
},
Expand All @@ -151,7 +151,7 @@ func TestConfigRules(t *testing.T) {
&ChainConfig{},
&extras.ChainConfig{
NetworkUpgrades: extras.NetworkUpgrades{
CortinaBlockTimestamp: utils.NewUint64(500),
CortinaBlockTimestamp: utils.PointerTo[uint64](500),
},
},
)
Expand Down
Loading