Skip to content

Commit 42bcd72

Browse files
authored
Pull changes from tesnet (#1825)
Co-authored-by: Mauro Toscano <[email protected]> Co-authored-by: MauroFab <[email protected]>
2 parents 22ee224 + d9fd29d commit 42bcd72

File tree

8 files changed

+182
-33
lines changed

8 files changed

+182
-33
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"chainInfo": {
3+
"chainId": 1
4+
},
5+
"permissions" : {
6+
"aggregator": "0xb72D98AB27EBCF86C96a53564135d3141bAAE398",
7+
"deployer": "0xb72D98AB27EBCF86C96a53564135d3141bAAE398",
8+
"owner": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
9+
"upgrader": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
10+
"churner": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
11+
"ejector": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
12+
"pauser": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
13+
"initalPausedStatus": 0
14+
},
15+
"minimumStakes": [
16+
1
17+
],
18+
"strategyWeights": [
19+
[
20+
{
21+
"0_strategy": "0xbeaC0eeEeeeeEEeEeEEEEeeEEeEeeeEeeEEBEaC0",
22+
"1_multiplier": 1000000000000000000
23+
},
24+
{
25+
"0_strategy": "0x93c4b944D05dfe6df7645A86cd2206016c51564D",
26+
"1_multiplier": 1030077629425962827
27+
},
28+
{
29+
"0_strategy": "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2",
30+
"1_multiplier": 1102456657360376283
31+
},
32+
{
33+
"0_strategy": "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc",
34+
"1_multiplier": 1067949170243902475
35+
},
36+
{
37+
"0_strategy": "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d",
38+
"1_multiplier": 1026158078493781538
39+
},
40+
{
41+
"0_strategy": "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff",
42+
"1_multiplier": 1152393415227598758
43+
},
44+
{
45+
"0_strategy": "0xa4C637e0F704745D182e4D38cAb7E7485321d059",
46+
"1_multiplier": 1011855761455017859
47+
},
48+
{
49+
"0_strategy": "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02",
50+
"1_multiplier": 1012495275290785447
51+
},
52+
{
53+
"0_strategy": "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6",
54+
"1_multiplier": 1055446649335815388
55+
},
56+
{
57+
"0_strategy": "0x7CA911E83dabf90C90dD3De5411a10F1A6112184",
58+
"1_multiplier": 1035345726488000000
59+
},
60+
{
61+
"0_strategy": "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6",
62+
"1_multiplier": 1081259809521793439
63+
},
64+
{
65+
"0_strategy": "0xAe60d8180437b5C34bB956822ac2710972584473",
66+
"1_multiplier": 1044315639811926396
67+
},
68+
{
69+
"0_strategy": "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2",
70+
"1_multiplier": 1028802524926876401
71+
}
72+
]
73+
],
74+
"operatorSetParams": [
75+
{
76+
"0_maxOperatorCount": 200,
77+
"1_kickBIPsOfOperatorStake": 11000,
78+
"2_kickBIPsOfTotalStake": 50
79+
}
80+
],
81+
"uri": ""
82+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"address": {
3+
"batcherWallet": "0xCA81D63e24C5C4E6C4fdB2859420e77c8aB565C2",
4+
"alignedLayerServiceManager": "0x96b6a29D7B98519Ae66E6398BD27A76B30a5dC3f"
5+
},
6+
"amounts": {
7+
"gasForAggregator": "300000",
8+
"gasPerProof": "21000"
9+
},
10+
"permissions": {
11+
"owner": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599"
12+
},
13+
"eip712": {
14+
"noncedVerificationDataTypeHash": "0x41817b5c5b0c3dcda70ccb43ba175fdcd7e586f9e0484422a2c6bba678fdf4a3"
15+
}
16+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"addresses": {
3+
"alignedLayerProxyAdmin": "0x0D16a82be664c337c615499f8775Ef0431703daC",
4+
"alignedLayerServiceManager": "0x96b6a29D7B98519Ae66E6398BD27A76B30a5dC3f",
5+
"alignedLayerServiceManagerImplementation": "0x97D1f6e8AC6ed284a8b4c846A71Ad6e16E84061E",
6+
"blsApkRegistry": "0x1c81a981bC1605f050C4D400415c7B68f3007053",
7+
"blsApkRegistryImplementation": "0xd49879DD898dB153a9580627ED423832827730c2",
8+
"indexRegistry": "0x4f71C1ab239C967Cb8F8F7f3A3ce6547c753b70B",
9+
"indexRegistryImplementation": "0xd899b7280Cf05b3a802Fc5Cf3ABA55824a0be962",
10+
"operatorStateRetriever": "0xf12De3271f2681Db6d5201F6CFe64d38A668ff34",
11+
"pauserRegistry": "0x9A97Fa7c8b4F076b714F691E87816787aAaDa41D",
12+
"registryCoordinator": "0x7bAF5135241D7D1F870AC6Dd6956BDB1FF55fc3D",
13+
"registryCoordinatorImplementation": "0xB4eECf481fbe258eF0BE6c64C334Fd73896BEc7B",
14+
"serviceManagerRouter": "0xDd7b2239aCb6FB660FE20136a4D2e8A04E15FE6A",
15+
"stakeRegistry": "0x4d52a2289f9f1b126E96937193558fFD2F294DcC",
16+
"stakeRegistryImplementation": "0x398Fe850c9c0B10CCAEe273Af68a526AB99278D2",
17+
"batcherPaymentService": "0x88ad27EfBeF16b6fC5b2E40c5155d61876f847c5",
18+
"batcherPaymentServiceImplementation": "0xC7834f3ca05cf00bbE39B8751eAE4C8C8c2374CD"
19+
},
20+
"chainInfo": {
21+
"chainId": 1,
22+
"deploymentBlock": 22124788
23+
},
24+
"permissions": {
25+
"alignedLayerAggregator": "0xb72D98AB27EBCF86C96a53564135d3141bAAE398",
26+
"alignedLayerChurner": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
27+
"alignedLayerEjector": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
28+
"alignedLayerOwner": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
29+
"alignedLayerPauser": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599",
30+
"alignedLayerUpgrader": "0x2106AC6FE9599f8A0710643C75661aaf8d8B1599"
31+
}
32+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
RPC_URL=https://ethereum-rpc.publicnode.com
2+
PRIVATE_KEY=<YOUR_PRIVATE_KEY>
3+
EXISTING_DEPLOYMENT_INFO_PATH=./script/output/mainnet/eigenlayer_deployment_output.json
4+
DEPLOY_CONFIG_PATH=./script/deploy/config/mainnet_staging/aligned.mainnet.config.json
5+
BATCHER_PAYMENT_SERVICE_CONFIG_PATH=./script/deploy/config/mainnet_staging/batcher-payment-service.mainnet.config.json
6+
OUTPUT_PATH=./script/output/mainnet_staging/alignedlayer_deployment_output.json
7+
ETHERSCAN_API_KEY=<YOUR_ETHERSCAN_API_KEY>
8+
MULTISIG=false

examples/verify/README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,31 @@ This will output the address of the deployed contract. You will need this addres
3838
First encode the ethereum call to the contract using the following command:
3939

4040
```bash
41-
python3 encode_verification_data.py --aligned-verification-data [PATH_TO_ALIGNED_VERIFICATION_DATA]
41+
python3 encode_verification_data.py --aligned-verification-data [PATH_TO_ALIGNED_VERIFICATION_DATA] --sender-address [SENDER_ADDRESS]
4242
```
4343

4444
Replace `[PATH_TO_ALIGNED_VERIFICATION_DATA]` with the path to the json file containing the verification data.
4545
This is the output when submitting a proof from the aligned cli.
4646

47+
Replace `[SENDER_ADDRESS]` with the address of the `BatcherPaymentService` contract.
48+
4749
This will output the encoded call. You can then use this encoded call to check your submitted proof with the associated data is verified in Ethereum by running the following command:
4850

4951
```bash
50-
curl -H "Content-Type: application/json" \
51-
--data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to": "<CONTRACT_ADDRESS>", "data": "<CALL_DATA>"}]}' \
52-
-X POST <RPC_URL>
52+
curl -X POST http://localhost:8545 \
53+
-H "Content-Type: application/json" \
54+
-d '{
55+
"jsonrpc": "2.0",
56+
"method": "eth_call",
57+
"params": [{
58+
"to": "<CONTRACT_ADDRESS>",
59+
"data": "<CALLDATA>"
60+
}],
61+
"id": 1
62+
}'
5363
```
5464

55-
Replace `<CONTRACT_ADDRESS>` with the address of the contract you deployed earlier (or `0x58F280BeBE9B34c9939C3C39e0890C81f163B623` for Aligned ServiceManager in Holesky), `<CALL_DATA>` with the encoded call,
65+
Replace `<CONTRACT_ADDRESS>` with the address of the contract you deployed earlier (or `0x58F280BeBE9B34c9939C3C39e0890C81f163B623` for Aligned ServiceManager in Holesky), `<CALLDATA>` with the encoded call,
5666
and `<RPC_URL>` with the RPC URL of the blockchain you are using.
5767

5868
The output data should be something like this:
@@ -61,7 +71,7 @@ The output data should be something like this:
6171
{
6272
"jsonrpc":"2.0",
6373
"result":"0x0000000000000000000000000000000000000000000000000000000000000001",
64-
"id":null
74+
"id":q
6575
}
6676
```
6777

@@ -78,13 +88,17 @@ Note that if result ends in 1 it means that your submitted proof with the associ
7888

7989
Then, you can run the script by running the following command:
8090
```bash
81-
python3 verify.py --contract-address [CONTRACT_ADDRESS] --aligned-verification-data [PATH_TO_ALIGNED_VERIFICATION_DATA]
91+
python3 verify.py --contract-address [CONTRACT_ADDRESS] --aligned-verification-data [PATH_TO_ALIGNED_VERIFICATION_DATA] --sender-address [SENDER_ADDRESS]
8292
```
8393

84-
Replace `[CONTRACT_ADDRESS]`, and `[PATH_TO_ALIGNED_VERIFICATION_DATA]` with your actual values.
94+
Replace `[CONTRACT_ADDRESS]`, `[PATH_TO_ALIGNED_VERIFICATION_DATA]` and `[SENDER_ADDRESS]` with your actual values.
8595

8696
#### Example Command
8797

8898
```bash
89-
python3 verify.py --contract-address 0x623926229DD27c45AE40B4e16ba4CD6522fC4d22 --aligned-verification-data ../../aligned_verification_data/7553cb14bff387c06e016cb3e7946e91d9fe44a54ad5d888ce8343ddb16116a7_118.json
99+
python3 verify.py --contract-address 0x58F280BeBE9B34c9939C3C39e0890C81f163B623 --aligned-verification-data ../../aligned_verification_data/b8c17406_4.json --sender-address 0x815aeCA64a974297942D2Bbf034ABEe22a38A003
90100
```
101+
102+
In this case, `--contract-address` is the address of the `AlignedLayerServiceManager` and `--sender-address` is the address of the `BatcherPaymentService` in Holesky Testnet.
103+
104+
You need to replace the `--aligned-verification-data` with the path to the JSON file containing the verification data. This is the output when submitting a proof.

examples/verify/encode_verification_data.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,34 @@
44
from Crypto.Hash import keccak
55

66

7-
def encode_call(file):
7+
def encode_call(file, sender_address):
88
with open(file) as f:
99
data = load(f)
1010

11-
verification_data_commitment = data['verification_data_commitment']
12-
proof_commitment = bytearray(verification_data_commitment['proof_commitment'])
13-
pub_input_commitment = bytearray(verification_data_commitment['pub_input_commitment'])
14-
proving_system_aux_data_commitment = bytearray(
15-
verification_data_commitment['proving_system_aux_data_commitment'])
16-
proof_generator_addr = bytearray(verification_data_commitment['proof_generator_addr'])
17-
batch_merkle_root = bytearray(data['batch_merkle_root'])
11+
proof_commitment = bytearray.fromhex(data['proof_commitment'])
12+
pub_input_commitment = bytearray.fromhex(data['pub_input_commitment'])
13+
proving_system_aux_data_commitment = bytearray.fromhex(data['program_id_commitment'])
14+
proof_generator_addr = bytearray.fromhex(data['proof_generator_addr'])
15+
batch_merkle_root = bytearray.fromhex(data['batch_merkle_root'])
16+
merkle_proof = bytearray.fromhex(data['merkle_proof'])
17+
verification_data_batch_index = data['verification_data_batch_index']
1818

19-
merkle_path_arr = data['batch_inclusion_proof']['merkle_path']
20-
merkle_proof = bytearray()
21-
for i in range(0, len(merkle_path_arr)):
22-
merkle_proof += bytearray(merkle_path_arr[i])
23-
24-
index = data['index_in_batch']
25-
26-
output = encode(['bytes32', 'bytes32', 'bytes32', 'bytes20', 'bytes32', 'bytes', 'uint256'],
19+
output = encode(['bytes32', 'bytes32', 'bytes32', 'bytes20', 'bytes32', 'bytes', 'uint256', 'address'],
2720
[proof_commitment, pub_input_commitment, proving_system_aux_data_commitment,
28-
proof_generator_addr, batch_merkle_root, merkle_proof, index])
21+
proof_generator_addr, batch_merkle_root, merkle_proof, verification_data_batch_index,
22+
sender_address])
2923

3024
k = keccak.new(digest_bits=256)
31-
k.update(b'verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256)')
25+
k.update(b'verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256,address)')
3226
signature = k.hexdigest()[:8]
33-
3427
return '0x' + signature + output.hex()
3528

3629

3730
if __name__ == "__main__":
3831
parser = ArgumentParser()
3932
parser.add_argument('--aligned-verification-data', help='Path to JSON file with the verification data')
33+
parser.add_argument('--sender-address', help='Address that sent the batch to Aligned')
4034
args = parser.parse_args()
4135

42-
data = encode_call(args.aligned_verification_data)
36+
data = encode_call(args.aligned_verification_data, args.sender_address)
4337
print(data)

examples/verify/src/VerifyBatchInclusionCaller.sol

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ contract VerifyBatchInclusionCaller {
1515
bytes20 proofGeneratorAddr,
1616
bytes32 batchMerkleRoot,
1717
bytes memory merkleProof,
18-
uint256 verificationDataBatchIndex
18+
uint256 verificationDataBatchIndex,
19+
address senderAddress
1920
) external view returns (bool) {
2021
(bool callWasSuccessfull, bytes memory proofIsIncluded) = targetContract.staticcall(
2122
abi.encodeWithSignature(
22-
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256)",
23+
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256,address)",
2324
proofCommitment,
2425
pubInputCommitment,
2526
provingSystemAuxDataCommitment,
2627
proofGeneratorAddr,
2728
batchMerkleRoot,
2829
merkleProof,
29-
verificationDataBatchIndex
30+
verificationDataBatchIndex,
31+
senderAddress
3032
)
3133
);
3234

examples/verify/verify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ def main():
1010
parser.add_argument('--aligned-verification-data', help='Path to JSON file with the verification data',
1111
required=True)
1212
parser.add_argument('--contract-address', help='Verifier Contract address', required=True)
13+
parser.add_argument('--sender-address', help='Address that sent the batch to Aligned')
1314

1415
args = parser.parse_args()
1516

1617
provider = Web3(Web3.HTTPProvider(args.rpc_url))
1718

18-
data = encode_call(args.aligned_verification_data)
19+
data = encode_call(args.aligned_verification_data, args.sender_address)
1920

2021
result = provider.eth.call({
2122
'to': args.contract_address,

0 commit comments

Comments
 (0)