Skip to content

Commit c70e656

Browse files
committed
docs: add comment to hash_new_parent function
fix: add missing new line chore: update program ids
1 parent c85ee63 commit c70e656

File tree

10 files changed

+55
-11
lines changed

10 files changed

+55
-11
lines changed

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/sdk/aggregation.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ impl IsMerkleTreeBackend for Hash32 {
7070
leaf.0
7171
}
7272

73+
/// Computes a commutative Keccak256 hash, ensuring H(a, b) == H(b, a).
74+
///
75+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#Hashes
76+
///
77+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/Hashes.sol#L17-L19
78+
///
79+
/// Compliant with OpenZeppelin's `processProofCalldata` function from MerkleProof.sol.
80+
///
81+
/// See: https://docs.openzeppelin.com/contracts/5.x/api/utils#MerkleProof
82+
///
83+
/// Source: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol#L114-L128
7384
fn hash_new_parent(child_1: &Self::Node, child_2: &Self::Node) -> Self::Node {
7485
let mut hasher = Keccak256::new();
7586
if child_1 < child_2 {

contracts/script/deploy/config/holesky/proof-aggregator-service.holesky.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"alignedAggregatorAddress": "0x9403dF48130621f87974a5A1d1d11d3aF1222A82"
66
},
77
"programs_id": {
8-
"sp1AggregationProgramVKHash": "0x0035279b39b0a20aac302dd3c569f3a6324a00acc1b8e864af9e3a5fbf453b69",
9-
"risc0AggregationProgramImageId": "0xb0ce0665805c4219d134845b74be6f1f97ab74dbbc1b341b73af4068d33bc1b0"
8+
"sp1AggregationProgramVKHash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384",
9+
"risc0AggregationProgramImageId": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8"
1010
},
1111
"permissions": {
1212
"owner": "0x97aEC5F28181abe5d2aD40dBe7FbaEe014529b7D"

contracts/script/deploy/config/holesky/proof-aggregator-service.holesky.config.stage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"alignedAggregatorAddress": "0x3595aa7d30f89f65933e7421dec77e4478d9fb01"
66
},
77
"programs_id": {
8-
"sp1AggregationProgramVKHash": "0x0035279b39b0a20aac302dd3c569f3a6324a00acc1b8e864af9e3a5fbf453b69",
9-
"risc0AggregationProgramImageId": "0xb0ce0665805c4219d134845b74be6f1f97ab74dbbc1b341b73af4068d33bc1b0"
8+
"sp1AggregationProgramVKHash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384",
9+
"risc0AggregationProgramImageId": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8"
1010
},
1111
"permissions": {
1212
"owner": "0xE3C695b73dbe27106aF4530b152de3e57456B385"

contracts/script/deploy/config/mainnet/proof-aggregator-service.mainnet.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"alignedAggregatorAddress": "<aligned_aggregator_address>"
66
},
77
"programs_id": {
8-
"sp1AggregationProgramVKHash": "0x0035279b39b0a20aac302dd3c569f3a6324a00acc1b8e864af9e3a5fbf453b69",
9-
"risc0AggregationProgramImageId": "0xb0ce0665805c4219d134845b74be6f1f97ab74dbbc1b341b73af4068d33bc1b0"
8+
"sp1AggregationProgramVKHash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384",
9+
"risc0AggregationProgramImageId": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8"
1010
},
1111
"permissions": {
1212
"owner": "<owner_address>"

contracts/script/deploy/config/mainnet_staging/proof-aggregator-service.mainnet.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"alignedAggregatorAddress": "<aligned_aggregator_address>"
66
},
77
"programs_id": {
8-
"sp1AggregationProgramVKHash": "0x0035279b39b0a20aac302dd3c569f3a6324a00acc1b8e864af9e3a5fbf453b69",
9-
"risc0AggregationProgramImageId": "0xb0ce0665805c4219d134845b74be6f1f97ab74dbbc1b341b73af4068d33bc1b0"
8+
"sp1AggregationProgramVKHash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384",
9+
"risc0AggregationProgramImageId": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8"
1010
},
1111
"permissions": {
1212
"owner": "<owner_address>"

contracts/script/deploy/config/sepolia/proof-aggregator-service.sepolia.config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"alignedAggregatorAddress": "<aligned_aggregator_address>"
66
},
77
"programs_id": {
8-
"sp1AggregationProgramVKHash": "0x0035279b39b0a20aac302dd3c569f3a6324a00acc1b8e864af9e3a5fbf453b69",
9-
"risc0AggregationProgramImageId": "0xb0ce0665805c4219d134845b74be6f1f97ab74dbbc1b341b73af4068d33bc1b0"
8+
"sp1AggregationProgramVKHash": "0x008ad92d4c564c912ad93d8660bf67a8d2e9088aa942da4e605a5e8c4383c384",
9+
"risc0AggregationProgramImageId": "0x8bb4145379d717fd7e3921751a2060246445ef290cdad782884180861cf0a3e8"
1010
},
1111
"permissions": {
1212
"owner": "<owner_address>"

0 commit comments

Comments
 (0)