Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a5ec5f4
refactor: warp e2e tests no longer in single function
JonathanOppenheimer Dec 31, 2025
cd261c0
test: enable c-chain <-> subnet e2e warp tests
JonathanOppenheimer Dec 31, 2025
8e0262f
fix: return as functions instead
JonathanOppenheimer Dec 31, 2025
32fd38c
Merge branch 'JonathanOppenheimer/refactor-warp-e2e' into JonathanOpp…
JonathanOppenheimer Dec 31, 2025
700b55d
fix: have create its own context
JonathanOppenheimer Jan 2, 2026
766abee
Merge branch 'master' into JonathanOppenheimer/refactor-warp-e2e
JonathanOppenheimer Jan 2, 2026
994bd56
Merge branch 'master' into JonathanOppenheimer/refactor-warp-e2e
JonathanOppenheimer Jan 5, 2026
49539eb
test: simplify logging
JonathanOppenheimer Jan 6, 2026
4fe2939
test: simplify logging
JonathanOppenheimer Jan 6, 2026
fe30b29
Merge branch 'master' into JonathanOppenheimer/refactor-warp-e2e
JonathanOppenheimer Jan 6, 2026
8f4134c
fix: revert full wrap
JonathanOppenheimer Jan 6, 2026
4c83539
Merge branch 'JonathanOppenheimer/refactor-warp-e2e' into JonathanOpp…
JonathanOppenheimer Jan 7, 2026
3e3ee1a
style: align coreth and subnet-evm
JonathanOppenheimer Jan 7, 2026
22f3143
Merge branch 'master' into JonathanOppenheimer/enable-coreth-subnet-w…
JonathanOppenheimer Jan 7, 2026
2ca00e4
chore: remore duplicated function
JonathanOppenheimer Jan 8, 2026
d1ce38b
fix: use tmpnet function
JonathanOppenheimer Jan 8, 2026
446b78f
fix: this too
JonathanOppenheimer Jan 8, 2026
aa30d82
Update warp_test.go
JonathanOppenheimer Jan 9, 2026
1d84d0b
refactor: use tmpnet generated keys
JonathanOppenheimer Jan 13, 2026
b55fd11
Merge branch 'master' into JonathanOppenheimer/enable-coreth-subnet-w…
JonathanOppenheimer Jan 13, 2026
d5e36e6
fix: revert key change
JonathanOppenheimer Jan 13, 2026
31b4b82
Merge branch 'master' into JonathanOppenheimer/enable-coreth-subnet-w…
JonathanOppenheimer Jan 13, 2026
0f98160
Merge branch 'master' into JonathanOppenheimer/enable-coreth-subnet-w…
JonathanOppenheimer Jan 13, 2026
f53c841
fix: change to subnetevmID
JonathanOppenheimer Jan 14, 2026
fc6c206
build: subnet-evm binary during coreth warp e2e
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: 2 additions & 0 deletions graft/coreth/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ tasks:
E2E_TARGET: ./graft/coreth/tests/warp
cmds:
- cmd: ./scripts/run_task.sh build
- cmd: cd graft/subnet-evm && ./scripts/build.sh
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}

test-e2e-warp-ci: # consolidated test-e2e-warp
Expand All @@ -129,4 +130,5 @@ tasks:
E2E_SERIAL: 1
cmds:
- cmd: ./scripts/run_task.sh build-race
- cmd: cd graft/subnet-evm && ./scripts/build.sh
- cmd: bash -x ./scripts/tests.e2e.sh {{.CLI_ARGS}}
38 changes: 37 additions & 1 deletion graft/coreth/tests/utils/tmpnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
package utils

import (
"encoding/json"

"github.com/ava-labs/avalanchego/config"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
"github.com/ava-labs/avalanchego/utils/constants"
)

var DefaultChainConfig = map[string]any{
Expand All @@ -14,7 +18,7 @@ var DefaultChainConfig = map[string]any{
"local-txs-enabled": true,
}

func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap) *tmpnet.Network {
func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap, subnets ...*tmpnet.Subnet) *tmpnet.Network {
defaultFlags := tmpnet.FlagsMap{}
defaultFlags.SetDefaults(flags)
defaultFlags.SetDefaults(tmpnet.FlagsMap{
Expand All @@ -24,5 +28,37 @@ func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap)
Owner: owner,
DefaultFlags: defaultFlags,
Nodes: nodes,
Subnets: subnets,
}
}

// Create the configuration that will enable creation and access to a
// subnet created on a temporary network.
func NewTmpnetSubnet(name string, genesis []byte, chainConfig map[string]any, nodes ...*tmpnet.Node) *tmpnet.Subnet {
if len(nodes) == 0 {
panic("a subnet must be validated by at least one node")
}

validatorIDs := make([]ids.NodeID, len(nodes))
for i, node := range nodes {
validatorIDs[i] = node.NodeID
}

chainConfigBytes, err := json.Marshal(chainConfig)
if err != nil {
panic(err)
}

return &tmpnet.Subnet{
Name: name,
Chains: []*tmpnet.Chain{
{
VMID: constants.SubnetEVMID,
Genesis: genesis,
Config: string(chainConfigBytes),
PreFundedKey: tmpnet.HardhatKey,
},
},
ValidatorIDs: validatorIDs,
}
}
45 changes: 45 additions & 0 deletions graft/coreth/tests/warp/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"config": {
"chainId": 99999,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"feeConfig": {
"gasLimit": 20000000,
"minBaseFee": 1000000000,
"targetGas": 100000000,
"baseFeeChangeDenominator": 48,
"minBlockGasCost": 0,
"maxBlockGasCost": 10000000,
"targetBlockRate": 2,
"blockGasCostStep": 500000
},
"warpConfig": {
"blockTimestamp": 1607144400
}
},
"alloc": {
"8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": {
"balance": "0x52B7D2DCC80CD2E4000000"
},
"0x0Fa8EA536Be85F32724D57A37758761B86416123": {
"balance": "0x52B7D2DCC80CD2E4000000"
}
},
"nonce": "0x0",
"timestamp": "0x5FCB13D0",
"extraData": "0x00",
"gasLimit": "0x1312D00",
"difficulty": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
28 changes: 20 additions & 8 deletions graft/coreth/tests/warp/warp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/ava-labs/libevm/crypto"
"github.com/stretchr/testify/require"

_ "embed"

"github.com/ava-labs/avalanchego/api/info"
"github.com/ava-labs/avalanchego/graft/coreth/accounts/abi/bind"
"github.com/ava-labs/avalanchego/graft/coreth/cmd/simulator/key"
Expand All @@ -43,10 +45,15 @@ import (
ginkgo "github.com/onsi/ginkgo/v2"
)

const subnetAName = "warp-subnet-a"

var (
//go:embed genesis.json
genesis []byte

flagVars *e2e.FlagVars

cChainSubnetDetails *Subnet
subnetA, cChainSubnetDetails *Subnet

testPayload = []byte{1, 2, 3}
)
Expand Down Expand Up @@ -74,7 +81,6 @@ func TestE2E(t *testing.T) {

var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Run only once in the first ginkgo process

tc := e2e.NewTestContext()
nodes := tmpnet.NewNodesOrPanic(tmpnet.DefaultNodeCount)

Expand All @@ -85,6 +91,7 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
"coreth-warp-e2e",
nodes,
tmpnet.FlagsMap{},
utils.NewTmpnetSubnet(subnetAName, genesis, utils.DefaultChainConfig, nodes...),
),
)

Expand All @@ -108,6 +115,15 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
validatorURIs[i] = node.URI
}

tmpnetSubnetA := network.GetSubnet(subnetAName)
require.NotNil(tmpnetSubnetA)
subnetA = &Subnet{
SubnetID: tmpnetSubnetA.SubnetID,
BlockchainID: tmpnetSubnetA.Chains[0].ChainID,
PreFundedKey: tmpnetSubnetA.Chains[0].PreFundedKey.ToECDSA(),
ValidatorURIs: validatorURIs,
}

infoClient := info.NewClient(network.Nodes[0].URI)
cChainBlockchainID, err := infoClient.GetBlockchainID(tc.DefaultContext(), "C")
require.NoError(err)
Expand All @@ -128,12 +144,8 @@ var _ = ginkgo.Describe("[Warp]", func() {
}

testCombinations := []testCombination{
// TODO: Uncomment these tests when we have a way to run them in CI, currently we should not depend on Subnet-EVM
// as Coreth and Subnet-EVM have different release cycles. The problem is that once we update AvalancheGo (protocol version),
// we need to update Subnet-EVM to the same protocol version. Until then all Subnet-EVM tests are broken, so it's blocking Coreth development.
// It's best to not run these tests until we have a way to run them in CI.
// {"SubnetA -> C-Chain", func() *Subnet { return subnetA }, func() *Subnet { return cChainSubnetDetails }},
// {"C-Chain -> SubnetA", func() *Subnet { return cChainSubnetDetails }, func() *Subnet { return subnetA }},
{"SubnetA -> C-Chain", func() *Subnet { return subnetA }, func() *Subnet { return cChainSubnetDetails }},
{"C-Chain -> SubnetA", func() *Subnet { return cChainSubnetDetails }, func() *Subnet { return subnetA }},
{"C-Chain -> C-Chain", func() *Subnet { return cChainSubnetDetails }, func() *Subnet { return cChainSubnetDetails }},
}

Expand Down
2 changes: 1 addition & 1 deletion graft/subnet-evm/tests/load/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var _ = ginkgo.Describe("[Load Simulator]", ginkgo.Ordered, func() {
repoRoot, err = e2e.GetRepoRootPath("tests/load")
require.NoError(err)

nodes := utils.NewTmpnetNodes(nodeCount)
nodes := tmpnet.NewNodesOrPanic(nodeCount)
env = e2e.NewTestEnvironment(
tc,
flagVars,
Expand Down
10 changes: 0 additions & 10 deletions graft/subnet-evm/tests/utils/tmpnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ var DefaultChainConfig = map[string]any{
"local-txs-enabled": true,
}

func NewTmpnetNodes(count int) []*tmpnet.Node {
nodes := make([]*tmpnet.Node, count)
for i := range nodes {
node := tmpnet.NewNode()
_ = node.EnsureKeys() // guaranteed to be nil for new node
nodes[i] = node
}
return nodes
}

func NewTmpnetNetwork(owner string, nodes []*tmpnet.Node, flags tmpnet.FlagsMap, subnets ...*tmpnet.Subnet) *tmpnet.Network {
defaultFlags := tmpnet.FlagsMap{}
defaultFlags.SetDefaults(flags)
Expand Down
3 changes: 1 addition & 2 deletions graft/subnet-evm/tests/warp/warp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ func TestE2E(t *testing.T) {

var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
// Run only once in the first ginkgo process

tc := e2e.NewTestContext()
nodes := utils.NewTmpnetNodes(tmpnet.DefaultNodeCount)

nodes := tmpnet.NewNodesOrPanic(tmpnet.DefaultNodeCount)
env := e2e.NewTestEnvironment(
tc,
flagVars,
Expand Down