Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp: add support for electra #375

Merged
merged 15 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ PRIVATE_KEY="PRIVATE-KEY"
# Optional address of the sp1 verifier contract to use (if not set, the contract will be deployed)
# Can be set to "mock" to use the mock verifier
VERIFIER=mock
# Optional rust log level (used by the relayer), will use info by default
# Set to "debug" to get more detailed logs from the relayer process
RUST_LOG=info

# URL of the Tendermint RPC node
TENDERMINT_RPC_URL=http://public-celestia-mocha4-consensus.numia.xyz/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ broadcast/*/31337/
# ide files
.idea/
*.iml
CLAUDE.md

# Rust
target
Expand All @@ -32,3 +33,4 @@ bacon.toml
# Config files and test artifacts
programs/relayer/config.json
scripts/genesis.json
network_params.yaml
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions e2e/interchaintestv8/chainconfig/kurtosis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (

const (
// ethereumPackageId is the package ID used by Kurtosis to find the Ethereum package we use for the testnet
ethereumPackageId = "github.com/ethpandaops/ethereum-package@4.4.0"
ethereumPackageId = "github.com/ethpandaops/ethereum-package@4.5.0"

faucetPrivateKey = "0x04b9f63ecf84210c5366c66d68fa1f5da1fa4f634fad6dfc86178e4d79ff9e59"
)
Expand All @@ -32,14 +32,15 @@ var (
Participants: []kurtosisParticipant{
{
CLType: "lodestar",
CLImage: "chainsafe/lodestar:v1.24.0",
CLImage: "ethpandaops/lodestar:devnet-5-1c2b5ed",
ELType: "geth",
ELImage: "ethereum/client-go:v1.14.6",
ELImage: "ethpandaops/geth:prague-devnet-5-a193537",
ELLogLevel: "info",
},
},
NetworkParams: kurtosisNetworkConfigParams{
Preset: "minimal",
Preset: "minimal",
ElectraForkEpoch: 1,
},
WaitForFinalization: true,
}
Expand Down Expand Up @@ -72,7 +73,8 @@ type kurtosisParticipant struct {
}

type kurtosisNetworkConfigParams struct {
Preset string `json:"preset"`
Preset string `json:"preset"`
ElectraForkEpoch uint64 `json:"electra_fork_epoch"`
}

// SpinUpKurtosisPoS spins up a kurtosis enclave with Etheruem PoS testnet using github.com/ethpandaops/ethereum-package
Expand Down Expand Up @@ -136,7 +138,7 @@ func SpinUpKurtosisPoS(ctx context.Context) (EthKurtosisChain, error) {

// Wait for the chain to finalize
beaconAPIClient := ethereum.NewBeaconAPIClient(beaconRPC)
err = testutil.WaitForCondition(10*time.Minute, 5*time.Second, func() (bool, error) {
err = testutil.WaitForCondition(30*time.Minute, 5*time.Second, func() (bool, error) {
finalizedBlocksResp, err := beaconAPIClient.GetFinalizedBlocks()
fmt.Printf("Waiting for chain to finalize, finalizedBlockResp: %+v, err: %s\n", finalizedBlocksResp, err)
if err != nil {
Expand Down
13 changes: 11 additions & 2 deletions e2e/interchaintestv8/e2esuite/light_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ import (
"github.com/cosmos/solidity-ibc-eureka/abigen/ics26router"

"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/types"
ethereumtypes "github.com/srdtrk/solidity-ibc-eureka/e2e/v8/types/ethereum"
)

func (s *TestSuite) CreateEthereumLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet, ibcContractAddress string) {
func (s *TestSuite) CreateEthereumLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet, ibcContractAddress string, wasmFixtureGenerator *types.WasmFixtureGenerator) {
switch s.ethTestnetType {
case testvalues.EthTestnetTypePoW:
s.createDummyLightClient(ctx, cosmosChain, simdRelayerUser)
case testvalues.EthTestnetTypePoS:
s.createEthereumLightClient(ctx, cosmosChain, simdRelayerUser, ibcContractAddress)
s.createEthereumLightClient(ctx, cosmosChain, simdRelayerUser, ibcContractAddress, wasmFixtureGenerator)
default:
panic(fmt.Sprintf("Unrecognized Ethereum testnet type: %v", s.ethTestnetType))
}
Expand All @@ -39,6 +40,7 @@ func (s *TestSuite) createEthereumLightClient(
cosmosChain *cosmos.CosmosChain,
simdRelayerUser ibc.Wallet,
ibcContractAddress string,
wasmFixtureGenerator *types.WasmFixtureGenerator,
) {
eth := s.EthChain

Expand Down Expand Up @@ -134,6 +136,13 @@ func (s *TestSuite) createEthereumLightClient(
ethereumLightClientID, err := ibctesting.ParseClientIDFromEvents(res.Events)
s.Require().NoError(err)
s.Require().Equal(testvalues.FirstWasmClientID, ethereumLightClientID)

if wasmFixtureGenerator != nil {
wasmFixtureGenerator.AddFixtureStep("initial_state", ethereumtypes.InitialState{
ClientState: ethClientState,
ConsensusState: ethConsensusState,
})
}
}

func (s *TestSuite) createDummyLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet) {
Expand Down
4 changes: 4 additions & 0 deletions e2e/interchaintestv8/ethereum/beaconapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func (s Spec) ToForkParameters() ethereumtypes.ForkParameters {
Version: ethcommon.Bytes2Hex(s.DenebForkVersion[:]),
Epoch: s.DenebForkEpoch,
},
Electra: ethereumtypes.Fork{
Version: ethcommon.Bytes2Hex(s.ElectraForkVersion[:]),
Epoch: s.ElectraForkEpoch,
},
}
}

Expand Down
2 changes: 2 additions & 0 deletions e2e/interchaintestv8/ethereum/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type Spec struct {
CapellaForkEpoch uint64 `json:"CAPELLA_FORK_EPOCH"`
DenebForkVersion phase0.Version `json:"DENEB_FORK_VERSION"`
DenebForkEpoch uint64 `json:"DENEB_FORK_EPOCH"`
ElectraForkVersion phase0.Version `json:"ELECTRA_FORK_VERSION"`
ElectraForkEpoch uint64 `json:"ELECTRA_FORK_EPOCH"`
}

type Bootstrap struct {
Expand Down
42 changes: 21 additions & 21 deletions e2e/interchaintestv8/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.4.0
cosmossdk.io/x/upgrade v0.1.4
github.com/attestantio/go-eth2-client v0.21.11
github.com/attestantio/go-eth2-client v0.24.0
github.com/cometbft/cometbft v0.38.15
github.com/cosmos/cosmos-sdk v0.50.12
github.com/cosmos/gogoproto v1.7.0
github.com/cosmos/ibc-go/modules/light-clients/08-wasm/v10 v10.0.0-rc.3
github.com/cosmos/ibc-go/v10 v10.0.0-rc.3
github.com/cosmos/solidity-ibc-eureka/abigen v0.0.0
github.com/docker/docker v27.3.1+incompatible
github.com/ethereum/go-ethereum v1.14.12
github.com/holiman/uint256 v1.3.1
github.com/ethereum/go-ethereum v1.15.5
github.com/holiman/uint256 v1.3.2
github.com/kurtosis-tech/kurtosis/api/golang v1.5.0
github.com/rs/zerolog v1.33.0
github.com/strangelove-ventures/interchaintest/v8 v8.3.0
Expand Down Expand Up @@ -56,7 +56,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.2.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/bits-and-blooms/bitset v1.17.0 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
Expand All @@ -68,8 +68,8 @@ require (
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.14.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/consensys/bavard v0.1.22 // indirect
github.com/consensys/gnark-crypto v0.14.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.1.1 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
Expand All @@ -79,8 +79,8 @@ require (
github.com/cosmos/ibc-go/modules/capability v1.0.1 // indirect
github.com/cosmos/ics23/go v0.11.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect
github.com/crate-crypto/go-kzg-4844 v1.1.0 // indirect
github.com/danieljoos/wincred v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
Expand All @@ -94,12 +94,12 @@ require (
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.7.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/emicklei/dot v1.6.4 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/ferranbt/fastssz v0.1.3 // indirect
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/getsentry/sentry-go v0.28.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
Expand Down Expand Up @@ -156,7 +156,7 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20230818182330-1a86869414d2 // indirect
Expand All @@ -168,7 +168,7 @@ require (
github.com/linxGnu/grocksdb v1.9.2 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/minio/highwayhash v1.0.3 // indirect
Expand All @@ -192,14 +192,14 @@ require (
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pk910/dynamic-ssz v0.0.3 // indirect
github.com/pk910/dynamic-ssz v0.0.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.60.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240328144219-a1caa50c3a1e // indirect
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 // indirect
github.com/r3labs/sse/v2 v2.10.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
Expand All @@ -219,7 +219,7 @@ require (
github.com/spf13/viper v1.19.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/supranational/blst v0.3.14 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tidwall/btree v1.7.0 // indirect
Expand All @@ -242,16 +242,16 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.29.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
google.golang.org/api v0.186.0 // indirect
google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect
Expand Down
Loading
Loading