Skip to content

Commit 8422cfe

Browse files
authored
Merge branch 'main' into zygis/admin-only-pause
2 parents 1b03292 + cf3b2d8 commit 8422cfe

File tree

93 files changed

+1181
-1847
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1181
-1847
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ PRIVATE_KEY="PRIVATE-KEY"
1010
# Optional address of the sp1 verifier contract to use (if not set, the contract will be deployed)
1111
# Can be set to "mock" to use the mock verifier
1212
VERIFIER=mock
13+
# Optional rust log level (used by the relayer), will use info by default
14+
# Set to "debug" to get more detailed logs from the relayer process
15+
RUST_LOG=info
1316

1417
# URL of the Tendermint RPC node
1518
TENDERMINT_RPC_URL=http://public-celestia-mocha4-consensus.numia.xyz/

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ broadcast/*/31337/
2222
# ide files
2323
.idea/
2424
*.iml
25+
CLAUDE.md
2526

2627
# Rust
2728
target
@@ -32,3 +33,4 @@ bacon.toml
3233
# Config files and test artifacts
3334
programs/relayer/config.json
3435
scripts/genesis.json
36+
network_params.yaml

Cargo.lock

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ The following benchmarks are for a single packet transfer without aggregation.
190190
| **Contract** | **Method** | **Description** | **Gas (groth16)** | **Gas (plonk)** |
191191
|:---:|:---:|:---:|:---:|:---:|
192192
| `ICS26Router.sol` | `sendPacket` | Initiating an IBC transfer with an `ERC20`. | ~165,000 | ~165,000 |
193-
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~518,643 | ~601,729 |
194-
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,087,456 | ~1,171,586 |
195-
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~393,398 | ~477,221 |
196-
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~466,007 | ~549,322 |
193+
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~518,340 | ~602,020 |
194+
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,087,699 | ~1,171,433 |
195+
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~392,851 | ~476,578 |
196+
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~466,083 | ~550,208 |
197197
198198
### Aggregated Packet Benchmarks
199199
@@ -202,8 +202,8 @@ Since there is no meaningful difference in gas costs between plonk and groth16 i
202202
203203
| **ICS26Router Method** | **Description** | **Avg Gas (25 packets)** | **Avg Gas (50 packets)** | **Calldata size (25 packets)** | **Calldata size (50 packets)** |
204204
|:---:|:---:|:---:|:---:|:---:|:---:|
205-
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~178,272 | ~165,240 | ~51,172B | ~100,772B |
206-
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~92,269 | ~86,564 | ~53,572B | ~105,572B |
205+
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~178,487 | ~172,258 | ~51,172B | ~100,772B |
206+
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~91,722 | ~86,018 | ~53,572B | ~105,572B |
207207
208208
Note: These gas benchmarks are with Groth16.
209209

abi/ICS26Router.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@
141141
"components": [
142142
{
143143
"name": "revisionNumber",
144-
"type": "uint32",
145-
"internalType": "uint32"
144+
"type": "uint64",
145+
"internalType": "uint64"
146146
},
147147
{
148148
"name": "revisionHeight",
149-
"type": "uint32",
150-
"internalType": "uint32"
149+
"type": "uint64",
150+
"internalType": "uint64"
151151
}
152152
]
153153
}
@@ -901,13 +901,13 @@
901901
"components": [
902902
{
903903
"name": "revisionNumber",
904-
"type": "uint32",
905-
"internalType": "uint32"
904+
"type": "uint64",
905+
"internalType": "uint64"
906906
},
907907
{
908908
"name": "revisionHeight",
909-
"type": "uint32",
910-
"internalType": "uint32"
909+
"type": "uint64",
910+
"internalType": "uint64"
911911
}
912912
]
913913
}
@@ -1203,13 +1203,13 @@
12031203
"components": [
12041204
{
12051205
"name": "revisionNumber",
1206-
"type": "uint32",
1207-
"internalType": "uint32"
1206+
"type": "uint64",
1207+
"internalType": "uint64"
12081208
},
12091209
{
12101210
"name": "revisionHeight",
1211-
"type": "uint32",
1212-
"internalType": "uint32"
1211+
"type": "uint64",
1212+
"internalType": "uint64"
12131213
}
12141214
]
12151215
}

abi/SP1ICS07Tendermint.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@
152152
"components": [
153153
{
154154
"name": "revisionNumber",
155-
"type": "uint32",
156-
"internalType": "uint32"
155+
"type": "uint64",
156+
"internalType": "uint64"
157157
},
158158
{
159159
"name": "revisionHeight",
160-
"type": "uint32",
161-
"internalType": "uint32"
160+
"type": "uint64",
161+
"internalType": "uint64"
162162
}
163163
]
164164
},
@@ -204,8 +204,8 @@
204204
"inputs": [
205205
{
206206
"name": "revisionHeight",
207-
"type": "uint32",
208-
"internalType": "uint32"
207+
"type": "uint64",
208+
"internalType": "uint64"
209209
}
210210
],
211211
"outputs": [
@@ -302,13 +302,13 @@
302302
"components": [
303303
{
304304
"name": "revisionNumber",
305-
"type": "uint32",
306-
"internalType": "uint32"
305+
"type": "uint64",
306+
"internalType": "uint64"
307307
},
308308
{
309309
"name": "revisionHeight",
310-
"type": "uint32",
311-
"internalType": "uint32"
310+
"type": "uint64",
311+
"internalType": "uint64"
312312
}
313313
]
314314
},
@@ -355,13 +355,13 @@
355355
"components": [
356356
{
357357
"name": "revisionNumber",
358-
"type": "uint32",
359-
"internalType": "uint32"
358+
"type": "uint64",
359+
"internalType": "uint64"
360360
},
361361
{
362362
"name": "revisionHeight",
363-
"type": "uint32",
364-
"internalType": "uint32"
363+
"type": "uint64",
364+
"internalType": "uint64"
365365
}
366366
]
367367
},

abigen/ics26router/contract.go

+21-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

abigen/sp1ics07tendermint/contract.go

+27-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/light-clients/ISP1ICS07Tendermint.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ interface ISP1ICS07Tendermint {
3333
/// @notice Returns the consensus state keccak256 hash at the given revision height.
3434
/// @param revisionHeight The revision height.
3535
/// @return The consensus state at the given revision height.
36-
function getConsensusStateHash(uint32 revisionHeight) external view returns (bytes32);
36+
function getConsensusStateHash(uint64 revisionHeight) external view returns (bytes32);
3737
}

contracts/light-clients/SP1ICS07Tendermint.sol

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ contract SP1ICS07Tendermint is ISP1ICS07TendermintErrors, ISP1ICS07Tendermint, I
4141
IICS07TendermintMsgs.ClientState public clientState;
4242
/// @notice The mapping from height to consensus state keccak256 hashes.
4343
/// @dev Revision number need not be keyed as it is not allowed to change.
44-
mapping(uint32 height => bytes32 hash) private _consensusStateHashes;
44+
mapping(uint64 height => bytes32 hash) private _consensusStateHashes;
4545

4646
/// @inheritdoc ISP1ICS07Tendermint
4747
uint16 public constant ALLOWED_SP1_CLOCK_DRIFT = 30 minutes;
@@ -85,7 +85,7 @@ contract SP1ICS07Tendermint is ISP1ICS07TendermintErrors, ISP1ICS07Tendermint, I
8585
}
8686

8787
/// @inheritdoc ISP1ICS07Tendermint
88-
function getConsensusStateHash(uint32 revisionHeight) public view returns (bytes32) {
88+
function getConsensusStateHash(uint64 revisionHeight) public view returns (bytes32) {
8989
bytes32 hash = _consensusStateHashes[revisionHeight];
9090
require(hash != 0, ConsensusStateNotFound());
9191
return hash;
@@ -369,7 +369,7 @@ contract SP1ICS07Tendermint is ISP1ICS07TendermintErrors, ISP1ICS07Tendermint, I
369369
/// @param trustedConsensusState The trusted consensus state
370370
function _validateMembershipOutput(
371371
bytes32 outputCommitmentRoot,
372-
uint32 proofHeight,
372+
uint64 proofHeight,
373373
IICS07TendermintMsgs.ConsensusState memory trustedConsensusState
374374
)
375375
private
@@ -511,7 +511,7 @@ contract SP1ICS07Tendermint is ISP1ICS07TendermintErrors, ISP1ICS07Tendermint, I
511511
/// @param timestamp The timestamp of the trusted consensus state.
512512
/// @dev WARNING: Transient store is not reverted even if a message within a transaction reverts.
513513
/// @dev WARNING: This function must be called after all proof and validation checks.
514-
function _cacheKvPairs(uint32 proofHeight, IMembershipMsgs.KVPair[] memory kvPairs, uint256 timestamp) private {
514+
function _cacheKvPairs(uint64 proofHeight, IMembershipMsgs.KVPair[] memory kvPairs, uint256 timestamp) private {
515515
for (uint256 i = 0; i < kvPairs.length; i++) {
516516
bytes32 kvPairHash = keccak256(abi.encode(proofHeight, kvPairs[i]));
517517
kvPairHash.asUint256().tstore(timestamp);
@@ -523,7 +523,7 @@ contract SP1ICS07Tendermint is ISP1ICS07TendermintErrors, ISP1ICS07Tendermint, I
523523
/// @param kvPair The key-value pair.
524524
/// @return The timestamp of the cached key-value pair.
525525
function _getCachedKvPair(
526-
uint32 proofHeight,
526+
uint64 proofHeight,
527527
IMembershipMsgs.KVPair memory kvPair
528528
)
529529
private

contracts/msgs/IICS02ClientMsgs.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface IICS02ClientMsgs {
1717
/// @param revisionNumber The revision number of the counterparty chain
1818
/// @param revisionHeight The height of the counterparty chain
1919
struct Height {
20-
uint32 revisionNumber;
21-
uint32 revisionHeight;
20+
uint64 revisionNumber;
21+
uint64 revisionHeight;
2222
}
2323
}

e2e/interchaintestv8/chainconfig/kurtosis.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

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

2727
faucetPrivateKey = "0x04b9f63ecf84210c5366c66d68fa1f5da1fa4f634fad6dfc86178e4d79ff9e59"
2828
)
@@ -32,14 +32,15 @@ var (
3232
Participants: []kurtosisParticipant{
3333
{
3434
CLType: "lodestar",
35-
CLImage: "chainsafe/lodestar:v1.24.0",
35+
CLImage: "ethpandaops/lodestar:devnet-5-1c2b5ed",
3636
ELType: "geth",
37-
ELImage: "ethereum/client-go:v1.14.6",
37+
ELImage: "ethpandaops/geth:prague-devnet-5-a193537",
3838
ELLogLevel: "info",
3939
},
4040
},
4141
NetworkParams: kurtosisNetworkConfigParams{
42-
Preset: "minimal",
42+
Preset: "minimal",
43+
ElectraForkEpoch: 1,
4344
},
4445
WaitForFinalization: true,
4546
}
@@ -72,7 +73,8 @@ type kurtosisParticipant struct {
7273
}
7374

7475
type kurtosisNetworkConfigParams struct {
75-
Preset string `json:"preset"`
76+
Preset string `json:"preset"`
77+
ElectraForkEpoch uint64 `json:"electra_fork_epoch"`
7678
}
7779

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

137139
// Wait for the chain to finalize
138140
beaconAPIClient := ethereum.NewBeaconAPIClient(beaconRPC)
139-
err = testutil.WaitForCondition(10*time.Minute, 5*time.Second, func() (bool, error) {
141+
err = testutil.WaitForCondition(30*time.Minute, 5*time.Second, func() (bool, error) {
140142
finalizedBlocksResp, err := beaconAPIClient.GetFinalizedBlocks()
141143
fmt.Printf("Waiting for chain to finalize, finalizedBlockResp: %+v, err: %s\n", finalizedBlocksResp, err)
142144
if err != nil {

e2e/interchaintestv8/e2esuite/light_clients.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ import (
2020
"github.com/cosmos/solidity-ibc-eureka/abigen/ics26router"
2121

2222
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/testvalues"
23+
"github.com/srdtrk/solidity-ibc-eureka/e2e/v8/types"
2324
ethereumtypes "github.com/srdtrk/solidity-ibc-eureka/e2e/v8/types/ethereum"
2425
)
2526

26-
func (s *TestSuite) CreateEthereumLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet, ibcContractAddress string) {
27+
func (s *TestSuite) CreateEthereumLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet, ibcContractAddress string, wasmFixtureGenerator *types.WasmFixtureGenerator) {
2728
switch s.ethTestnetType {
2829
case testvalues.EthTestnetTypePoW:
2930
s.createDummyLightClient(ctx, cosmosChain, simdRelayerUser)
3031
case testvalues.EthTestnetTypePoS:
31-
s.createEthereumLightClient(ctx, cosmosChain, simdRelayerUser, ibcContractAddress)
32+
s.createEthereumLightClient(ctx, cosmosChain, simdRelayerUser, ibcContractAddress, wasmFixtureGenerator)
3233
default:
3334
panic(fmt.Sprintf("Unrecognized Ethereum testnet type: %v", s.ethTestnetType))
3435
}
@@ -39,6 +40,7 @@ func (s *TestSuite) createEthereumLightClient(
3940
cosmosChain *cosmos.CosmosChain,
4041
simdRelayerUser ibc.Wallet,
4142
ibcContractAddress string,
43+
wasmFixtureGenerator *types.WasmFixtureGenerator,
4244
) {
4345
eth := s.EthChain
4446

@@ -134,6 +136,13 @@ func (s *TestSuite) createEthereumLightClient(
134136
ethereumLightClientID, err := ibctesting.ParseClientIDFromEvents(res.Events)
135137
s.Require().NoError(err)
136138
s.Require().Equal(testvalues.FirstWasmClientID, ethereumLightClientID)
139+
140+
if wasmFixtureGenerator != nil {
141+
wasmFixtureGenerator.AddFixtureStep("initial_state", ethereumtypes.InitialState{
142+
ClientState: ethClientState,
143+
ConsensusState: ethConsensusState,
144+
})
145+
}
137146
}
138147

139148
func (s *TestSuite) createDummyLightClient(ctx context.Context, cosmosChain *cosmos.CosmosChain, simdRelayerUser ibc.Wallet) {

e2e/interchaintestv8/ethereum/beaconapi.go

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ func (s Spec) ToForkParameters() ethereumtypes.ForkParameters {
5555
Version: ethcommon.Bytes2Hex(s.DenebForkVersion[:]),
5656
Epoch: s.DenebForkEpoch,
5757
},
58+
Electra: ethereumtypes.Fork{
59+
Version: ethcommon.Bytes2Hex(s.ElectraForkVersion[:]),
60+
Epoch: s.ElectraForkEpoch,
61+
},
5862
}
5963
}
6064

e2e/interchaintestv8/ethereum/types.go

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type Spec struct {
2424
CapellaForkEpoch uint64 `json:"CAPELLA_FORK_EPOCH"`
2525
DenebForkVersion phase0.Version `json:"DENEB_FORK_VERSION"`
2626
DenebForkEpoch uint64 `json:"DENEB_FORK_EPOCH"`
27+
ElectraForkVersion phase0.Version `json:"ELECTRA_FORK_VERSION"`
28+
ElectraForkEpoch uint64 `json:"ELECTRA_FORK_EPOCH"`
2729
}
2830

2931
type Bootstrap struct {

0 commit comments

Comments
 (0)