Skip to content

Commit 5d74f82

Browse files
feat(rpcv10): response_flags for the rpcv10; proof_facts, proof for invoke v3 txs (#3380)
* implement response_flags * linter * linter, comments * linter * linter * lint * linter, comments * linter, comments * unit tests * minor code cleanups * lint * cleanups * comments * comments * lint * linter * second round of comments * linter, comments * comments * fixes after rebase * linter * linter * linter * comments * linter * test cleanups * linter
1 parent 5ce32d2 commit 5d74f82

28 files changed

+2886
-245
lines changed

adapters/mempool2p2p/testutils/mempool_p2p_adapters_test_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ var TransactionBuilder = transactiontestutils.TransactionBuilder[
2323
Transaction: transaction,
2424
DeclaredClass: class,
2525
PaidFeeOnL1: paidFeeOnL1,
26+
Proof: nil,
2627
}
2728
},
2829
ToP2PDeclareV3: func(

adapters/p2p2core/transaction.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ func AdaptInvokeV0TxnCommon(
272272
AccountDeploymentData: nil,
273273
NonceDAMode: 0,
274274
FeeDAMode: 0,
275+
ProofFacts: nil,
275276
}
276277
}
277278

@@ -296,6 +297,7 @@ func AdaptInvokeV1TxnCommon(
296297
AccountDeploymentData: nil,
297298
NonceDAMode: 0,
298299
FeeDAMode: 0,
300+
ProofFacts: nil,
299301
}
300302
}
301303

@@ -339,6 +341,7 @@ func AdaptInvokeV3TxnCommon(
339341
NonceDAMode: nDAMode,
340342
FeeDAMode: fDAMode,
341343
AccountDeploymentData: nil, // todo(kirill) recheck
344+
ProofFacts: nil,
342345
}, nil
343346
}
344347

adapters/p2p2mempool/transaction.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,6 @@ func AdaptTransaction(
7979
Transaction: tx,
8080
DeclaredClass: class,
8181
PaidFeeOnL1: nil,
82+
Proof: nil,
8283
}, nil
8384
}

adapters/sn2core/sn2core.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ func AdaptInvokeTransaction(t *starknet.Transaction) *core.InvokeTransaction {
247247
AccountDeploymentData: utils.DerefSlice(t.AccountDeploymentData),
248248
NonceDAMode: adaptDataAvailabilityMode(t.NonceDAMode),
249249
FeeDAMode: adaptDataAvailabilityMode(t.FeeDAMode),
250+
ProofFacts: utils.DerefSlice(t.ProofFacts),
250251
}
251252
}
252253

adapters/testutils/synctransaction_test_utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ func (b *SyncTransactionBuilder[C, P]) GetTestInvokeTransactionV0(
438438
AccountDeploymentData: nil, // this field is not available on v0
439439
NonceDAMode: 0, // this field is not available on v0
440440
FeeDAMode: 0, // this field is not available on v0
441+
ProofFacts: nil, // this field is not available on v0
441442
}
442443

443444
transactionHash, p2pHash := getTransactionHash(
@@ -489,6 +490,7 @@ func (b *SyncTransactionBuilder[C, P]) GetTestInvokeTransactionV1(
489490
AccountDeploymentData: nil, // this field is not available on v1
490491
NonceDAMode: 0, // this field is not available on v1
491492
FeeDAMode: 0, // this field is not available on v1
493+
ProofFacts: nil, // this field is not available on v1
492494
}
493495

494496
transactionHash, p2pHash := getTransactionHash(
@@ -549,6 +551,7 @@ func (b *SyncTransactionBuilder[C, P]) GetTestInvokeTransactionV3(
549551
NonceDAMode: core.DAModeL2,
550552
FeeDAMode: core.DAModeL2,
551553
AccountDeploymentData: nil, // TODO: this is for future use as per starknet document
554+
ProofFacts: nil, // this field is optional
552555
}
553556

554557
transactionHash, p2pHash := getTransactionHash(

adapters/testutils/transaction_test_utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ func (b *TransactionBuilder[C, P]) GetTestInvokeTransaction(t *testing.T, networ
279279
AccountDeploymentData: nil, // TODO: Figure out why the original adapter doesn't set this field
280280
NonceDAMode: core.DAModeL2,
281281
FeeDAMode: core.DAModeL2,
282+
ProofFacts: nil,
282283
}
283284

284285
p2pTransaction := transaction.InvokeV3{
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
{
2+
"block_hash": "0x7681e58d041005f83d84e9b0a109bc7ca2dc69e995e96f9b7a310f2844c3144",
3+
"parent_block_hash": "0xc131b0a9eb82d885fd8cdb0abc296c18daaa50395be5e4231e5f4b989d5c5",
4+
"block_number": 4072139,
5+
"state_root": "0x636e63b6488bebd672a9a498396ec78a1d25bcd6d450a30119cdea968a5239a",
6+
"transaction_commitment": "0x7c4f6a177cd2caf055005f9cf42799f4d79423bc8ef8ad2222dde506e603827",
7+
"event_commitment": "0xaae3adbf9ccae419cf4d1d98096bca6615f1981a238d71666faf07149b1269",
8+
"receipt_commitment": "0x7e3ba4dceefff0dac37b379bef61d9a597097374fc257336eec947d5db5cdf4",
9+
"state_diff_commitment": "0x7c59a7f3cb9b48e14a807e0a88509c1083c0f4ba0223a99f2a13cbcfa71606f",
10+
"state_diff_length": 5,
11+
"status": "ACCEPTED_ON_L1",
12+
"l1_da_mode": "BLOB",
13+
"l1_gas_price": {
14+
"price_in_wei": "0x621968d7",
15+
"price_in_fri": "0x2e39b22cf291"
16+
},
17+
"l1_data_gas_price": {
18+
"price_in_wei": "0x1005d948b",
19+
"price_in_fri": "0x78cd54b96e64"
20+
},
21+
"l2_gas_price": {
22+
"price_in_wei": "0x3f3f0",
23+
"price_in_fri": "0x1dcd65000"
24+
},
25+
"transactions": [
26+
{
27+
"transaction_hash": "0x65113960b46296e8d526147618e28d77cbd500812920eb165e0ea6442b45033",
28+
"version": "0x3",
29+
"signature": [
30+
"0x5cc1d551e1f95cbf1772b1bcf46cf15e84993ce31499a36c04786e2db868ed9",
31+
"0x5214b6721ddf22f1ff3e0f8f3db82202403da0dfb930a66c0afffdf16d14e09"
32+
],
33+
"nonce": "0x31a6b7",
34+
"nonce_data_availability_mode": 0,
35+
"fee_data_availability_mode": 0,
36+
"resource_bounds": {
37+
"L1_GAS": {
38+
"max_amount": "0x11170",
39+
"max_price_per_unit": "0x8d79883d20000"
40+
},
41+
"L2_GAS": {
42+
"max_amount": "0x5f5e100",
43+
"max_price_per_unit": "0xba43b7400"
44+
},
45+
"L1_DATA_GAS": {
46+
"max_amount": "0x2710",
47+
"max_price_per_unit": "0x62448724953354"
48+
}
49+
},
50+
"tip": "0x5f5e100",
51+
"paymaster_data": [],
52+
"sender_address": "0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
53+
"calldata": [
54+
"0x2",
55+
"0x2a730fc5366a8932645ada40338487d5c272294d70a43dc2d53f03534f418ea",
56+
"0x1a8e87e9d2008fcd3ce423ae5219c21e49be18d05d72825feb7e2bb687ba35c",
57+
"0x2",
58+
"0x71f35d3f06767b0efc26efd8cc227200",
59+
"0x6ee86d6a68ece86e722cd7222327a409",
60+
"0x3eaf27245e5a10286542e75c216d17432dd077984c86d37944ba7f5002d10d3",
61+
"0x27a4a7332e590dd789019a6d125ff2aacd358e453090978cbf81f0d85e4c045",
62+
"0x2",
63+
"0x69",
64+
"0x6420a2f6cbbfaf79bae5e3bef3133abe1d0b10241b6052c6404d43f93926aca"
65+
],
66+
"account_deployment_data": [],
67+
"type": "INVOKE_FUNCTION",
68+
"proof_facts": []
69+
},
70+
{
71+
"transaction_hash": "0x7222c986fd607b48c7d38ef1eae6087e9975a2fc89c27104985171bb86e1f3b",
72+
"version": "0x3",
73+
"signature": [
74+
"0x750d85f31bd084165c4b94779f69675616a76bb0b62a456d36201c7c84c62d0",
75+
"0x469a1d2c86c0be7770e877e17db0b612ef8101f306e16fee28585e66bb13178"
76+
],
77+
"nonce": "0x31a6b8",
78+
"nonce_data_availability_mode": 0,
79+
"fee_data_availability_mode": 0,
80+
"resource_bounds": {
81+
"L1_GAS": {
82+
"max_amount": "0x11170",
83+
"max_price_per_unit": "0x8d79883d20000"
84+
},
85+
"L2_GAS": {
86+
"max_amount": "0x5f5e100",
87+
"max_price_per_unit": "0xba43b7400"
88+
},
89+
"L1_DATA_GAS": {
90+
"max_amount": "0x2710",
91+
"max_price_per_unit": "0x62448724953354"
92+
}
93+
},
94+
"tip": "0x5f5e100",
95+
"paymaster_data": [],
96+
"sender_address": "0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
97+
"calldata": [
98+
"0x1",
99+
"0x3eaf27245e5a10286542e75c216d17432dd077984c86d37944ba7f5002d10d3",
100+
"0x1136789e1c76159d9b9eca06fcef05bdcf77f5d51bd4d9e09f2bc8d7520d8e6",
101+
"0x2",
102+
"0x6c2381ddda75eb5ff41701b1a561a639",
103+
"0x8a9fa0dba18950753ca37068949cf1ad"
104+
],
105+
"account_deployment_data": [],
106+
"type": "INVOKE_FUNCTION",
107+
"proof_facts": []
108+
},
109+
{
110+
"transaction_hash": "0x715e2102b9a1f2a775bf0566110f4eaff01862521038039ce59274191e07c74",
111+
"version": "0x3",
112+
"signature": [
113+
"0x3d850d742b92a32db57cb4555d24952b7ee4d1a6fd4405d511729d0f302c216",
114+
"0x68baedd1fbc602c35cefd82bbcd28768f45f2a24bd57d76e6d794454f902e50"
115+
],
116+
"nonce": "0x31a6b9",
117+
"nonce_data_availability_mode": 0,
118+
"fee_data_availability_mode": 0,
119+
"resource_bounds": {
120+
"L1_GAS": {
121+
"max_amount": "0x11170",
122+
"max_price_per_unit": "0x8d79883d20000"
123+
},
124+
"L2_GAS": {
125+
"max_amount": "0x5f5e100",
126+
"max_price_per_unit": "0xba43b7400"
127+
},
128+
"L1_DATA_GAS": {
129+
"max_amount": "0x2710",
130+
"max_price_per_unit": "0x62448724953354"
131+
}
132+
},
133+
"tip": "0x5f5e100",
134+
"paymaster_data": [],
135+
"sender_address": "0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
136+
"calldata": [
137+
"0x2",
138+
"0x3eaf27245e5a10286542e75c216d17432dd077984c86d37944ba7f5002d10d3",
139+
"0x3d3da80997f8be5d16e9ae7ee6a4b5f7191d60765a1a6c219ab74269c85cf97",
140+
"0x0",
141+
"0x3eaf27245e5a10286542e75c216d17432dd077984c86d37944ba7f5002d10d3",
142+
"0x1136789e1c76159d9b9eca06fcef05bdcf77f5d51bd4d9e09f2bc8d7520d8e6",
143+
"0x2",
144+
"0x1d7efa2260abb33161c58910a58417ac",
145+
"0x2b24d93f737dd9f73c21eac58a347225"
146+
],
147+
"account_deployment_data": [],
148+
"type": "INVOKE_FUNCTION",
149+
"proof_facts": []
150+
}
151+
],
152+
"timestamp": 1765887576,
153+
"sequencer_address": "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
154+
"transaction_receipts": [
155+
{
156+
"execution_status": "SUCCEEDED",
157+
"transaction_index": 0,
158+
"transaction_hash": "0x65113960b46296e8d526147618e28d77cbd500812920eb165e0ea6442b45033",
159+
"l2_to_l1_messages": [],
160+
"events": [
161+
{
162+
"from_address": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
163+
"keys": [
164+
"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
165+
],
166+
"data": [
167+
"0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
168+
"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
169+
"0x9ec43bcf1df500",
170+
"0x0"
171+
]
172+
}
173+
],
174+
"execution_resources": {
175+
"n_steps": 5406,
176+
"builtin_instance_counter": {
177+
"poseidon_builtin": 23,
178+
"range_check_builtin": 226,
179+
"pedersen_builtin": 4
180+
},
181+
"n_memory_holes": 0,
182+
"data_availability": {
183+
"l1_gas": 0,
184+
"l1_data_gas": 256,
185+
"l2_gas": 0
186+
},
187+
"total_gas_consumed": {
188+
"l1_gas": 0,
189+
"l1_data_gas": 256,
190+
"l2_gas": 1319265
191+
}
192+
},
193+
"actual_fee": "0x9ec43bcf1df500"
194+
},
195+
{
196+
"execution_status": "SUCCEEDED",
197+
"transaction_index": 1,
198+
"transaction_hash": "0x7222c986fd607b48c7d38ef1eae6087e9975a2fc89c27104985171bb86e1f3b",
199+
"l2_to_l1_messages": [],
200+
"events": [
201+
{
202+
"from_address": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
203+
"keys": [
204+
"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
205+
],
206+
"data": [
207+
"0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
208+
"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
209+
"0x5d8fcf733f5100",
210+
"0x0"
211+
]
212+
}
213+
],
214+
"execution_resources": {
215+
"n_steps": 4890,
216+
"builtin_instance_counter": {
217+
"pedersen_builtin": 4,
218+
"poseidon_builtin": 18,
219+
"range_check_builtin": 158
220+
},
221+
"n_memory_holes": 0,
222+
"data_availability": {
223+
"l1_gas": 0,
224+
"l1_data_gas": 128,
225+
"l2_gas": 0
226+
},
227+
"total_gas_consumed": {
228+
"l1_gas": 0,
229+
"l1_data_gas": 128,
230+
"l2_gas": 1152335
231+
}
232+
},
233+
"actual_fee": "0x5d8fcf733f5100"
234+
},
235+
{
236+
"execution_status": "SUCCEEDED",
237+
"transaction_index": 2,
238+
"transaction_hash": "0x715e2102b9a1f2a775bf0566110f4eaff01862521038039ce59274191e07c74",
239+
"l2_to_l1_messages": [],
240+
"events": [
241+
{
242+
"from_address": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
243+
"keys": [
244+
"0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"
245+
],
246+
"data": [
247+
"0x4f4e29add19afa12c868ba1f4439099f225403ff9a71fe667eebb50e13518d3",
248+
"0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8",
249+
"0x6227fb347e7900",
250+
"0x0"
251+
]
252+
}
253+
],
254+
"execution_resources": {
255+
"n_steps": 4907,
256+
"builtin_instance_counter": {
257+
"pedersen_builtin": 4,
258+
"range_check_builtin": 158,
259+
"poseidon_builtin": 20
260+
},
261+
"n_memory_holes": 0,
262+
"data_availability": {
263+
"l1_gas": 0,
264+
"l1_data_gas": 128,
265+
"l2_gas": 0
266+
},
267+
"total_gas_consumed": {
268+
"l1_gas": 0,
269+
"l1_data_gas": 128,
270+
"l2_gas": 1311991
271+
}
272+
},
273+
"actual_fee": "0x6227fb347e7900"
274+
}
275+
],
276+
"starknet_version": "0.14.1"
277+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"block_hash": "0x7681e58d041005f83d84e9b0a109bc7ca2dc69e995e96f9b7a310f2844c3144", "signature": ["0x711dcda18cd159c7372ab2d82d15534ea42d1e2317fc93426506daf492755b0", "0x3898b1c5e8d76243b608e767981f1fd50ed894cbd7d85afdc1c108f76bdfc10"]}

0 commit comments

Comments
 (0)