Skip to content

Commit fcb581a

Browse files
committed
Merge branch 'fix/tree-openzeppelin-compliant' into feat/verify-agg-proof-on-chain
2 parents ac2aa51 + bb1e223 commit fcb581a

File tree

48 files changed

+2547
-3235
lines changed

Some content is hidden

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

48 files changed

+2547
-3235
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@
3737
[submodule "contracts/lib/risc0-ethereum"]
3838
path = contracts/lib/risc0-ethereum
3939
url = https://github.com/risc0/risc0-ethereum
40+
[submodule "contracts/eigenlayer_contracts/eigenlayer-contracts"]
41+
path = contracts/eigenlayer_contracts/eigenlayer-contracts
42+
url = https://github.com/Layr-Labs/eigenlayer-contracts.git

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export OPERATOR_ADDRESS ?= $(shell yq -r '.operator.address' $(CONFIG_FILE))
88
AGG_CONFIG_FILE?=config-files/config-aggregator.yaml
99

1010
OPERATOR_VERSION=v0.15.2
11-
EIGEN_SDK_GO_VERSION_DEVNET=v0.1.13
11+
EIGEN_SDK_GO_VERSION_DEVNET=v0.2.0-beta.1
1212
EIGEN_SDK_GO_VERSION_TESTNET=v0.2.0-beta.1
1313
EIGEN_SDK_GO_VERSION_MAINNET=v0.2.0-beta.1
1414

@@ -73,7 +73,9 @@ install_foundry:
7373
curl -L https://foundry.paradigm.xyz | bash
7474

7575
install_eigenlayer_cli_devnet: ## Install Eigenlayer CLI v0.11.3 (Devnet compatible)
76-
curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s -- v0.11.3
76+
curl -sSfL https://raw.githubusercontent.com/layr-labs/eigenlayer-cli/master/scripts/install.sh | sh -s -- v0.13.0
77+
78+
anvil_deploy_all_contracts: anvil_deploy_eigen_contracts anvil_deploy_risc0_contracts anvil_deploy_sp1_contracts anvil_deploy_aligned_contracts
7779

7880
anvil_deploy_eigen_contracts:
7981
@echo "Deploying Eigen Contracts..."
@@ -346,7 +348,7 @@ operator_remove_from_whitelist:
346348

347349
operator_deposit_into_mock_strategy:
348350
@echo "Depositing into mock strategy"
349-
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.MOCK' contracts/script/output/devnet/eigenlayer_deployment_output.json))
351+
$(eval STRATEGY_ADDRESS = $(shell jq -r '.addresses.strategies.WETH' contracts/script/output/devnet/eigenlayer_deployment_output.json))
350352
@go run operator/cmd/main.go deposit-into-strategy \
351353
--config $(CONFIG_FILE) \
352354
--strategy-address $(STRATEGY_ADDRESS) \

aggregation_mode/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ make start_proof_aggregator_gpu AGGREGATOR="sp1|risc0"
6161
1. Get latest aggregated proof:
6262

6363
```shell
64-
cast call 0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc "currentAggregatedProofNumber()" --rpc-url http://localhost:8545
64+
cast call 0xc351628EB244ec633d5f21fBD6621e1a683B1181 "currentAggregatedProofNumber()" --rpc-url http://localhost:8545
6565
```
6666

6767
2. Get aggregated proof info:
6868

6969
```shell
70-
cast call 0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc "getAggregatedProof(uint64)(uint8,bytes32,bytes32)" <AGG_PROOF_NUMBER> --rpc-url http://localhost:8545
70+
cast call 0xc351628EB244ec633d5f21fBD6621e1a683B1181 "getAggregatedProof(uint64)(uint8,bytes32,bytes32)" <AGG_PROOF_NUMBER> --rpc-url http://localhost:8545
7171
```

aggregation_mode/aggregation_programs/risc0/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ impl IsMerkleTreeBackend for Risc0ImageIdAndPubInputs {
4040
leaf.commitment()
4141
}
4242

43+
/// Computes a commutative Keccak256 hash, ensuring H(a, b) == H(b, a).
44+
///
45+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#Hashes
46+
///
47+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/Hashes.sol#L17-L19
48+
///
49+
/// Compliant with OpenZeppelin's `processProofCalldata` function from MerkleProof.sol.
50+
///
51+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#MerkleProof
52+
///
53+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol#L114-L128
4354
fn hash_new_parent(child_1: &Self::Node, child_2: &Self::Node) -> Self::Node {
4455
let mut hasher = Keccak::v256();
4556
if child_1 < child_2 {

aggregation_mode/aggregation_programs/sp1/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ impl IsMerkleTreeBackend for SP1VkAndPubInputs {
3737
leaf.hash()
3838
}
3939

40+
/// Computes a commutative Keccak256 hash, ensuring H(a, b) == H(b, a).
41+
///
42+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#Hashes
43+
///
44+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/Hashes.sol#L17-L19
45+
///
46+
/// Compliant with OpenZeppelin's `processProofCalldata` function from MerkleProof.sol.
47+
///
48+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#MerkleProof
49+
///
50+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol#L114-L128
4051
fn hash_new_parent(child_1: &Self::Node, child_2: &Self::Node) -> Self::Node {
4152
let mut hasher = Keccak256::new();
4253
if child_1 < child_2 {

aggregation_mode/programs_ids.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"risc0_image_id": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8",
33
"sp1_vk_hash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384"
4-
}
4+
}

aggregation_mode/src/aggregators/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ impl IsMerkleTreeBackend for AlignedProof {
150150
leaf.commitment()
151151
}
152152

153+
/// Computes a commutative Keccak256 hash, ensuring H(a, b) == H(b, a).
154+
///
155+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#Hashes
156+
///
157+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/Hashes.sol#L17-L19
158+
///
159+
/// Compliant with OpenZeppelin's `processProofCalldata` function from MerkleProof.sol.
160+
///
161+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#MerkleProof
162+
///
163+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol#L114-L128
153164
fn hash_new_parent(child_1: &Self::Node, child_2: &Self::Node) -> Self::Node {
154165
let mut hasher = Keccak256::new();
155166
if child_1 < child_2 {

batcher/aligned-sdk/src/core/constants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub const BUMP_MAX_RETRY_DELAY: u64 = 3600; // seconds
5252
/// NETWORK ADDRESSES ///
5353
/// BatcherPaymentService
5454
pub const BATCHER_PAYMENT_SERVICE_ADDRESS_DEVNET: &str =
55-
"0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650";
55+
"0x7969c5eD335650692Bc04293B07F5BF2e7A673C0";
5656
pub const BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY: &str =
5757
"0x815aeCA64a974297942D2Bbf034ABEe22a38A003";
5858
pub const BATCHER_PAYMENT_SERVICE_ADDRESS_HOLESKY_STAGE: &str =
@@ -63,7 +63,7 @@ pub const BATCHER_PAYMENT_SERVICE_ADDRESS_MAINNET_STAGE: &str =
6363
"0x88ad27EfBeF16b6fC5b2E40c5155d61876f847c5";
6464

6565
/// AlignedServiceManager
66-
pub const ALIGNED_SERVICE_MANAGER_DEVNET: &str = "0x851356ae760d987E095750cCeb3bC6014560891C";
66+
pub const ALIGNED_SERVICE_MANAGER_DEVNET: &str = "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8";
6767
pub const ALIGNED_SERVICE_MANAGER_HOLESKY: &str = "0x58F280BeBE9B34c9939C3C39e0890C81f163B623";
6868
pub const ALIGNED_SERVICE_MANAGER_HOLESKY_STAGE: &str =
6969
"0x9C5231FC88059C086Ea95712d105A2026048c39B";
@@ -79,7 +79,7 @@ pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY_STAGE: &str =
7979
pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_HOLESKY: &str =
8080
"0xe84CD4084d8131841CE6DC265361f81F4C59a1d4";
8181
pub const ALIGNED_PROOF_AGG_SERVICE_ADDRESS_DEVNET: &str =
82-
"0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc";
82+
"0xFD471836031dc5108809D173A067e8486B9047A3";
8383

8484
/// Batcher URL's
8585
pub const BATCHER_URL_DEVNET: &str = "ws://localhost:8080";

batcher/aligned-sdk/src/sdk/aggregation/types.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,18 @@ impl IsMerkleTreeBackend for Hash32 {
7373
fn hash_data(leaf: &Self::Data) -> Self::Node {
7474
leaf.0
7575
}
76-
76+
77+
/// Computes a commutative Keccak256 hash, ensuring H(a, b) == H(b, a).
78+
///
79+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#Hashes
80+
///
81+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/Hashes.sol#L17-L19
82+
///
83+
/// Compliant with OpenZeppelin's `processProofCalldata` function from MerkleProof.sol.
84+
///
85+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#MerkleProof
86+
///
87+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol#L114-L128
7788
fn hash_new_parent(child_1: &Self::Node, child_2: &Self::Node) -> Self::Node {
7889
let mut hasher = Keccak256::new();
7990
if child_1 < child_2 {

config-files/config-proof-aggregator-mock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
eth_rpc_url: http://localhost:8545
22
eth_ws_url: ws://localhost:8545
33
max_proofs_in_queue: 1000
4-
proof_aggregation_service_address: 0xB0D4afd8879eD9F52b28595d31B441D079B2Ca07
5-
aligned_service_manager_address: 0x851356ae760d987E095750cCeb3bC6014560891C
4+
proof_aggregation_service_address: 0x1429859428C0aBc9C2C47C8Ee9FBaf82cFA0F20f
5+
aligned_service_manager_address: 0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8
66
last_aggregated_block_filepath: config-files/proof-aggregator.last_aggregated_block.json
77
ecdsa:
88
private_key_store_path: config-files/anvil.proof-aggregator.ecdsa.key.json

0 commit comments

Comments
 (0)