@aztec/archiver 0.0.1-commit.9b94fc1 → 0.0.1-commit.c7c42ec
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/archiver/archiver.d.ts +96 -79
- package/dest/archiver/archiver.d.ts.map +1 -1
- package/dest/archiver/archiver.js +451 -214
- package/dest/archiver/archiver_store.d.ts +100 -47
- package/dest/archiver/archiver_store.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts +1 -1
- package/dest/archiver/archiver_store_test_suite.d.ts.map +1 -1
- package/dest/archiver/archiver_store_test_suite.js +1867 -386
- package/dest/archiver/config.d.ts +5 -4
- package/dest/archiver/config.d.ts.map +1 -1
- package/dest/archiver/config.js +10 -3
- package/dest/archiver/errors.d.ts +25 -1
- package/dest/archiver/errors.d.ts.map +1 -1
- package/dest/archiver/errors.js +37 -0
- package/dest/archiver/index.d.ts +2 -2
- package/dest/archiver/index.d.ts.map +1 -1
- package/dest/archiver/instrumentation.d.ts +3 -1
- package/dest/archiver/instrumentation.d.ts.map +1 -1
- package/dest/archiver/instrumentation.js +11 -0
- package/dest/archiver/kv_archiver_store/block_store.d.ts +51 -18
- package/dest/archiver/kv_archiver_store/block_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/block_store.js +324 -87
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts +2 -2
- package/dest/archiver/kv_archiver_store/contract_class_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/contract_class_store.js +1 -1
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts +2 -2
- package/dest/archiver/kv_archiver_store/contract_instance_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts +46 -56
- package/dest/archiver/kv_archiver_store/kv_archiver_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/kv_archiver_store.js +65 -48
- package/dest/archiver/kv_archiver_store/log_store.d.ts +12 -16
- package/dest/archiver/kv_archiver_store/log_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/log_store.js +149 -84
- package/dest/archiver/kv_archiver_store/message_store.d.ts +6 -5
- package/dest/archiver/kv_archiver_store/message_store.d.ts.map +1 -1
- package/dest/archiver/kv_archiver_store/message_store.js +15 -14
- package/dest/archiver/l1/bin/retrieve-calldata.d.ts +3 -0
- package/dest/archiver/l1/bin/retrieve-calldata.d.ts.map +1 -0
- package/dest/archiver/l1/bin/retrieve-calldata.js +149 -0
- package/dest/archiver/l1/calldata_retriever.d.ts +112 -0
- package/dest/archiver/l1/calldata_retriever.d.ts.map +1 -0
- package/dest/archiver/l1/calldata_retriever.js +471 -0
- package/dest/archiver/l1/data_retrieval.d.ts +90 -0
- package/dest/archiver/l1/data_retrieval.d.ts.map +1 -0
- package/dest/archiver/{data_retrieval.js → l1/data_retrieval.js} +52 -107
- package/dest/archiver/l1/debug_tx.d.ts +19 -0
- package/dest/archiver/l1/debug_tx.d.ts.map +1 -0
- package/dest/archiver/l1/debug_tx.js +73 -0
- package/dest/archiver/l1/spire_proposer.d.ts +70 -0
- package/dest/archiver/l1/spire_proposer.d.ts.map +1 -0
- package/dest/archiver/l1/spire_proposer.js +157 -0
- package/dest/archiver/l1/trace_tx.d.ts +97 -0
- package/dest/archiver/l1/trace_tx.d.ts.map +1 -0
- package/dest/archiver/l1/trace_tx.js +91 -0
- package/dest/archiver/l1/types.d.ts +12 -0
- package/dest/archiver/l1/types.d.ts.map +1 -0
- package/dest/archiver/l1/types.js +3 -0
- package/dest/archiver/l1/validate_trace.d.ts +29 -0
- package/dest/archiver/l1/validate_trace.d.ts.map +1 -0
- package/dest/archiver/l1/validate_trace.js +150 -0
- package/dest/archiver/structs/inbox_message.d.ts +4 -4
- package/dest/archiver/structs/inbox_message.d.ts.map +1 -1
- package/dest/archiver/structs/inbox_message.js +6 -5
- package/dest/archiver/structs/published.d.ts +1 -2
- package/dest/archiver/structs/published.d.ts.map +1 -1
- package/dest/factory.d.ts +2 -2
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +4 -3
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/test/mock_archiver.d.ts +16 -8
- package/dest/test/mock_archiver.d.ts.map +1 -1
- package/dest/test/mock_archiver.js +19 -14
- package/dest/test/mock_l1_to_l2_message_source.d.ts +7 -6
- package/dest/test/mock_l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/test/mock_l1_to_l2_message_source.js +10 -9
- package/dest/test/mock_l2_block_source.d.ts +18 -7
- package/dest/test/mock_l2_block_source.d.ts.map +1 -1
- package/dest/test/mock_l2_block_source.js +37 -23
- package/dest/test/mock_structs.d.ts +3 -2
- package/dest/test/mock_structs.d.ts.map +1 -1
- package/dest/test/mock_structs.js +9 -8
- package/package.json +17 -16
- package/src/archiver/archiver.ts +595 -296
- package/src/archiver/archiver_store.ts +113 -46
- package/src/archiver/archiver_store_test_suite.ts +1932 -353
- package/src/archiver/config.ts +15 -10
- package/src/archiver/errors.ts +64 -0
- package/src/archiver/index.ts +1 -1
- package/src/archiver/instrumentation.ts +14 -0
- package/src/archiver/kv_archiver_store/block_store.ts +442 -101
- package/src/archiver/kv_archiver_store/contract_class_store.ts +1 -1
- package/src/archiver/kv_archiver_store/contract_instance_store.ts +1 -1
- package/src/archiver/kv_archiver_store/kv_archiver_store.ts +87 -71
- package/src/archiver/kv_archiver_store/log_store.ts +209 -99
- package/src/archiver/kv_archiver_store/message_store.ts +21 -18
- package/src/archiver/l1/README.md +98 -0
- package/src/archiver/l1/bin/retrieve-calldata.ts +182 -0
- package/src/archiver/l1/calldata_retriever.ts +641 -0
- package/src/archiver/{data_retrieval.ts → l1/data_retrieval.ts} +101 -165
- package/src/archiver/l1/debug_tx.ts +99 -0
- package/src/archiver/l1/spire_proposer.ts +160 -0
- package/src/archiver/l1/trace_tx.ts +128 -0
- package/src/archiver/l1/types.ts +13 -0
- package/src/archiver/l1/validate_trace.ts +211 -0
- package/src/archiver/structs/inbox_message.ts +8 -8
- package/src/archiver/structs/published.ts +0 -1
- package/src/factory.ts +4 -3
- package/src/index.ts +1 -1
- package/src/test/fixtures/debug_traceTransaction-multicall3.json +88 -0
- package/src/test/fixtures/debug_traceTransaction-multiplePropose.json +153 -0
- package/src/test/fixtures/debug_traceTransaction-proxied.json +122 -0
- package/src/test/fixtures/trace_transaction-multicall3.json +65 -0
- package/src/test/fixtures/trace_transaction-multiplePropose.json +319 -0
- package/src/test/fixtures/trace_transaction-proxied.json +128 -0
- package/src/test/fixtures/trace_transaction-randomRevert.json +216 -0
- package/src/test/mock_archiver.ts +22 -16
- package/src/test/mock_l1_to_l2_message_source.ts +10 -9
- package/src/test/mock_l2_block_source.ts +45 -25
- package/src/test/mock_structs.ts +10 -9
- package/dest/archiver/data_retrieval.d.ts +0 -79
- package/dest/archiver/data_retrieval.d.ts.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"action": {
|
|
4
|
+
"from": "0x28c6c06298d514db089934071355e5743bf21d60",
|
|
5
|
+
"callType": "call",
|
|
6
|
+
"gas": "0x5f1fc",
|
|
7
|
+
"input": "0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000a587116d5cf08e53bd75f3a0a434bf06671098590000000000000000000000000000000000000000000000000000000029a6d78000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f863dfdb5df33fe5f87601b8d2f23c816d5fde8000000000000000000000000000000000000000000000000000000000b7ff86f00000000000000000000000000000000000000000000000000000000",
|
|
8
|
+
"to": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
9
|
+
"value": "0x0"
|
|
10
|
+
},
|
|
11
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
12
|
+
"blockNumber": 23934803,
|
|
13
|
+
"result": {
|
|
14
|
+
"gasUsed": "0x15b9b",
|
|
15
|
+
"output": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001"
|
|
16
|
+
},
|
|
17
|
+
"subtraces": 1,
|
|
18
|
+
"traceAddress": [],
|
|
19
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
20
|
+
"transactionPosition": 333,
|
|
21
|
+
"type": "call"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"action": {
|
|
25
|
+
"from": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
26
|
+
"callType": "delegatecall",
|
|
27
|
+
"gas": "0x5c75c",
|
|
28
|
+
"input": "0x34fcd5be0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000120000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000a587116d5cf08e53bd75f3a0a434bf06671098590000000000000000000000000000000000000000000000000000000029a6d78000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f863dfdb5df33fe5f87601b8d2f23c816d5fde8000000000000000000000000000000000000000000000000000000000b7ff86f00000000000000000000000000000000000000000000000000000000",
|
|
29
|
+
"to": "0xd206ac7fef53d83ed4563e770b28dba90d0d9ec8",
|
|
30
|
+
"value": "0x0"
|
|
31
|
+
},
|
|
32
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
33
|
+
"blockNumber": 23934803,
|
|
34
|
+
"result": {
|
|
35
|
+
"gasUsed": "0x1483e",
|
|
36
|
+
"output": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001"
|
|
37
|
+
},
|
|
38
|
+
"subtraces": 4,
|
|
39
|
+
"traceAddress": [0],
|
|
40
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
41
|
+
"transactionPosition": 333,
|
|
42
|
+
"type": "call"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"action": {
|
|
46
|
+
"from": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
47
|
+
"callType": "staticcall",
|
|
48
|
+
"gas": "0x7530",
|
|
49
|
+
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
|
|
50
|
+
"to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
51
|
+
"value": "0x0"
|
|
52
|
+
},
|
|
53
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
54
|
+
"blockNumber": 23934803,
|
|
55
|
+
"error": "Reverted",
|
|
56
|
+
"result": {
|
|
57
|
+
"gasUsed": "0x1d64",
|
|
58
|
+
"output": "0x"
|
|
59
|
+
},
|
|
60
|
+
"subtraces": 1,
|
|
61
|
+
"traceAddress": [0, 0],
|
|
62
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
63
|
+
"transactionPosition": 333,
|
|
64
|
+
"type": "call"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"action": {
|
|
68
|
+
"from": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
69
|
+
"callType": "delegatecall",
|
|
70
|
+
"gas": "0x5783",
|
|
71
|
+
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
|
|
72
|
+
"to": "0x43506849d7c04f9138d1a2050bbf3a0c054402dd",
|
|
73
|
+
"value": "0x0"
|
|
74
|
+
},
|
|
75
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
76
|
+
"blockNumber": 23934803,
|
|
77
|
+
"error": "Reverted",
|
|
78
|
+
"result": {
|
|
79
|
+
"gasUsed": "0xf0",
|
|
80
|
+
"output": "0x"
|
|
81
|
+
},
|
|
82
|
+
"subtraces": 0,
|
|
83
|
+
"traceAddress": [0, 0, 0],
|
|
84
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
85
|
+
"transactionPosition": 333,
|
|
86
|
+
"type": "call"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"action": {
|
|
90
|
+
"from": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
91
|
+
"callType": "call",
|
|
92
|
+
"gas": "0x541ba",
|
|
93
|
+
"input": "0xa9059cbb000000000000000000000000a587116d5cf08e53bd75f3a0a434bf06671098590000000000000000000000000000000000000000000000000000000029a6d780",
|
|
94
|
+
"to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
95
|
+
"value": "0x0"
|
|
96
|
+
},
|
|
97
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
98
|
+
"blockNumber": 23934803,
|
|
99
|
+
"result": {
|
|
100
|
+
"gasUsed": "0x9ecc",
|
|
101
|
+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
102
|
+
},
|
|
103
|
+
"subtraces": 1,
|
|
104
|
+
"traceAddress": [0, 1],
|
|
105
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
106
|
+
"transactionPosition": 333,
|
|
107
|
+
"type": "call"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"action": {
|
|
111
|
+
"from": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
112
|
+
"callType": "delegatecall",
|
|
113
|
+
"gas": "0x510d8",
|
|
114
|
+
"input": "0xa9059cbb000000000000000000000000a587116d5cf08e53bd75f3a0a434bf06671098590000000000000000000000000000000000000000000000000000000029a6d780",
|
|
115
|
+
"to": "0x43506849d7c04f9138d1a2050bbf3a0c054402dd",
|
|
116
|
+
"value": "0x0"
|
|
117
|
+
},
|
|
118
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
119
|
+
"blockNumber": 23934803,
|
|
120
|
+
"result": {
|
|
121
|
+
"gasUsed": "0x8253",
|
|
122
|
+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
123
|
+
},
|
|
124
|
+
"subtraces": 0,
|
|
125
|
+
"traceAddress": [0, 1, 0],
|
|
126
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
127
|
+
"transactionPosition": 333,
|
|
128
|
+
"type": "call"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"action": {
|
|
132
|
+
"from": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
133
|
+
"callType": "staticcall",
|
|
134
|
+
"gas": "0x7530",
|
|
135
|
+
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
|
|
136
|
+
"to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
137
|
+
"value": "0x0"
|
|
138
|
+
},
|
|
139
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
140
|
+
"blockNumber": 23934803,
|
|
141
|
+
"error": "Reverted",
|
|
142
|
+
"result": {
|
|
143
|
+
"gasUsed": "0x400",
|
|
144
|
+
"output": "0x"
|
|
145
|
+
},
|
|
146
|
+
"subtraces": 1,
|
|
147
|
+
"traceAddress": [0, 2],
|
|
148
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
149
|
+
"transactionPosition": 333,
|
|
150
|
+
"type": "call"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"action": {
|
|
154
|
+
"from": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
155
|
+
"callType": "delegatecall",
|
|
156
|
+
"gas": "0x7081",
|
|
157
|
+
"input": "0x01ffc9a701ffc9a700000000000000000000000000000000000000000000000000000000",
|
|
158
|
+
"to": "0x43506849d7c04f9138d1a2050bbf3a0c054402dd",
|
|
159
|
+
"value": "0x0"
|
|
160
|
+
},
|
|
161
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
162
|
+
"blockNumber": 23934803,
|
|
163
|
+
"error": "Reverted",
|
|
164
|
+
"result": {
|
|
165
|
+
"gasUsed": "0xf0",
|
|
166
|
+
"output": "0x"
|
|
167
|
+
},
|
|
168
|
+
"subtraces": 0,
|
|
169
|
+
"traceAddress": [0, 2, 0],
|
|
170
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
171
|
+
"transactionPosition": 333,
|
|
172
|
+
"type": "call"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"action": {
|
|
176
|
+
"from": "0xee7ae85f2fe2239e27d9c1e23fffe168d63b4055",
|
|
177
|
+
"callType": "call",
|
|
178
|
+
"gas": "0x4997e",
|
|
179
|
+
"input": "0xa9059cbb0000000000000000000000009f863dfdb5df33fe5f87601b8d2f23c816d5fde8000000000000000000000000000000000000000000000000000000000b7ff86f",
|
|
180
|
+
"to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
181
|
+
"value": "0x0"
|
|
182
|
+
},
|
|
183
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
184
|
+
"blockNumber": 23934803,
|
|
185
|
+
"result": {
|
|
186
|
+
"gasUsed": "0x280c",
|
|
187
|
+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
188
|
+
},
|
|
189
|
+
"subtraces": 1,
|
|
190
|
+
"traceAddress": [0, 3],
|
|
191
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
192
|
+
"transactionPosition": 333,
|
|
193
|
+
"type": "call"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"action": {
|
|
197
|
+
"from": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
198
|
+
"callType": "delegatecall",
|
|
199
|
+
"gas": "0x4843b",
|
|
200
|
+
"input": "0xa9059cbb0000000000000000000000009f863dfdb5df33fe5f87601b8d2f23c816d5fde8000000000000000000000000000000000000000000000000000000000b7ff86f",
|
|
201
|
+
"to": "0x43506849d7c04f9138d1a2050bbf3a0c054402dd",
|
|
202
|
+
"value": "0x0"
|
|
203
|
+
},
|
|
204
|
+
"blockHash": "0x5c463f21273435fbe71ab85a203ce4566e8f0d83deafcc757913ac2b5839367d",
|
|
205
|
+
"blockNumber": 23934803,
|
|
206
|
+
"result": {
|
|
207
|
+
"gasUsed": "0x24f7",
|
|
208
|
+
"output": "0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
209
|
+
},
|
|
210
|
+
"subtraces": 0,
|
|
211
|
+
"traceAddress": [0, 3, 0],
|
|
212
|
+
"transactionHash": "0x622c1ca0d4c20a4d58f4111bf24cafa633318ededb24819ee3d977a73b1a1ff9",
|
|
213
|
+
"transactionPosition": 333,
|
|
214
|
+
"type": "call"
|
|
215
|
+
}
|
|
216
|
+
]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { L2Block, type L2BlockSource } from '@aztec/stdlib/block';
|
|
4
|
+
import type { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
3
5
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
4
6
|
|
|
5
7
|
import { MockL1ToL2MessageSource } from './mock_l1_to_l2_message_source.js';
|
|
@@ -11,12 +13,12 @@ import { MockL2BlockSource } from './mock_l2_block_source.js';
|
|
|
11
13
|
export class MockArchiver extends MockL2BlockSource implements L2BlockSource, L1ToL2MessageSource {
|
|
12
14
|
private messageSource = new MockL1ToL2MessageSource(0);
|
|
13
15
|
|
|
14
|
-
public setL1ToL2Messages(
|
|
15
|
-
this.messageSource.setL1ToL2Messages(
|
|
16
|
+
public setL1ToL2Messages(checkpointNumber: CheckpointNumber, msgs: Fr[]) {
|
|
17
|
+
this.messageSource.setL1ToL2Messages(checkpointNumber, msgs);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
getL1ToL2Messages(
|
|
19
|
-
return this.messageSource.getL1ToL2Messages(
|
|
20
|
+
getL1ToL2Messages(checkpointNumber: CheckpointNumber): Promise<Fr[]> {
|
|
21
|
+
return this.messageSource.getL1ToL2Messages(checkpointNumber);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
getL1ToL2MessageIndex(_l1ToL2Message: Fr): Promise<bigint | undefined> {
|
|
@@ -28,30 +30,34 @@ export class MockArchiver extends MockL2BlockSource implements L2BlockSource, L1
|
|
|
28
30
|
* A mocked implementation of the archiver with a set of precomputed blocks and messages.
|
|
29
31
|
*/
|
|
30
32
|
export class MockPrefilledArchiver extends MockArchiver {
|
|
31
|
-
private
|
|
33
|
+
private prefilled: Checkpoint[] = [];
|
|
32
34
|
|
|
33
|
-
constructor(
|
|
35
|
+
constructor(prefilled: { checkpoint: Checkpoint; messages: Fr[] }[]) {
|
|
34
36
|
super();
|
|
35
|
-
this.
|
|
36
|
-
messages.forEach((msgs, i) => this.setL1ToL2Messages(i + 1, msgs));
|
|
37
|
+
this.setPrefilled(prefilled);
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
public
|
|
40
|
-
for (const
|
|
41
|
-
this.
|
|
40
|
+
public setPrefilled(prefilled: { checkpoint: Checkpoint; messages: Fr[] }[]) {
|
|
41
|
+
for (const { checkpoint, messages } of prefilled) {
|
|
42
|
+
this.prefilled[checkpoint.number - 1] = checkpoint;
|
|
43
|
+
if (checkpoint.blocks.length !== 1) {
|
|
44
|
+
throw new Error('Prefilled checkpoint must only have 1 block at the moment.');
|
|
45
|
+
}
|
|
46
|
+
this.setL1ToL2Messages(checkpoint.number, messages);
|
|
42
47
|
}
|
|
43
|
-
messages.forEach((msgs, i) => this.setL1ToL2Messages(blocks[i].number, msgs));
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
public override createBlocks(numBlocks: number) {
|
|
47
|
-
|
|
51
|
+
const flattenedBlocks = this.prefilled.flatMap(c => c.blocks);
|
|
52
|
+
if (this.l2Blocks.length + numBlocks > flattenedBlocks.length) {
|
|
48
53
|
throw new Error(
|
|
49
54
|
`Not enough precomputed blocks to create ${numBlocks} more blocks (already at ${this.l2Blocks.length})`,
|
|
50
55
|
);
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
const fromBlock = this.l2Blocks.length;
|
|
54
|
-
|
|
59
|
+
// TODO: Add L2 blocks and checkpoints separately once archiver has the apis for that.
|
|
60
|
+
this.addBlocks(this.prefilled.slice(fromBlock, fromBlock + numBlocks).map(c => L2Block.fromCheckpoint(c)));
|
|
55
61
|
return Promise.resolve();
|
|
56
62
|
}
|
|
57
63
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNumber, type CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
3
|
import type { L2Tips } from '@aztec/stdlib/block';
|
|
3
4
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
4
5
|
|
|
@@ -6,33 +7,33 @@ import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
|
6
7
|
* A mocked implementation of L1ToL2MessageSource to be used in tests.
|
|
7
8
|
*/
|
|
8
9
|
export class MockL1ToL2MessageSource implements L1ToL2MessageSource {
|
|
9
|
-
private
|
|
10
|
+
private messagesPerCheckpoint = new Map<CheckpointNumber, Fr[]>();
|
|
10
11
|
|
|
11
12
|
constructor(private blockNumber: number) {}
|
|
12
13
|
|
|
13
|
-
public setL1ToL2Messages(
|
|
14
|
-
this.
|
|
14
|
+
public setL1ToL2Messages(checkpointNumber: CheckpointNumber, msgs: Fr[]) {
|
|
15
|
+
this.messagesPerCheckpoint.set(checkpointNumber, msgs);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
public setBlockNumber(blockNumber: number) {
|
|
18
19
|
this.blockNumber = blockNumber;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
getL1ToL2Messages(
|
|
22
|
-
return Promise.resolve(this.
|
|
22
|
+
getL1ToL2Messages(checkpointNumber: CheckpointNumber): Promise<Fr[]> {
|
|
23
|
+
return Promise.resolve(this.messagesPerCheckpoint.get(checkpointNumber) ?? []);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
getL1ToL2MessageIndex(_l1ToL2Message: Fr): Promise<bigint | undefined> {
|
|
26
27
|
throw new Error('Method not implemented.');
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
getBlockNumber()
|
|
30
|
-
return Promise.resolve(this.blockNumber);
|
|
30
|
+
getBlockNumber() {
|
|
31
|
+
return Promise.resolve(BlockNumber(this.blockNumber));
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
getL2Tips(): Promise<L2Tips> {
|
|
34
35
|
const number = this.blockNumber;
|
|
35
|
-
const tip = { number, hash: new Fr(number).toString() };
|
|
36
|
+
const tip = { number: BlockNumber(number), hash: new Fr(number).toString() };
|
|
36
37
|
return Promise.resolve({
|
|
37
38
|
latest: tip,
|
|
38
39
|
proven: tip,
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
2
|
-
import { DefaultL1ContractsConfig } from '@aztec/ethereum';
|
|
3
|
-
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
3
|
+
import { BlockNumber, CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
5
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
7
7
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
8
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
9
9
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
10
|
import {
|
|
11
11
|
L2Block,
|
|
12
12
|
L2BlockHash,
|
|
13
|
+
L2BlockNew,
|
|
13
14
|
type L2BlockSource,
|
|
14
15
|
type L2Tips,
|
|
15
16
|
PublishedL2Block,
|
|
16
17
|
type ValidateBlockResult,
|
|
17
18
|
} from '@aztec/stdlib/block';
|
|
19
|
+
import { type Checkpoint, L1PublishedData } from '@aztec/stdlib/checkpoint';
|
|
18
20
|
import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
19
21
|
import { EmptyL1RollupConstants, type L1RollupConstants, getSlotRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
|
|
20
22
|
import { type BlockHeader, TxHash, TxReceipt, TxStatus } from '@aztec/stdlib/tx';
|
|
@@ -34,7 +36,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
34
36
|
public async createBlocks(numBlocks: number) {
|
|
35
37
|
for (let i = 0; i < numBlocks; i++) {
|
|
36
38
|
const blockNum = this.l2Blocks.length + 1;
|
|
37
|
-
const block = await L2Block.random(blockNum);
|
|
39
|
+
const block = await L2Block.random(BlockNumber(blockNum));
|
|
38
40
|
this.l2Blocks.push(block);
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -83,11 +85,16 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
83
85
|
* @returns In this mock instance, returns the number of L2 blocks that we've mocked.
|
|
84
86
|
*/
|
|
85
87
|
public getBlockNumber() {
|
|
86
|
-
return Promise.resolve(this.l2Blocks.length);
|
|
88
|
+
return Promise.resolve(BlockNumber(this.l2Blocks.length));
|
|
87
89
|
}
|
|
88
90
|
|
|
89
|
-
public getProvenBlockNumber()
|
|
90
|
-
return Promise.resolve(this.provenBlockNumber);
|
|
91
|
+
public getProvenBlockNumber() {
|
|
92
|
+
return Promise.resolve(BlockNumber(this.provenBlockNumber));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public getCheckpointedBlock(_number: BlockNumber) {
|
|
96
|
+
// In this mock, we don't track checkpointed blocks separately
|
|
97
|
+
return Promise.resolve(undefined);
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
/**
|
|
@@ -99,6 +106,16 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
99
106
|
return Promise.resolve(this.l2Blocks[number - 1]);
|
|
100
107
|
}
|
|
101
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Gets an L2 block (new format).
|
|
111
|
+
* @param number - The block number to return.
|
|
112
|
+
* @returns The requested L2 block.
|
|
113
|
+
*/
|
|
114
|
+
public getL2BlockNew(number: BlockNumber): Promise<L2BlockNew | undefined> {
|
|
115
|
+
const block = this.l2Blocks[number - 1];
|
|
116
|
+
return Promise.resolve(block?.toL2Block());
|
|
117
|
+
}
|
|
118
|
+
|
|
102
119
|
/**
|
|
103
120
|
* Gets up to `limit` amount of L2 blocks starting from `from`.
|
|
104
121
|
* @param from - Number of the first block to return (inclusive).
|
|
@@ -113,16 +130,22 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
113
130
|
);
|
|
114
131
|
}
|
|
115
132
|
|
|
133
|
+
public async getPublishedCheckpoints(from: CheckpointNumber, limit: number) {
|
|
134
|
+
// TODO: Implement this properly. This only works when we have one block per checkpoint.
|
|
135
|
+
return (await this.getPublishedBlocks(from, limit)).map(block => block.toPublishedCheckpoint());
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public async getCheckpointByArchive(archive: Fr): Promise<Checkpoint | undefined> {
|
|
139
|
+
// TODO: Implement this properly. This only works when we have one block per checkpoint.
|
|
140
|
+
return (await this.getPublishedBlockByArchive(archive))?.block.toCheckpoint();
|
|
141
|
+
}
|
|
142
|
+
|
|
116
143
|
public async getPublishedBlocks(from: number, limit: number, proven?: boolean) {
|
|
117
144
|
const blocks = await this.getBlocks(from, limit, proven);
|
|
118
145
|
return blocks.map(block =>
|
|
119
146
|
PublishedL2Block.fromFields({
|
|
120
147
|
block,
|
|
121
|
-
l1:
|
|
122
|
-
blockNumber: BigInt(block.number),
|
|
123
|
-
blockHash: Buffer32.random().toString(),
|
|
124
|
-
timestamp: BigInt(block.number),
|
|
125
|
-
},
|
|
148
|
+
l1: new L1PublishedData(BigInt(block.number), BigInt(block.number), Buffer32.random().toString()),
|
|
126
149
|
attestations: [],
|
|
127
150
|
}),
|
|
128
151
|
);
|
|
@@ -134,11 +157,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
134
157
|
if (hash.equals(blockHash)) {
|
|
135
158
|
return PublishedL2Block.fromFields({
|
|
136
159
|
block,
|
|
137
|
-
l1:
|
|
138
|
-
blockNumber: BigInt(block.number),
|
|
139
|
-
blockHash: Buffer32.random().toString(),
|
|
140
|
-
timestamp: BigInt(block.number),
|
|
141
|
-
},
|
|
160
|
+
l1: new L1PublishedData(BigInt(block.number), BigInt(block.number), Buffer32.random().toString()),
|
|
142
161
|
attestations: [],
|
|
143
162
|
});
|
|
144
163
|
}
|
|
@@ -154,11 +173,7 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
154
173
|
return Promise.resolve(
|
|
155
174
|
PublishedL2Block.fromFields({
|
|
156
175
|
block,
|
|
157
|
-
l1:
|
|
158
|
-
blockNumber: BigInt(block.number),
|
|
159
|
-
blockHash: Buffer32.random().toString(),
|
|
160
|
-
timestamp: BigInt(block.number),
|
|
161
|
-
},
|
|
176
|
+
l1: new L1PublishedData(BigInt(block.number), BigInt(block.number), Buffer32.random().toString()),
|
|
162
177
|
attestations: [],
|
|
163
178
|
}),
|
|
164
179
|
);
|
|
@@ -183,6 +198,11 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
183
198
|
return Promise.resolve(this.l2Blocks.at(typeof number === 'number' ? number - 1 : -1)?.getBlockHeader());
|
|
184
199
|
}
|
|
185
200
|
|
|
201
|
+
getCheckpointsForEpoch(epochNumber: EpochNumber): Promise<Checkpoint[]> {
|
|
202
|
+
// TODO: Implement this properly. This only works when we have one block per checkpoint.
|
|
203
|
+
return this.getBlocksForEpoch(epochNumber).then(blocks => blocks.map(b => b.toCheckpoint()));
|
|
204
|
+
}
|
|
205
|
+
|
|
186
206
|
getBlocksForEpoch(epochNumber: EpochNumber): Promise<L2Block[]> {
|
|
187
207
|
const epochDuration = DefaultL1ContractsConfig.aztecEpochDuration;
|
|
188
208
|
const [start, end] = getSlotRangeForEpoch(epochNumber, { epochDuration });
|
|
@@ -255,15 +275,15 @@ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
|
|
|
255
275
|
|
|
256
276
|
return {
|
|
257
277
|
latest: {
|
|
258
|
-
number: latest,
|
|
278
|
+
number: BlockNumber(latest),
|
|
259
279
|
hash: (await latestBlock?.hash())?.toString(),
|
|
260
280
|
},
|
|
261
281
|
proven: {
|
|
262
|
-
number: proven,
|
|
282
|
+
number: BlockNumber(proven),
|
|
263
283
|
hash: (await provenBlock?.hash())?.toString(),
|
|
264
284
|
},
|
|
265
285
|
finalized: {
|
|
266
|
-
number: finalized,
|
|
286
|
+
number: BlockNumber(finalized),
|
|
267
287
|
hash: (await finalizedBlock?.hash())?.toString(),
|
|
268
288
|
},
|
|
269
289
|
};
|
package/src/test/mock_structs.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { Buffer16, Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
-
import { randomBigInt, randomInt } from '@aztec/foundation/crypto';
|
|
3
|
-
import { Fr } from '@aztec/foundation/
|
|
3
|
+
import { randomBigInt, randomInt } from '@aztec/foundation/crypto/random';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
5
|
import { InboxLeaf } from '@aztec/stdlib/messaging';
|
|
5
6
|
|
|
6
7
|
import { type InboxMessage, updateRollingHash } from '../archiver/structs/inbox_message.js';
|
|
@@ -9,17 +10,17 @@ export function makeInboxMessage(
|
|
|
9
10
|
previousRollingHash = Buffer16.ZERO,
|
|
10
11
|
overrides: Partial<InboxMessage> = {},
|
|
11
12
|
): InboxMessage {
|
|
12
|
-
const {
|
|
13
|
+
const { checkpointNumber = CheckpointNumber(randomInt(100) + 1) } = overrides;
|
|
13
14
|
const { l1BlockNumber = randomBigInt(100n) + 1n } = overrides;
|
|
14
15
|
const { l1BlockHash = Buffer32.random() } = overrides;
|
|
15
16
|
const { leaf = Fr.random() } = overrides;
|
|
16
17
|
const { rollingHash = updateRollingHash(previousRollingHash, leaf) } = overrides;
|
|
17
|
-
const { index = InboxLeaf.
|
|
18
|
+
const { index = InboxLeaf.smallestIndexForCheckpoint(checkpointNumber) } = overrides;
|
|
18
19
|
|
|
19
20
|
return {
|
|
20
21
|
index,
|
|
21
22
|
leaf,
|
|
22
|
-
|
|
23
|
+
checkpointNumber,
|
|
23
24
|
l1BlockNumber,
|
|
24
25
|
l1BlockHash,
|
|
25
26
|
rollingHash,
|
|
@@ -30,17 +31,17 @@ export function makeInboxMessages(
|
|
|
30
31
|
count: number,
|
|
31
32
|
opts: {
|
|
32
33
|
initialHash?: Buffer16;
|
|
33
|
-
|
|
34
|
+
initialCheckpointNumber?: CheckpointNumber;
|
|
34
35
|
overrideFn?: (msg: InboxMessage, index: number) => InboxMessage;
|
|
35
36
|
} = {},
|
|
36
37
|
): InboxMessage[] {
|
|
37
|
-
const { initialHash = Buffer16.ZERO, overrideFn = msg => msg,
|
|
38
|
+
const { initialHash = Buffer16.ZERO, overrideFn = msg => msg, initialCheckpointNumber = 1 } = opts;
|
|
38
39
|
const messages: InboxMessage[] = [];
|
|
39
40
|
let rollingHash = initialHash;
|
|
40
41
|
for (let i = 0; i < count; i++) {
|
|
41
42
|
const leaf = Fr.random();
|
|
42
|
-
const
|
|
43
|
-
const message = overrideFn(makeInboxMessage(rollingHash, { leaf,
|
|
43
|
+
const checkpointNumber = CheckpointNumber(i + initialCheckpointNumber);
|
|
44
|
+
const message = overrideFn(makeInboxMessage(rollingHash, { leaf, checkpointNumber }), i);
|
|
44
45
|
rollingHash = message.rollingHash;
|
|
45
46
|
messages.push(message);
|
|
46
47
|
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { type CheckpointBlobData } from '@aztec/blob-lib';
|
|
2
|
-
import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
3
|
-
import type { ViemClient, ViemPublicClient } from '@aztec/ethereum';
|
|
4
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type Logger } from '@aztec/foundation/log';
|
|
7
|
-
import { type InboxAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
8
|
-
import { CommitteeAttestation } from '@aztec/stdlib/block';
|
|
9
|
-
import { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
10
|
-
import { Proof } from '@aztec/stdlib/proofs';
|
|
11
|
-
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
12
|
-
import { type GetContractReturnType, type Hex } from 'viem';
|
|
13
|
-
import type { DataRetrieval } from './structs/data_retrieval.js';
|
|
14
|
-
import type { InboxMessage } from './structs/inbox_message.js';
|
|
15
|
-
import type { L1PublishedData } from './structs/published.js';
|
|
16
|
-
export type RetrievedCheckpoint = {
|
|
17
|
-
checkpointNumber: number;
|
|
18
|
-
archiveRoot: Fr;
|
|
19
|
-
header: CheckpointHeader;
|
|
20
|
-
checkpointBlobData: CheckpointBlobData;
|
|
21
|
-
l1: L1PublishedData;
|
|
22
|
-
chainId: Fr;
|
|
23
|
-
version: Fr;
|
|
24
|
-
attestations: CommitteeAttestation[];
|
|
25
|
-
};
|
|
26
|
-
export declare function retrievedToPublishedCheckpoint({ checkpointNumber, archiveRoot, header: checkpointHeader, checkpointBlobData, l1, chainId, version, attestations }: RetrievedCheckpoint): Promise<PublishedCheckpoint>;
|
|
27
|
-
/**
|
|
28
|
-
* Fetches new checkpoints.
|
|
29
|
-
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
30
|
-
* @param rollupAddress - The address of the rollup contract.
|
|
31
|
-
* @param searchStartBlock - The block number to use for starting the search.
|
|
32
|
-
* @param searchEndBlock - The highest block number that we should search up to.
|
|
33
|
-
* @param expectedNextL2BlockNum - The next L2 block number that we expect to find.
|
|
34
|
-
* @returns An array of block; as well as the next eth block to search from.
|
|
35
|
-
*/
|
|
36
|
-
export declare function retrieveCheckpointsFromRollup(rollup: GetContractReturnType<typeof RollupAbi, ViemPublicClient>, publicClient: ViemPublicClient, blobSinkClient: BlobSinkClientInterface, searchStartBlock: bigint, searchEndBlock: bigint, logger?: Logger): Promise<RetrievedCheckpoint[]>;
|
|
37
|
-
export declare function getL1BlockTime(publicClient: ViemPublicClient, blockNumber: bigint): Promise<bigint>;
|
|
38
|
-
/** Given an L1 to L2 message, retrieves its corresponding event from the Inbox within a specific block range. */
|
|
39
|
-
export declare function retrieveL1ToL2Message(inbox: GetContractReturnType<typeof InboxAbi, ViemClient>, leaf: Fr, fromBlock: bigint, toBlock: bigint): Promise<InboxMessage | undefined>;
|
|
40
|
-
/**
|
|
41
|
-
* Fetch L1 to L2 messages.
|
|
42
|
-
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
43
|
-
* @param inboxAddress - The address of the inbox contract to fetch messages from.
|
|
44
|
-
* @param blockUntilSynced - If true, blocks until the archiver has fully synced.
|
|
45
|
-
* @param searchStartBlock - The block number to use for starting the search.
|
|
46
|
-
* @param searchEndBlock - The highest block number that we should search up to.
|
|
47
|
-
* @returns An array of InboxLeaf and next eth block to search from.
|
|
48
|
-
*/
|
|
49
|
-
export declare function retrieveL1ToL2Messages(inbox: GetContractReturnType<typeof InboxAbi, ViemClient>, searchStartBlock: bigint, searchEndBlock: bigint): Promise<InboxMessage[]>;
|
|
50
|
-
/** Retrieves L2ProofVerified events from the rollup contract. */
|
|
51
|
-
export declare function retrieveL2ProofVerifiedEvents(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<{
|
|
52
|
-
l1BlockNumber: bigint;
|
|
53
|
-
checkpointNumber: number;
|
|
54
|
-
proverId: Fr;
|
|
55
|
-
txHash: Hex;
|
|
56
|
-
}[]>;
|
|
57
|
-
/** Retrieve submitted proofs from the rollup contract */
|
|
58
|
-
export declare function retrieveL2ProofsFromRollup(publicClient: ViemPublicClient, rollupAddress: EthAddress, searchStartBlock: bigint, searchEndBlock?: bigint): Promise<DataRetrieval<{
|
|
59
|
-
proof: Proof;
|
|
60
|
-
proverId: Fr;
|
|
61
|
-
checkpointNumber: number;
|
|
62
|
-
txHash: `0x${string}`;
|
|
63
|
-
}>>;
|
|
64
|
-
export type SubmitEpochProof = {
|
|
65
|
-
archiveRoot: Fr;
|
|
66
|
-
proverId: Fr;
|
|
67
|
-
proof: Proof;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* Gets epoch proof metadata (archive root and proof) from the calldata of an L1 transaction.
|
|
71
|
-
* Assumes that the block was published from an EOA.
|
|
72
|
-
* TODO: Add retries and error management.
|
|
73
|
-
* @param publicClient - The viem public client to use for transaction retrieval.
|
|
74
|
-
* @param txHash - Hash of the tx that published it.
|
|
75
|
-
* @param expectedProverId - Expected prover ID.
|
|
76
|
-
* @returns Epoch proof metadata from the calldata, deserialized.
|
|
77
|
-
*/
|
|
78
|
-
export declare function getProofFromSubmitProofTx(publicClient: ViemPublicClient, txHash: `0x${string}`, expectedProverId: Fr): Promise<SubmitEpochProof>;
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YV9yZXRyaWV2YWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hcmNoaXZlci9kYXRhX3JldHJpZXZhbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEV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