Skip to content

Commit 3e68bda

Browse files
committed
publish ethereum-triedb
1 parent e4d0e36 commit 3e68bda

File tree

19 files changed

+79
-46
lines changed

19 files changed

+79
-46
lines changed

Cargo.lock

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ pallet-mmr = { path = "modules/trees/mmr/pallet", default-features = false }
272272
# merkle trees
273273
pallet-mmr-runtime-api = { path = "modules/trees/mmr/pallet/runtime-api", default-features = false }
274274
mmr-gadget = { path = "modules/trees/mmr/gadget" }
275-
ethereum-trie = { path = "./modules/trees/ethereum", default-features = false }
275+
ethereum-triedb = { version = "0.1.1", path = "./modules/trees/ethereum", default-features = false }
276276
mmr-primitives = { version = "1.6.2", path = "modules/trees/mmr/primitives", default-features = false }
277277

278278
# runtimes

modules/hyperclient/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ evm-common = { workspace = true }
4242
sp-core = { workspace = true }
4343
substrate-state-machine = { workspace = true }
4444
ismp-solidity-abi = { workspace = true }
45-
ethereum-trie = { workspace = true }
45+
ethereum-triedb = { workspace = true }
4646
subxt-utils = { workspace = true }
4747
hex = "0.4.3"
4848

modules/hyperclient/src/providers/evm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{
22
providers::interface::{Client, RequestOrResponse},
33
types::BoxStream,
44
};
5-
use ethereum_trie::StorageProof;
5+
use ethereum_triedb::StorageProof;
66
use ethers::prelude::Middleware;
77
use evm_common::presets::{
88
REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT,

modules/ismp/clients/arbitrum/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ publish = false
1010
[dependencies]
1111
# polytope labs
1212
ismp = { workspace = true }
13-
ethereum-trie = { workspace = true }
13+
ethereum-triedb = { workspace = true }
1414
geth-primitives = { workspace = true }
1515
evm-common = { workspace = true }
1616

@@ -36,7 +36,7 @@ default = ["std"]
3636
std = [
3737
"codec/std",
3838
"ismp/std",
39-
"ethereum-trie/std",
39+
"ethereum-triedb/std",
4040
"alloy-rlp/std",
4141
"alloy-primitives/std",
4242
"ethabi/std",

modules/ismp/clients/optimism/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publish = false
99
[dependencies]
1010
# polytope labs
1111
ismp = { workspace = true }
12-
ethereum-trie = { workspace = true }
12+
ethereum-triedb = { workspace = true }
1313
geth-primitives = { workspace = true }
1414
evm-common = { workspace = true }
1515

@@ -29,7 +29,7 @@ default = ["std"]
2929
std = [
3030
"codec/std",
3131
"ismp/std",
32-
"ethereum-trie/std",
32+
"ethereum-triedb/std",
3333
"alloy-rlp/std",
3434
"alloy-primitives/std",
3535
"ethabi/std",

modules/ismp/clients/sync-committee/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ publish = false
1212
ismp = { workspace = true, default-features = false }
1313
sync-committee-primitives = { workspace = true, default-features = false }
1414
sync-committee-verifier = { workspace = true, default-features = false }
15-
ethereum-trie = { workspace = true, default-features = false }
15+
ethereum-triedb = { workspace = true, default-features = false }
1616
pallet-ismp = { workspace = true, default-features = false }
1717
geth-primitives = { workspace = true, default-features = false }
1818
evm-common = { workspace = true }
@@ -38,7 +38,7 @@ default = ["std"]
3838
std = [
3939
"codec/std",
4040
"ismp/std",
41-
"ethereum-trie/std",
41+
"ethereum-triedb/std",
4242
"ethabi/std",
4343
"hex/std",
4444
"sync-committee-primitives/std",

modules/ismp/clients/sync-committee/evm-common/Cargo.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ publish = false
1010
[dependencies]
1111
# polytope labs
1212
ismp = { workspace = true }
13-
ethereum-trie = { workspace = true }
13+
ethereum-triedb = { workspace = true }
1414
geth-primitives = { workspace = true }
1515

1616
# crates.io
@@ -31,7 +31,7 @@ default = ["std"]
3131
std = [
3232
"codec/std",
3333
"ismp/std",
34-
"ethereum-trie/std",
34+
"ethereum-triedb/std",
3535
"trie-db/std",
3636
"hash-db/std",
3737
"alloy-rlp/std",
@@ -41,5 +41,3 @@ std = [
4141
"hex/std",
4242
"geth-primitives/std"
4343
]
44-
45-

modules/ismp/clients/sync-committee/evm-common/src/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use alloc::{format, string::ToString};
2525
use alloy_rlp::Decodable;
2626
use codec::Decode;
2727
use ethabi::ethereum_types::{H256, U256};
28-
use ethereum_trie::{EIP1186Layout, StorageProof};
28+
use ethereum_triedb::{EIP1186Layout, StorageProof};
2929
use ismp::{
3030
consensus::{
3131
ConsensusStateId, IntermediateState, StateCommitment, StateMachineHeight, StateMachineId,

modules/ismp/core/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Rust implementation of the Interoperable State Machine Protocol. This project is
44

55
This repo provides an implementation of the neccessary components laid out in the [ISMP specifications](https://docs.hyperbridge.network/protocol/ismp).
66

7-
- [x] [`Message` Definitions](https://docs.rs/ismp/latest/ismp/messaging/index.html)
8-
- [x] [`Message` Handlers](https://docs.rs/ismp/latest/ismp/handlers/index.html)
9-
- [x] [`ConsensusClient` and `StateMachineClient` definitions](https://docs.rs/ismp/latest/ismp/consensus/index.html)
10-
- [x] [`IsmpHost` definitions](https://docs.rs/ismp/latest/ismp/host/index.html)
11-
- [x] [`IsmpRouter` definitions](https://docs.rs/ismp/latest/ismp/router/index.html)
12-
- [x] [`IsmpDispatcher` definitions](https://docs.rs/ismp/latest/ismp/dispatcher/index.html)
7+
- [`Message` Definitions](https://docs.rs/ismp/latest/ismp/messaging/index.html)
8+
- [`Message` Handlers](https://docs.rs/ismp/latest/ismp/handlers/index.html)
9+
- [`ConsensusClient` and `StateMachineClient` definitions](https://docs.rs/ismp/latest/ismp/consensus/index.html)
10+
- [`IsmpHost` definitions](https://docs.rs/ismp/latest/ismp/host/index.html)
11+
- [`IsmpRouter` definitions](https://docs.rs/ismp/latest/ismp/router/index.html)
12+
- [`IsmpDispatcher` definitions](https://docs.rs/ismp/latest/ismp/dispatcher/index.html)
1313

1414
## License
1515

modules/ismp/pallets/relayer/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ethabi = { version = "18.0.0", features = ["rlp", "parity-codec"], default-featu
3838
pallet-ismp = { workspace = true, features = [ "testing" ] }
3939
pallet-timestamp = { workspace = true }
4040
pallet-balances = { workspace = true }
41-
ethereum-trie = { workspace = true }
41+
ethereum-triedb = { workspace = true }
4242
trie-db = { workspace = true }
4343
hash-db = { workspace = true }
4444
ismp-bsc = { workspace = true }

modules/ismp/pallets/testsuite/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ismp-sync-committee = { workspace = true, default-features = true }
3737
ismp-bsc = { workspace = true, default-features = true }
3838
pallet-ismp = { workspace = true, default-features = true, features = ["testing"] }
3939
pallet-hyperbridge = { workspace = true, default-features = true }
40-
ethereum-trie = { workspace = true, default-features = true }
40+
ethereum-triedb = { workspace = true, default-features = true }
4141
substrate-state-machine = { workspace = true, default-features = true }
4242
pallet-ismp-relayer = { workspace = true, default-features = true }
4343
pallet-fishermen = { workspace = true, default-features = true }

modules/ismp/pallets/testsuite/src/tests/pallet_ismp_relayer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use alloy_primitives::hex;
1919
use codec::{Decode, Encode};
20-
use ethereum_trie::{keccak::KeccakHasher, MemoryDB, StorageProof};
20+
use ethereum_triedb::{keccak::KeccakHasher, MemoryDB, StorageProof};
2121
use evm_common::types::EvmStateProof;
2222
use frame_support::crypto::ecdsa::ECDSAExt;
2323
use ismp::{

modules/trees/ethereum/Cargo.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[package]
2-
name = "ethereum-trie"
2+
name = "ethereum-triedb"
33
version = "0.1.1"
44
edition = "2021"
5-
description = "Ethereum EIP-1886 layout implementation for parity/trie"
5+
description = "EIP-1186 ethereum trie layout implementation for parity/trie"
66
authors = ["Polytope Labs <hello@polytope.technology>"]
7-
publish = false
8-
9-
7+
license = "Apache-2.0"
8+
repository = "https://github.com/polytope-labs/hyperbridge"
9+
documentation = "https://docs.rs/ethereum-triedb"
10+
keywords = ["merkle-patricia-trie", "ethereum", "state-proofs", "storage-proofs"]
11+
readme = "./README.md"
1012

1113
[dependencies]
1214
trie-db = { workspace = true }

modules/trees/ethereum/README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Ethereum Trie
1+
# Ethereum TrieDB
22

3-
This library allows users to verify ethereum style merkle patricia proofs as specified in this document: https://ethereum.github.io/execution-specs/autoapi/ethereum/frontier/trie/index.html
3+
This crate exposes an implementation of [`trie_db::TrieLayout`](https://docs.rs/trie-db/0.29.0/trie_db/trait.TrieLayout.html) that allows [`trie_db::TrieDb`](https://docs.rs/trie-db/0.29.0/trie_db/triedb/struct.TrieDB.html)
4+
be used for verifying Ethereum style merkle patricia proofs. as specified in this document [EIP-1186](https://eips.ethereum.org/EIPS/eip-1186).
45

56
```rust
6-
use ethereum_trie::{
7+
use ethereum_triedb::{
78
keccak::{keccak_256, KeccakHasher},
89
EIP1186Layout, StorageProof,
910
};
@@ -60,6 +61,10 @@ fn main() {
6061
}
6162
```
6263

63-
### No Std
64+
### No Std
6465

65-
This library supports `no_std`, simply add `default-features = false` to the dependecncy entry in your `Cargo.toml`
66+
This library also supports `no_std`, simply add `default-features = false` to the dependecncy entry in your `Cargo.toml`
67+
68+
## License
69+
70+
This library is licensed under the Apache 2.0 License, Copyright (c) 2024 Polytope Labs.

modules/trees/ethereum/src/lib.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
//! This crate exposes an implementation of `trie_db::TrieLayout` that allows `trie_db::TrieDb`
2-
//! be used for verifying Ethereum state proofs as per [EIP-1186](https://eips.ethereum.org/EIPS/eip-1186)
1+
// Copyright (C) Polytope Labs Ltd.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
315

416
#![cfg_attr(not(feature = "std"), no_std)]
17+
#![doc = include_str!("../README.md")]
518

619
extern crate alloc;
720

modules/trees/ethereum/src/tests.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (C) Polytope Labs Ltd.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
116
use crate::{
217
keccak::{keccak_256, KeccakHasher},
318
EIP1186Layout, StorageProof,

tesseract/evm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ismp = { workspace = true, default-features = true }
4040
pallet-ismp-rpc = { workspace = true, default-features = true }
4141
geth-primitives = { workspace = true, default-features = true }
4242
ismp-sync-committee = { workspace = true, default-features = true }
43-
ethereum-trie = { workspace = true, default-features = true }
43+
ethereum-triedb = { workspace = true, default-features = true }
4444
mmr-primitives = { workspace = true, default-features = true }
4545
evm-common = { workspace = true, default-features = true }
4646
sp-mmr-primitives = { workspace = true, default-features = true }

tesseract/evm/src/provider.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::{
2424
gas_oracle::{get_current_gas_cost_in_usd, get_l2_data_cost},
2525
tx::{generate_contract_calls, get_chain_gas_limit},
2626
};
27-
use ethereum_trie::StorageProof;
27+
use ethereum_triedb::StorageProof;
2828
use ethers::{
2929
contract::parse_log,
3030
types::{

0 commit comments

Comments
 (0)