Compare commits

..

270 Commits

Author SHA1 Message Date
Ishika Choudhury
830125e95a fixes 2025-12-10 20:08:56 +05:30
Soubhik Singha Mahapatra
0bc0a6b7c3 rebase 2025-12-10 18:39:13 +05:30
Ishika Choudhury
068ef0c681 fixes 2025-12-10 18:23:20 +05:30
Ishika Choudhury
49249ed2c8 fixes 2025-12-09 23:16:16 +05:30
Ishika Choudhury
c72163de43 fixes 2025-12-09 22:23:47 +05:30
Ishika Choudhury
41c02695d5 bal to rpc compact 2025-12-09 21:20:01 +05:30
Ishika Choudhury
6f626fd6d2 fixes 2025-12-09 21:10:28 +05:30
Soubhik Singha Mahapatra
b222cc64cd try fix 2025-12-09 20:34:09 +05:30
Ishika Choudhury
b89ef781f7 fixes 2025-12-09 19:32:29 +05:30
Soubhik Singha Mahapatra
71cd419f7f more tracing 2025-12-09 19:09:40 +05:30
Ishika Choudhury
fdaf3403e0 chore: set bal new 2025-12-07 21:49:18 +05:30
Ishika Choudhury
331e8ca110 fixes 2025-12-07 20:41:16 +05:30
Ishika Choudhury
3a1e2e23a9 bump bal index 2025-12-07 18:41:15 +05:30
Ishika Choudhury
3fbe585448 fixes 2025-12-07 17:27:00 +05:30
Ishika Choudhury
d8b13adacd fixes 2025-12-06 16:07:09 +05:30
Soubhik Singha Mahapatra
26cc128546 rerun 2025-12-06 13:29:55 +05:30
Soubhik Singha Mahapatra
cdd2298da4 fix 2025-12-06 13:08:41 +05:30
Ishika Choudhury
b5391deeca fixes 2025-12-06 12:47:34 +05:30
Ishika Choudhury
d753e1983d chore: rebase and fixes 2025-12-05 21:11:24 +05:30
Ishika Choudhury
87cc04ee7b fixes 2025-11-27 23:44:35 +05:30
Ishika Choudhury
d7dc2586b6 fixes 2025-11-27 23:31:55 +05:30
Ishika Choudhury
6056f9ec1a new release tests 2025-11-27 21:49:38 +05:30
Ishika Choudhury
778af94ecc Update build_simulators.sh 2025-11-22 07:33:10 -03:00
Ishika Choudhury
5d21b42dcd Merge branch 'main' into new-approach3 2025-11-22 07:22:23 -03:00
Soubhik-10
5c60cb42d4 trace 2025-11-22 03:26:20 +05:30
Soubhik-10
de3f6ebd6f Merge branch 'main' into new-approach3 2025-11-22 02:09:55 +05:30
Ishika Choudhury
b3863e4bf0 Update build_simulators.sh 2025-11-21 09:57:46 -03:00
Soubhik-10
3f38f77fc3 fmt 2025-11-12 10:52:49 +05:30
Soubhik-10
b2c31b0f7c Merge branch 'main' into new-approach3 2025-11-12 10:51:39 +05:30
Soubhik Singha Mahapatra
4724cec28d run all fixtures 2025-11-07 08:51:27 +05:30
Soubhik Singha Mahapatra
6824f4726b fix 2025-11-06 22:47:53 +05:30
Ishika Choudhury
092600c6d8 feat: added getBlockAccessList for eip-7928 (#20)
Co-authored-by: Soubhik Singha Mahapatra <160333583+Soubhik-10@users.noreply.github.com>
2025-11-06 22:44:51 +05:30
Soubhik Singha Mahapatra
4163e4ea4a more logs 2025-11-06 21:11:21 +05:30
Soubhik Singha Mahapatra
1cbd53ea4f fmt 2025-11-06 21:05:34 +05:30
Soubhik Singha Mahapatra
4cba143822 fix 2025-11-06 20:31:13 +05:30
Soubhik Singha Mahapatra
41d2276755 fix 2025-11-06 20:24:37 +05:30
Ishika Choudhury
7603ac7e23 fixes 2025-11-06 19:46:30 +05:30
Soubhik Singha Mahapatra
1164e11600 fixes 2025-11-05 17:58:18 +05:30
Soubhik Singha Mahapatra
796c19cc57 Merge branch 'main' into new-approach3 2025-11-05 17:53:48 +05:30
Ishika Choudhury
016b36c918 fixes 2025-11-05 16:08:24 +05:30
Ishika Choudhury
efd198246d fix: added proper handling for empty block(coinbase) 2025-11-05 15:27:59 +05:30
Soubhik Singha Mahapatra
495a3b3bd1 Merge branch 'new-approach3' of https://github.com/Rimeeeeee/reth into new-approach3 2025-11-05 14:42:16 +05:30
Soubhik Singha Mahapatra
1fc48d4291 fixes 2025-11-05 14:41:52 +05:30
Soubhik Singha Mahapatra
ae3f950135 Merge branch 'paradigmxyz:main' into new-approach3 2025-11-05 14:11:02 +05:30
Soubhik Singha Mahapatra
18cee16f54 fixes 2025-11-05 14:09:55 +05:30
Soubhik Singha Mahapatra
eb2dc5e84b fix 2025-11-05 13:30:04 +05:30
Ishika Choudhury
4bb38df3eb fixes 2025-11-05 12:19:43 +05:30
Ishika Choudhury
869306a2ae fixes 2025-11-05 00:23:19 +05:30
Ishika Choudhury
43f4fef490 tracing 2025-11-04 22:15:48 +05:30
Soubhik-10
e048909f74 new bramnch 2025-11-04 21:14:50 +05:30
Soubhik-10
67ba84edab new bramnch 2025-11-04 21:14:24 +05:30
Soubhik-10
b4f405a7b2 new bramnch 2025-11-04 20:39:45 +05:30
Soubhik-10
0ff2a51eab fix 2025-11-04 20:07:54 +05:30
Soubhik-10
e63a2521a3 fix 2025-11-04 20:06:22 +05:30
Ishika Choudhury
63ef0734f7 fixes 2025-11-04 19:14:17 +05:30
Soubhik-10
02e3c2b768 fix 2025-11-04 18:25:27 +05:30
Ishika Choudhury
925b57abcb fixes 2025-11-04 17:47:55 +05:30
Soubhik-10
20af62849e fixes 2025-11-04 17:15:23 +05:30
Soubhik-10
d6281dc72e fixes 2025-11-04 16:46:21 +05:30
Soubhik-10
2aaa8a844b fixes 2025-11-04 16:00:46 +05:30
Ishika Choudhury
c1d056b7e3 Merge branch 'new-approach3' of https://github.com/Rimeeeeee/reth into new-approach3 2025-11-04 15:27:05 +05:30
Ishika Choudhury
f13e9d840d fixes 2025-11-04 15:26:43 +05:30
Soubhik-10
498889f094 branch fix 2025-11-04 11:25:46 +05:30
Ishika Choudhury
0ac3973352 fixes 2025-11-04 11:03:01 +05:30
Ishika Choudhury
54b66df732 tests with bal new release 2025-11-04 10:46:14 +05:30
PO
6bcc0a6887 avoid failed to open the database error when BAL is not enabled (#19) 2025-11-04 10:37:55 +05:30
Soubhik Singha Mahapatra
112ff19582 fixes 2025-10-31 18:24:13 +05:30
Ishika Choudhury
d3cb07f256 Merge branch 'new-approach3' of https://github.com/Rimeeeeee/reth into new-approach3 2025-10-31 16:25:01 +05:30
Ishika Choudhury
5aa81f9487 fixes 2025-10-31 16:24:35 +05:30
Soubhik Singha Mahapatra
d0f4238163 fix 2025-10-31 10:50:34 +05:30
Soubhik Singha Mahapatra
41393b1f83 Merge branch 'new-approach3' of https://github.com/Rimeeeeee/reth into new-approach3 2025-10-31 09:40:52 +05:30
Soubhik Singha Mahapatra
a7a0d85527 fix 2025-10-31 09:40:31 +05:30
Soubhik Singha Mahapatra
9f83a91baf Merge branch 'main' into new-approach3 2025-10-31 09:22:38 +05:30
Soubhik Singha Mahapatra
5186797a2f try hive on old 2025-10-31 09:21:15 +05:30
Soubhik Singha Mahapatra
4012a60bd0 fix 2025-10-30 23:35:11 +05:30
Ishika Choudhury
d79125dd9b fixes 2025-10-30 23:04:15 +05:30
Ishika Choudhury
3ac602a366 Merge branch 'new-approach3' of https://github.com/Rimeeeeee/reth into new-approach3 2025-10-30 20:32:47 +05:30
Ishika Choudhury
f96a37a4ed fixes 2025-10-30 20:32:15 +05:30
Soubhik Singha Mahapatra
c469ef9337 fix 2025-10-30 19:37:05 +05:30
Soubhik Singha Mahapatra
6bb9df9dbb fmt 2025-10-30 19:29:26 +05:30
Soubhik Singha Mahapatra
bd59f50d49 fmt 2025-10-30 19:12:59 +05:30
Ishika Choudhury
2c554a0cc3 fixes 2025-10-30 18:50:39 +05:30
Soubhik-10
b775368d85 Merge branch 'main' into new-approach3 2025-10-30 16:08:49 +05:30
Soubhik-10
b755ea39a3 try fix hive 2025-10-30 15:43:09 +05:30
Ishika Choudhury
5393381863 fixes 2025-10-30 13:52:16 +05:30
Soubhik-10
3a30b97774 rebase 2025-10-30 12:23:37 +05:30
Ishika Choudhury
57269e281e Merge branch 'new-approach' of https://github.com/Rimeeeeee/reth into new-approach 2025-10-22 22:12:48 +05:30
Ishika Choudhury
976c4255e2 fixes 2025-10-22 22:12:28 +05:30
Ishika Choudhury
a1466e3a6e Merge branch 'main' into new-approach 2025-10-22 21:34:04 +05:30
Ishika Choudhury
db1ee1dfea fixes 2025-10-22 21:31:42 +05:30
Ishika Choudhury
79c0b81b7e fixes 2025-10-22 20:43:14 +05:30
Soubhik Singha Mahapatra
2eb460d74a Merge branch 'paradigmxyz:main' into new-approach 2025-10-22 20:35:44 +05:30
Soubhik-10
cf8ba329c7 amsterdam 2025-10-22 20:11:52 +05:30
Soubhik-10
8105616931 amsterdam 2025-10-22 20:08:33 +05:30
Soubhik-10
4795e66fbd amsterdam 2025-10-22 19:58:38 +05:30
Soubhik-10
82771ebdd2 amsterdam 2025-10-22 19:40:33 +05:30
Soubhik-10
78eeb03c43 pin 2025-10-22 19:27:53 +05:30
Soubhik-10
62b12c9587 pin 2025-10-22 18:55:51 +05:30
Soubhik-10
b0f4154455 pin 2025-10-22 18:53:18 +05:30
Ishika Choudhury
a914ed6b56 fixes 2025-10-22 18:29:35 +05:30
Ishika Choudhury
aaff3a32d5 fix: updated alloy/evm 2025-10-22 17:56:03 +05:30
Ishika Choudhury
d92f818086 hive run 2025-10-22 17:05:13 +05:30
Ishika Choudhury
9bcfcbf0d4 fixes 2025-10-20 20:43:58 +05:30
Ishika Choudhury
beade650c4 fixes 2025-10-20 12:36:09 +05:30
Soubhik-10
96c0db1b87 mergre 2025-10-20 08:29:26 +05:30
Soubhik-10
bf064424c2 mergre 2025-10-20 07:52:45 +05:30
Soubhik-10
12ce5b43fb update evm 2025-10-20 07:40:16 +05:30
Soubhik-10
830b98da64 traces 2025-10-19 21:30:35 +05:30
Soubhik-10
0875ba0f57 fix 2025-10-19 20:48:47 +05:30
Soubhik Singha Mahapatra
77133f1c3c Merge branch 'paradigmxyz:main' into new-approach 2025-10-19 20:43:28 +05:30
Soubhik-10
fc64e9228d fix 2025-10-19 20:41:08 +05:30
Ishika Choudhury
a9248d78d0 fixes 2025-10-19 20:34:14 +05:30
Ishika Choudhury
a27af7f6f5 fixes 2025-10-19 20:29:34 +05:30
Ishika Choudhury
f296e727a7 fixes 2025-10-19 11:44:41 +05:30
Ishika Choudhury
b06f731410 new revm for bal 2025-10-19 10:58:49 +05:30
Ishika Choudhury
1e9fb40156 fixes 2025-10-15 12:07:09 +05:30
Ishika Choudhury
00d2f8ae32 fixes bal 2025-10-15 11:35:04 +05:30
Ishika Choudhury
3633c97fc0 rebase 2025-10-15 11:11:40 +05:30
Ishika Choudhury
383421ee2f fixes 2025-10-15 10:57:21 +05:30
Ishika Choudhury
a6a07b7df5 fixes 2025-10-12 12:04:56 +05:30
Ishika Choudhury
cc3fd77982 foxes 2025-10-11 22:04:32 +05:30
Ishika Choudhury
8ac93babb5 tracing for account 2025-10-11 21:24:32 +05:30
Ishika Choudhury
fa03006830 fixes 2025-10-11 19:48:14 +05:30
Soubhik-10
ca9dddc8ee try fix 2025-10-11 19:02:28 +05:30
Soubhik-10
c5989637cf try fix 2025-10-11 18:34:53 +05:30
Soubhik-10
7fee43bc26 new tar 2025-10-11 17:00:34 +05:30
Ishika Choudhury
54debce9ed oog handling 2025-10-11 16:37:04 +05:30
Ishika Choudhury
4ca9cb597f fixes 2025-10-11 12:28:59 +05:30
Ishika Choudhury
e1cf800c5c feat: revert casing handle 2025-10-11 12:27:00 +05:30
Soubhik-10
80c3d60fbd code 2025-10-11 11:10:01 +05:30
Ishika Choudhury
c54f402150 tracing in evm 2025-10-11 11:05:38 +05:30
Ishika Choudhury
b6891d06c6 fixes 2025-10-10 21:52:09 +05:30
Soubhik-10
469dfe0fb3 fixed coinbase 2025-10-10 20:27:26 +05:30
Soubhik-10
d732c18f74 fixed coinbase 2025-10-10 19:53:13 +05:30
Soubhik-10
819b6d6704 oog 2025-10-09 15:52:44 +05:30
Ishika Choudhury
252de71a38 sender=recipt balance 2025-10-09 13:44:34 +05:30
Ishika Choudhury
a58cd20438 update 2025-10-09 12:33:19 +05:30
Ishika Choudhury
d014918119 fixes 2025-10-04 15:38:28 +05:30
Ishika Choudhury
d8b7450f9c Merge branch 'bal' of https://github.com/Rimeeeeee/reth into bal 2025-10-04 13:50:22 +05:30
Ishika Choudhury
e5c8922760 empty account handling for 2930 2025-10-04 13:48:55 +05:30
Soubhik-10
c937af1584 2930 2025-10-04 13:12:52 +05:30
Ishika Choudhury
5af61ef057 feat: running with new eest 2025-10-04 11:54:06 +05:30
Ishika Choudhury
548187ce22 fixes 2025-10-04 11:10:04 +05:30
Ishika Choudhury
90801b954e new way of tracking balance 2025-10-03 20:21:18 +05:30
Ishika Choudhury
cfc29f0463 fixes 2025-10-03 18:49:18 +05:30
Ishika Choudhury
1be4b9a631 zepter 2025-10-03 18:16:46 +05:30
Ishika Choudhury
dfcb3d1013 Merge branch 'main' into bal 2025-10-03 18:07:01 +05:30
Ishika Choudhury
f0e4d6b364 balance fixes 2025-10-03 18:05:39 +05:30
Ishika Choudhury
7084be96ff fixes 2025-10-03 17:19:09 +05:30
Ishika Choudhury
9dcedec746 fixes 2025-10-03 16:25:41 +05:30
Ishika Choudhury
cb83eeb13e fixes 2025-10-03 15:55:23 +05:30
Ishika Choudhury
118e58f9a0 fixes 2025-10-03 15:27:52 +05:30
Soubhik-10
8574dcc05b update 2025-10-03 14:21:30 +05:30
Ishika Choudhury
a7608944ae Merge branch 'main' into bal 2025-10-03 13:44:11 +05:30
Ishika Choudhury
cfada9b6dd feat: track balance change from revm 2025-10-03 13:41:44 +05:30
Soubhik-10
dc8def7d69 merge main 2025-10-01 18:46:52 +05:30
Soubhik-10
1c78c1b98a fix self-destruct 2025-09-30 12:48:37 +05:30
Ishika Choudhury
d0f9d47fac selffestruct fix 2025-09-30 12:14:30 +05:30
Ishika Choudhury
7ec0deeadd rebase 2025-09-30 10:18:41 +05:30
Soubhik-10
4b19ca268b new tar 2025-09-30 10:04:00 +05:30
Ishika Choudhury
4acd90b199 exp 2025-09-27 10:55:52 +05:30
Ishika Choudhury
02ef365987 fixes 2025-09-25 21:00:59 +05:30
Ishika Choudhury
751ee7c769 Merge branch 'bal' of https://github.com/Rimeeeeee/reth into bal 2025-09-25 20:33:17 +05:30
Ishika Choudhury
32b2240884 mapping fixes 2025-09-25 20:32:53 +05:30
Soubhik Singha Mahapatra
51900de33a Merge branch 'main' into bal 2025-09-25 19:48:17 +05:30
Ishika Choudhury
9ed37ccc93 fixes 2025-09-25 19:47:08 +05:30
Ishika Choudhury
8cff2b0f4c error variant fixes 2025-09-25 19:43:42 +05:30
Soubhik-10
e9f7790965 correct payload hash 2025-09-25 17:37:33 +05:30
Ishika Choudhury
03736e7784 fixes 2025-09-24 18:01:53 +05:30
Ishika Choudhury
11378180a8 added bal to payload attr 2025-09-24 17:46:54 +05:30
Ishika Choudhury
ae8ec3df2b Merge branch 'bal' of https://github.com/Rimeeeeee/reth into bal 2025-09-24 16:12:30 +05:30
Ishika Choudhury
660352fba2 added more tracing 2025-09-24 16:12:02 +05:30
Soubhik-10
ebb5955b43 traces 2025-09-24 13:40:06 +05:30
Ishika Choudhury
f691ab2796 fixes 2025-09-24 13:03:24 +05:30
Ishika Choudhury
2b8eaf1fed rebase 2025-09-24 13:02:08 +05:30
Ishika Choudhury
f7570a35d2 added tracing and clone(tbr) 2025-09-24 12:46:26 +05:30
Ishika Choudhury
08b8138748 fixes 2025-09-24 12:02:40 +05:30
Ishika Choudhury
f84984becd fixes 2025-09-23 23:48:53 +05:30
Soubhik-10
258cad74d6 address 2025-09-23 23:12:52 +05:30
Ishika Choudhury
c4c30cede4 code change fix 2025-09-23 22:27:11 +05:30
Ishika Choudhury
727ece434e nonce change fix 2025-09-23 21:39:22 +05:30
Ishika Choudhury
8d29344af5 fixes 2025-09-23 20:44:15 +05:30
Soubhik-10
96d24307b3 update 2025-09-23 20:06:22 +05:30
Soubhik-10
f229f6eba9 Merge branch 'main' into bal 2025-09-23 20:05:43 +05:30
Soubhik-10
9ee16c502a new tar 2025-09-23 19:32:07 +05:30
Ishika Choudhury
dcd5be6723 coinbase after tx 2025-09-23 18:58:14 +05:30
Soubhik-10
d07ee9a155 fix 2025-09-23 18:22:37 +05:30
Soubhik-10
4199058437 coinbase 2025-09-23 18:09:23 +05:30
Ishika Choudhury
87d2b12ac3 fixes 2025-09-23 17:29:41 +05:30
Soubhik-10
faa1b3698a retry again 2025-09-23 16:08:08 +05:30
Soubhik-10
07e8192b12 balance fix 2025-09-23 15:26:23 +05:30
Soubhik-10
0046f50d97 fix evm specid 2025-09-23 14:17:37 +05:30
Ishika Choudhury
1bd3f6bbc8 fixes 2025-09-23 12:00:38 +05:30
Ishika Choudhury
a827c71b9c added tracing 2025-09-23 11:58:37 +05:30
Ishika Choudhury
d5ab87825a fixes 2025-09-23 11:20:59 +05:30
Ishika Choudhury
f611af3d4d fix conflicts 2025-09-23 11:05:21 +05:30
Ishika Choudhury
7c2f715e72 fixes 2025-09-23 10:38:20 +05:30
Soubhik-10
c86a4169b9 logs 2025-09-20 13:30:40 +05:30
Soubhik-10
d1566e5553 old tar 2025-09-19 21:16:11 +05:30
Soubhik-10
50f3254028 fmt 2025-09-19 20:52:53 +05:30
Soubhik-10
b52f8556ca try new tar 2025-09-19 20:27:20 +05:30
Ishika Choudhury
ff68980619 refactor 2025-09-16 16:29:14 +05:30
Soubhik Singha Mahapatra
7ced848feb Merge branch 'main' into bal 2025-09-16 16:04:37 +05:30
Ishika Choudhury
2d43e96247 docs 2025-09-14 11:26:32 +05:30
Soubhik-10
b562c6d6a5 merge 2025-09-13 18:23:39 +05:30
Soubhik-10
f3091094ec merge 2025-09-13 18:13:54 +05:30
Soubhik-10
27e89becee Bring in test-ci changes 2025-09-13 18:06:01 +05:30
Soubhik-10
56b8e290a4 Revert "Test ci (#16)"
This reverts commit 692683c79a.
2025-09-13 18:04:43 +05:30
Ishika Choudhury
692683c79a Test ci (#16)
* feat: optionally disable balance check for `EthTransactionValidator` (#18086)

* feat(optimism): Launch `FlashBlockService` when websocket URL is provided in `OpEthApi` (#18077)

* feat: add NoopNetwork example (#18093)

* feat: add helper for provider with wallet (#18085)

* feat(optimism): Add `flashblocks_url` as part of rollup args of the `op-reth` CLI (#18094)

* perf(engine): only fetch headers instead of full blocks for tree tasks (#18088)

* feat(optimism): Implement conversion of `ExecutionPayloadBaseV1` into `OpNextBlockEnvAttributes` (#18097)

* feat(optimism): Remove builder of next block environment from `FlashBlockService` (#18100)

* refactor: make transaction validator functions reusable (#17929)

Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>

* feat: add module manipulation methods and RPC server arg helpers (#18084)

* chore(reth-optimism-cli): use OpTypedTransaction::eip2718_encode (#18105)

* ci: remove expected failures (#18099)

* feat: add EIP-7934 block size check to validateBuilderSubmissionV5 (#18111)

* chore: include err in log (#18119)

* fix(optimism): Prevent old pending flashblock from being returned from `pending_flashblock` (#18103)

* chore: make `caller_gas_allowance` an RPC trait method (#18101)

* fix(optimism): Fix endless poll on the FlashBlockService (#18120)

* chore: add prewarm traces (#18117)

* refactor(eth-wire): remove EthVersion::total_messages in favor of EthMessageID::max (#17999)

* fix(engine): Prevent instant miner from creating empty blocks (#18108)

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>

* perf(engine): only clone headers instead of full blocks for tree tasks (#18116)

* fix(optimism): Verify that flashblocks are not old according to canon state (#18123)

* fix: import should count on the delta (#17819)

Signed-off-by: tmel <tmel0103@gmail.com>
Signed-off-by: tmelhao <tmel0103@gmail.com>
Co-authored-by: tmel <tmel0103@gmail.com>

* feat: Forward transactions to a specified endpoint (#17444)

Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>

* feat(net): implement support of subprotocols (#18080)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fix(optimism): Fail if latest and base flashblock parent are different (#18132)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fix(txpool): ensure fee changes are updated (#18137)

* refactor: merge `EthTransactionValidator` and `EthTransactionValidatorInner` (#18129)

* docs(op): op chains don't require deposit contracts, so as dev chain (#17988)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: generalize impl EngineValidatorAddOn for OpAddOns (#18141)

* perf(engine): pre-allocate Vec capacity in payload processor (#18148)

* perf(engine): pre-allocate channel handles in prewarm task (#18147)

* chore(reth-optimism-storage): small refactor code (#18104)

* fix(trie): Fix call to update_account in witness (#18154)

* feat(optimism): add FlashblocksRx getter (#18155)

* perf(reth-invalid-block-hooks): use Reverts::eq reduce clone (#18159)

* perf(optimism): Pass noop provider to skip state root calculations for flashblocks (#18161)

* chore: Add 0x prefix and use macro (#18156)

* fix(optimism): find fb attrs in base fb (#18164)

* chore(deps): bump actions/upload-pages-artifact from 3 to 4 (#18076)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* perf: optimize single-element collection creation (#18168)

* ci: Fix .PHONY declaration for install-reth-bench target in Makefile (#18152)

* fix: correct logical error in delete_outside_range error message (#18031)

* refactor: remove unnecessary PathBuf clone in CLI help generator (#18172)

* chore: simplify dev signed tx conversions (#18171)

* chore(deps): weekly `cargo update` (#18174)

Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>

* perf(stages): optimize unwind operation by fetching headers instead full blocks (#18139)

* chore: avoid using hashmap hashers directly (#18176)

* feat: enhance engine tree metrics (#18000)

* perf(txpool): eliminate allocations in basefee enforcement (#18162)

* perf(optimism): use cached db in `FlashblockService` (#18125)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* refactor(optimism): Extract responsibility to connect to a flashblock websocket stream (#18158)

* test ci on main

* feat(examples): added txpoolExt_clearTxpool to existing example (#18175)

* fix: Pass prefix set from init_from_state_dump into compute_state_root (#18185)

* test(optimism): Cover successful decoding of websocket messages in `WsFlashBlockStream` (#18163)

* test(optimism): Cover the failure case of decoding a non-binary message in `WsFlashBlockStream` (#18166)

* test(optimism): Cover the case of stream returning errors in `WsFlashBlockStream` (#18167)

* test(optimism): Cover the case of repeatedly failing to connect to websocket in `WsFlashBlockStream` (#18169)

* dprint

* fixes

* fixes

* fix: struct serialization to match actual fields (#18189)

* test(optimism): Test that streaming flashblocks from remote source is successful (#18170)

* fixes

* fixes

* fixes

* resort

* fixes

* chore: simplify flashblocks poll logic (#18194)

Co-authored-by: julio4 <30329843+julio4@users.noreply.github.com>
Co-authored-by: Roman Hodulák <roman.hodulak@polyglot-software.com>

* fixes

* chore: impl ExecutorTx for withtxenv (#18202)

* perf: prepare flashblock txs (#18201)

Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>

* fixes

* local tar

* try fork

* try fork

* fix: spawn flashblocks service as blocking (#18214)

* fixes

* revert: "perf(txpool): eliminate allocations in basefee enforcement" (#18215)

* fix: incorrect blob fee comparison (#18216)

* fixes

* add an extra check

* add an extra check

* fix(optimism): Prevent repeated executions of current flashblock sequence (#18224)

* fixes

* try fix

* added another check

* added another check

* test(optimism): Test that sequence stops before a gap (#18228)

* feat(optimism): Warn if `FlashBlockService` has stopped (#18227)

* chore: safe None check (#18225)

* chore: improve flashblock logs (#18232)

* fix(download): use updated merkle base URL (#18236)

* fixes

* fixes

* chore(engine): add better logs and spans for execution (#18240)

* chore(trie): use instrument instead of manual span (#18239)

* fix: filter zero storage values when computing withdrawals root in genesis header (#18213)

* enable by default

* perf(reth-optimism-flashblocks): rm redundant clone (#18196)

* perf(txpool): eliminate allocations in basefee enforcement (#18218)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fixes

* docs: update urls in docs (#18245)

* feat(optimism): Respond to ping messages with pong in `WsFlashBlockStream` (#18212)

* removed one check is_some

* with new release

* test(optimism): Test that `WsFlashBlockStream` pongs a ping (#18217)

* fixes

* fixes

* chore: downgrade debug to trace  for peer reputation logs (#18250)

* feat: added amsterdam to hardforks

* use alloy config

* chore: unify engine downloader targets (#18248)

* fix(optimism): Compare parent hash and latest hash to invalidate cached flashblock (#18238)

* feat(optimism): Decode text messages in `WsFlashBlockStream` (#18257)

* chore: remove redundant payload trait bounds (#18262)

* hivd

* feat(optimism): Respond to close messages in `WsFlashBlockStream` (#18256)

* fix(optimism): Reconnect if ws stream ends in `WsFlashBlockStream` (#18226)

* test(optimism): Test that UTF-8 encoded messages are received in `WsFlashBlockStream` (#18269)

* chore: log prune settings on unwind (#18270)

* feat:db

* new tarball

* new tarball

* chore: extract `validate_against_parent_gas_limit` into separate fn (#18277)

* perf: rm redundant collect (#18281)

* fixes

* fixes

* 100

* rerun

* rerun

* rerun

* tracing

* perf: build local pending block without updates (#18271)

* perf(db): do not heap-allocate the stage key per query (#18284)

* chore(txpool): add sanity tests for blob fee bit handling (#18258)

* fix: check prune checkpoints for unwind target limit (#18263)

* perf: optimize send raw batching (#18280)

* perf: specialize single batch request (#18289)

* chore: delist unused deps with `cargo-machete` (#18259)

* test(optimism): Test that close message is responded to in `WsFlashBlockStream` (#18268)

* tracing

* fixes

* perf: specialize validate_transactions_with_origin for task validator (#18288)

* feat(metrics): add `TxPoolValidatorMetrics` to track inflight validation jobs (#18295)

* fixes

* fixes

* feat(gpo): add default fee price argument (#18297)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fixes

* feat: introduce setting for delegated txs slots (#18298)

* feat: expose `EvmEnv` to `caller_gas_allowance` (#18302)

* perf: specialize len 1 (#18307)

* trace

* chore: fix various typos in comments and documentation (#18296)

* perf(e2e-test-utils): optimize block checking by fetching header instead of full block (#18254)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: introduce maybe_pending method to StateProviderFactory (#18260)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore: clippy happy (#18310)

* more trace

* feat(download): support zst archives in reth download (#18237)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* with new types

* rerun

* rerun

* rerun

* chore: introduce validationtask with capacity (#18291)

* chore(deps): weekly `cargo update` (#18312)

Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>

* fix(rpc): error code `eth_sendRawTransactionSync` timeout (#18252)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fixes

* fixe

* fixes

* fixes

* chore(trie): dont warn on blinded node reveals (#18317)

* refactor(optimism): Extract pending block building responsibility out of `FlashBlockService` (#18247)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* rerun

* refactor: change PendingPool and PendingTransaction visibility to pub (#18267)

* refactor(engine): persistence logic (#18318)

* feat(optimism): flashblock completed sequences (#18272)

* fix

* feat(trie): Add helper sub-command (#18301)

* ci: pin Rust to 1.88 when building for Windows in Cross (#18320)

* docs(reth-bench): fix markdown (#18322)

* fix(bench): fix deadlock in test data generation (#18321)

* fix(stateless): verify_execution_witness doc for pre-state mismatch (#18319)

* fix: DB benches (#18314)

* chore: bump version 1.7.0 (#18323)

* chore: bump docs version 1.7.0 (#18326)

* docs: update public dashboards (#18331)

* chore(trie): use read-only db handle during repair-trie dry-runs (#18328)

* chore(deps): bump actions/setup-go from 5 to 6 (#18332)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/github-script from 7 to 8 (#18334)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/stale from 9 to 10 (#18335)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: cache latest built payload (#18324)

* perf(merkle-stage): only fetch checkpoint in the branch that needs it (#18339)

* fix: properly compute genesis hash (#18300)

* feat(op-reth/flashblocks): subscribe to the flashblock sequences produced (#18276)

Co-authored-by: julio4 <30329843+julio4@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* perf(reth-engine-local): use VecDeque reduce removal operations (#18198)

* fix(ci): pin teku image to fix kurtosis-op build (#18345)

* fix(stages): implement entities checkpoint update in merkle stage unwind (#18131)

* rerurn

* perf: use debug_assert for parked pool lookup (#17712)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* refactor(revm): (#18150) use hardfork activation helpers (#18349)

Co-authored-by: Waiting-Chai <1753609696@qq.com>

* feat(stateless): Run EEST tests in stateless block validator & bug fixes (#18140)

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: support customizable RPC namespace parsers (#18160)

Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>

* fix(prune): TransactionLookup pruning issues with pre-merge expiry (#18348)

* feat(op-sdk): custom precompiles (#18350)

* fix: fix search in vocs doc (#18354)

* merge

* fix

* fix: add is_osaka check before erroring in default_ethereum_payload (#18355)

* perf: optimize canonical_hashes_range with Vec::with_capacity pre-allocation + benchmark (#18072)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* feat: add some ethapi builder fns (#18358)

* fix(docs): include .vocs to retain search-index (#18363)

* feat(engine): check header validity after invalid transaction (#18356)

* fix(engine): avoid block fetching inconsistencies for checks during reorgs (#18368)

* feat: bump hive eest tests (#18013)

* fix: check payload id (#18370)

* perf(trie): Use ParallelSparseTrie (if enabled) for storage tries (#17959)

* fixes

* refactor!: more type-safety in cli (#18375)

* feat: add helper aliases for node adapters (#18366)

* fix: relax nonce gap rule if configured (#18385)

* fix(docs): disable jekyll which removes the search-index (#18388)

* fix(docs): mv search-index to dist from .vocs (#18390)

* fix: map EIP-7623 gas floor errors to expected exception type for test compatibility (#18389)

* feat: replace PendingBlockAndReceipts tuple with dedicated struct (#18395)

* fix: still use real chain id for no-op network (#18382)

* chore: use decode_2718_exact for recover raw txs (#18381)

* chore: fixed broken link in history-expiry.mdx (#18400)

* fix(e2e): persist accepted header in CheckPayloadAccepted and align timestamp (#18275)

Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>

* chore: update e2e-test-utils code owners (#18397)

* perf(db): reuse MDBX DBIs for the same tx (#18292)

* feat(txpool): break down queued transaction states into specific reasons (#18106)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* fix: dont update canon chain to ancestor for opstack (#18410)

* feat(observability): add phase-level observablity to newPayload processing  (#18308)

Co-authored-by: YK <chiayongkang@hotmail.com>
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* perf: downsize mempool tx priority from `U256` to `u128` (#18413)

* chore(storage): remove unused `primed_dbis` (#18415)

* feat: fn recovered_tx to indexedTx (#18421)

* feat: add helper to PendingBlockAndReceipts (#18423)

* refactor and cleanup

* fmt

* fixes

* clippy

* clippy

---------

Signed-off-by: 7suyash7 <suyashnyn1@gmail.com>
Signed-off-by: tmel <tmel0103@gmail.com>
Signed-off-by: tmelhao <tmel0103@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: 0xKitsune <77890308+0xKitsune@users.noreply.github.com>
Co-authored-by: Roman Hodulák <roman.hodulak@polyglot-software.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Hai | RISE <150876604+hai-rise@users.noreply.github.com>
Co-authored-by: Dharm Singh <153282211+dharmvr1@users.noreply.github.com>
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: nk_ysg <nk_ysg@163.com>
Co-authored-by: leniram159 <leniram159@gmail.com>
Co-authored-by: Andrea Simeoni <andreasimeoni84@gmail.com>
Co-authored-by: Matus Kysel <MatusKysel@users.noreply.github.com>
Co-authored-by: Suyash Nayan <89125422+7suyash7@users.noreply.github.com>
Co-authored-by: Haotian <303518297@qq.com>
Co-authored-by: tmel <tmel0103@gmail.com>
Co-authored-by: Louis Brown <48462338+louisbrown0212@users.noreply.github.com>
Co-authored-by: Max Bytefield <schoentgenaa@gmail.com>
Co-authored-by: Eric Woolsey <ewoolsey@ualberta.ca>
Co-authored-by: YK <chiayongkang@hotmail.com>
Co-authored-by: Brian Picciano <me@mediocregopher.com>
Co-authored-by: Jonas Bostoen <jonasbostoen@fastmail.com>
Co-authored-by: quantix9 <quantix9@proton.me>
Co-authored-by: Julio <30329843+julio4@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pepes <155114519+dennsikl@users.noreply.github.com>
Co-authored-by: James Niken <155266991+dizer-ti@users.noreply.github.com>
Co-authored-by: VolodymyrBg <aqdrgg19@gmail.com>
Co-authored-by: David Klank <155117116+davidjsonn@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: smileclown2024 <167074920+smileclown2024@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: Fynn <zcheng1004@gmail.com>
Co-authored-by: Soubhik-10 <soubhiksmp2004@gmail.com>
Co-authored-by: TMOT <166535397+Timosdev99@users.noreply.github.com>
Co-authored-by: Brawn <nftdropped@gmail.com>
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
Co-authored-by: Ivan Wang <wff19940326@gmail.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>
Co-authored-by: zhygis <5236121+Zygimantass@users.noreply.github.com>
Co-authored-by: Femi Bankole <llordbanks500@gmail.com>
Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Co-authored-by: kien-rise <157339831+kien-rise@users.noreply.github.com>
Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com>
Co-authored-by: radik878 <radikpadik76@gmail.com>
Co-authored-by: theo <80177219+theochap@users.noreply.github.com>
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>
Co-authored-by: かとり <SarahADavisA@gmail.com>
Co-authored-by: malik <aremumalik05@gmail.com>
Co-authored-by: Waiting-Chai <1753609696@qq.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Federico Gimenez <federico.gimenez@gmail.com>
Co-authored-by: Léa Narzis <78718413+lean-apple@users.noreply.github.com>
Co-authored-by: Rez <rez@berachain.com>
Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: Soubhik Singha Mahapatra <160333583+Soubhik-10@users.noreply.github.com>
Co-authored-by: stevencartavia <112043913+stevencartavia@users.noreply.github.com>
Co-authored-by: Cypher Pepe <125112044+cypherpepe@users.noreply.github.com>
Co-authored-by: Snezhkko <snezhkodaria38@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-13 18:00:26 +05:30
Ishika Choudhury
ab3e7ac98f refactor 2025-08-31 12:10:36 +05:30
Ishika Choudhury
d4f669f629 Merge branch 'approach1-bal-extra' of https://github.com/Rimeeeeee/reth into approach1-bal-extra 2025-08-30 13:30:25 +05:30
Ishika Choudhury
a811bacaf3 using specid 2025-08-30 13:30:01 +05:30
Soubhik-10
e9ac5d1a59 print 2025-08-30 12:16:24 +05:30
Ishika Choudhury
cbe50f5c2f fixes 2025-08-30 11:42:27 +05:30
Ishika Choudhury
be21b256b8 Merge branch 'approach1-bal-extra' of https://github.com/Rimeeeeee/reth into approach1-bal-extra 2025-08-29 17:11:34 +05:30
Ishika Choudhury
455f06e3cd fixes 2025-08-29 17:10:49 +05:30
Soubhik-10
3205700a7a added envelope v6 in here 2025-08-29 16:07:59 +05:30
Ishika Choudhury
513a04d71b fixes 2025-08-29 15:51:44 +05:30
Ishika Choudhury
ffbab127e3 fixes 2025-08-28 20:36:05 +05:30
Soubhik-10
eba128111b test 2025-08-28 20:00:48 +05:30
Soubhik-10
608b80ee41 cargo update 2025-08-28 19:50:16 +05:30
Ishika Choudhury
fd66ebc158 fixes 2025-08-28 17:22:06 +05:30
Soubhik-10
a320b422d8 add engine_getPayloadV6 2025-08-28 16:56:04 +05:30
Soubhik-10
2faac6ccf5 add engine_getPayloadV6 2025-08-28 16:02:34 +05:30
Soubhik-10
fb88af7c1c add engine_getPayloadV6 2025-08-28 15:53:44 +05:30
Ishika Choudhury
b7e306d3c1 engine payload 2025-08-28 12:04:20 +05:30
Soubhik-10
e20e17c77e merge 2025-08-25 18:15:22 +05:30
Soubhik-10
3970778f6a merge 2025-08-25 17:55:17 +05:30
Ishika Choudhury
dbeeca2e65 Merge branch 'paradigmxyz:main' into bal 2025-08-25 17:27:06 +05:30
Ishika Choudhury
7022049391 fixes 2025-08-25 17:25:30 +05:30
Ishika Choudhury
0b8b942c5d fixes 2025-08-25 17:02:56 +05:30
Ishika Choudhury
01840bc18f fixes 2025-08-24 19:07:29 +05:30
Ishika Choudhury
609a7dd2ea validation of bal_hash 2025-08-24 19:00:21 +05:30
Ishika Choudhury
f5bc91f69d with updates 2025-08-24 12:00:29 +05:30
Ishika Choudhury
1aa7ff44dc fixes 2025-08-22 11:11:46 +05:30
Ishika Choudhury
162c845fa1 book 2025-08-22 10:50:44 +05:30
Soubhik-10
2986f97a1b lint 2025-08-21 20:43:11 +05:30
Soubhik-10
1362feeef6 lint 2025-08-21 20:35:54 +05:30
Soubhik-10
be4eb84ae9 lint 2025-08-21 20:31:37 +05:30
Soubhik-10
286dc161a8 lint 2025-08-21 20:28:52 +05:30
Ishika Choudhury
984bdeb37e book on main 2025-08-21 17:18:03 +05:30
Ishika Choudhury
43e74235cf fixes 2025-08-21 17:16:20 +05:30
Ishika Choudhury
c846db2af6 fixes 2025-08-21 12:51:13 +05:30
Soubhik-10
b0af2848c3 rm test 2025-08-21 12:02:37 +05:30
Ishika Choudhury
522ad9a508 fixes 2025-08-21 11:36:37 +05:30
Ishika Choudhury
3cbf46c0c3 fixes 2025-08-21 11:25:55 +05:30
Soubhik-10
cc83bfb7f1 new patch 2025-08-21 11:00:54 +05:30
Ishika Choudhury
582ba3b810 fixes 2025-08-18 22:57:36 +05:30
Ishika Choudhury
9b2d6c89ac fixes 2025-08-18 22:20:49 +05:30
Ishika Choudhury
a5e42e8d29 modfied assemble block 2025-08-18 20:53:33 +05:30
Ishika Choudhury
e4cd20aa4b fixes 2025-08-18 20:32:47 +05:30
Soubhik-10
25e8b03a22 patch 2025-08-18 19:44:15 +05:30
Soubhik-10
28d2c7982a patch 2025-08-18 19:31:37 +05:30
Soubhik-10
6c37352e6c fixes 2025-08-16 17:45:49 +05:30
Soubhik-10
67c37d0a9c cargo update 2025-08-16 17:06:38 +05:30
Ishika Choudhury
94f996ae8a feat: approach 1 for bal build 2025-08-16 17:02:35 +05:30
Soubhik Singha Mahapatra
57654fd2aa Merge branch 'paradigmxyz:main' into bal 2025-08-10 11:09:42 +05:30
Ishika Choudhury
3275939438 feat: eip7928 patches (#11)
* eip7928 patches

* fixes

* fixes

* msrv
2025-08-10 11:09:11 +05:30
Ishika Choudhury
f3e353a0a6 fix: ci workflow (#12)
* fixes: ci workflow

* ci

---------

Co-authored-by: Soubhik-10 <soubhiksmp2004@gmail.com>
2025-08-09 12:35:52 +05:30
Ishika Choudhury
e1a42b815c Merge branch 'paradigmxyz:main' into bal 2025-08-07 16:03:24 +05:30
Ishika Choudhury
a66a9df95f Merge branch 'paradigmxyz:main' into bal 2025-07-14 21:50:01 +05:30
Soubhik Singha Mahapatra
f4d64fbf64 Merge branch 'paradigmxyz:main' into bal 2025-07-08 19:04:50 +05:30
Ishika Choudhury
f72a467468 Merge branch 'paradigmxyz:main' into bal 2025-07-08 10:38:35 +05:30
Soubhik Singha Mahapatra
3cbb9a90e5 chore: upstreamed to alloy (#7)
* upstreamed to alloy

* upstreamed to alloy
2025-07-06 18:38:59 +05:30
Soubhik Singha Mahapatra
8da02d7f38 Merge branch 'paradigmxyz:main' into bal 2025-07-06 17:42:46 +05:30
Ishika Choudhury
29e9696ff4 feat: added remaining core structs and minor refactor (#5) 2025-07-06 16:47:46 +05:30
Soubhik Singha Mahapatra
1b797c97a5 feat: added Storage structs as per eip (#4)
* feat: added storage structs as per eip

* clippy

---------

Co-authored-by: Ishika Choudhury <117741714+Rimeeeeee@users.noreply.github.com>
2025-07-06 12:53:23 +05:30
Ishika Choudhury
194d8b6c36 feat: added BalanceChange and CodeChange for BAL (#3)
* feat: added BalanceChange and CodeChange for BAL

* fixes
2025-07-06 12:32:32 +05:30
Ishika Choudhury
b527e56e00 added toml (#2) 2025-07-06 11:12:21 +05:30
Ishika Choudhury
e1b0884bab feat: intial commit for eip-7928 2025-07-05 20:25:27 +05:30
316 changed files with 3082 additions and 7760 deletions

View File

@@ -12,7 +12,7 @@ workflows:
# Check that `A` activates the features of `B`.
"propagate-feature",
# These are the features to check:
"--features=std,op,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench,alloy-compat,min-error-logs,min-warn-logs,min-info-logs,min-debug-logs,min-trace-logs,otlp,js-tracer,portable,keccak-cache-global",
"--features=std,op,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench,alloy-compat,min-error-logs,min-warn-logs,min-info-logs,min-debug-logs,min-trace-logs,otlp,js-tracer,portable",
# Do not try to add a new section to `[features]` of `A` only because `B` exposes that feature. There are edge-cases where this is still needed, but we can add them manually.
"--left-side-feature-missing=ignore",
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.

View File

@@ -11,14 +11,17 @@ go build .
# Run each hive command in the background for each simulator and wait
echo "Building images"
# TODO: test code has been moved from https://github.com/ethereum/execution-spec-tests to https://github.com/ethereum/execution-specs we need to pin eels branch with `--sim.buildarg branch=<release-branch-name>` once we have the fusaka release tagged on the new repo
./hive -client reth --sim "ethereum/eels" --sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/v5.3.0/fixtures_develop.tar.gz -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/eels" \
--sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/bal@v1.8.0/fixtures_bal.tar.gz \
--sim.buildarg branch=eips/amsterdam/eip-7928 \
--sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/engine" -sim.timelimit 1s || true &
./hive -client reth --sim "devp2p" -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/rpc-compat" -sim.timelimit 1s || true &
./hive -client reth --sim "smoke/genesis" -sim.timelimit 1s || true &
./hive -client reth --sim "smoke/network" -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/sync" -sim.timelimit 1s || true &
wait
# Run docker save in parallel, wait and exit on error
@@ -37,7 +40,7 @@ for pid in "${saving_pids[@]}"; do
wait "$pid" || exit
done
# Make sure we don't rebuild images on the CI jobs
# Make sure we don't rebuild images on the CI jobs
git apply ../.github/assets/hive/no_sim_build.diff
go build .
mv ./hive ../hive_assets/

View File

@@ -24,4 +24,4 @@ done
wait
docker image ls -a
docker image ls -a

View File

@@ -7,7 +7,7 @@ sim="${1}"
limit="${2}"
run_hive() {
hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 16 --client reth 2>&1 | tee /tmp/log || true
hive --sim "${sim}" --sim.limit "${limit}" --sim.parallelism 8 --client reth 2>&1 | tee /tmp/log || true
}
check_log() {

View File

@@ -3,15 +3,14 @@
on:
pull_request:
# TODO: Disabled temporarily for https://github.com/CodSpeedHQ/runner/issues/55
# merge_group:
# merge_group :
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
BASELINE: base
SEED: reth
RUSTC_WRAPPER: "sccache"
name: bench
jobs:
@@ -23,7 +22,6 @@ jobs:
submodules: true
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -10,12 +10,9 @@ on:
types: [opened, reopened, synchronize, closed]
merge_group:
env:
RUSTC_WRAPPER: "sccache"
jobs:
build:
runs-on: depot-ubuntu-latest-8
runs-on: depot-ubuntu-latest-16
timeout-minutes: 90
steps:
- name: Checkout
@@ -36,8 +33,6 @@ jobs:
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Build docs
run: cd docs/vocs && bash scripts/build-cargo-docs.sh
@@ -74,4 +69,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4

View File

@@ -9,16 +9,15 @@ on:
pull_request:
merge_group:
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: "sccache"
name: compact-codec
jobs:
compact-codec:
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
strategy:
matrix:
bin:
@@ -27,7 +26,6 @@ jobs:
steps:
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -6,12 +6,11 @@ on:
pull_request:
merge_group:
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
SEED: rustethereumethereumrust
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -20,14 +19,13 @@ concurrency:
jobs:
test:
name: e2e-testsuite
runs-on: depot-ubuntu-latest-4
runs-on: depot-ubuntu-latest-16
env:
RUST_BACKTRACE: 1
timeout-minutes: 90
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v2
with:

View File

@@ -6,7 +6,9 @@ on:
workflow_dispatch:
schedule:
- cron: "0 */6 * * *"
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
@@ -24,13 +26,14 @@ jobs:
prepare-hive:
if: github.repository == 'paradigmxyz/reth'
timeout-minutes: 45
runs-on: depot-ubuntu-latest-16
runs-on: depot-ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Checkout hive tests
uses: actions/checkout@v6
with:
repository: ethereum/hive
ref: master
path: hivetests
- name: Get hive commit hash
@@ -44,7 +47,7 @@ jobs:
- name: Restore hive assets cache
id: cache-hive
uses: actions/cache@v5
uses: actions/cache@v4
with:
path: ./hive_assets
key: hive-assets-${{ steps.hive-commit.outputs.hash }}-${{ hashFiles('.github/assets/hive/build_simulators.sh') }}
@@ -67,7 +70,7 @@ jobs:
chmod +x hive
- name: Upload hive assets
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v4
with:
name: hive_assets
path: ./hive_assets
@@ -115,27 +118,29 @@ jobs:
# eth_ rpc methods
- sim: ethereum/rpc-compat
include:
- eth_blockNumber
# - eth_blockNumber
- eth_call
- eth_chainId
- eth_createAccessList
- eth_estimateGas
- eth_feeHistory
- eth_getBalance
- eth_getBlockBy
- eth_getBlockTransactionCountBy
- eth_getCode
- eth_getProof
- eth_getStorage
- eth_getTransactionBy
- eth_getTransactionCount
- eth_getTransactionReceipt
- eth_sendRawTransaction
- eth_syncing
# debug_ rpc methods
- debug_
# - eth_chainId
# - eth_createAccessList
# - eth_estimateGas
# - eth_feeHistory
# - eth_getBalance
# - eth_getBlockBy
# - eth_getBlockTransactionCountBy
# - eth_getCode
# - eth_getProof
# - eth_getStorage
# - eth_getTransactionBy
# - eth_getTransactionCount
# - eth_getTransactionReceipt
# - eth_sendRawTransaction
# - eth_syncing
# # debug_ rpc methods
# - debug_
# consume-engine
- sim: ethereum/eels/consume-engine
limit: .*tests/amsterdam.*
- sim: ethereum/eels/consume-engine
limit: .*tests/osaka.*
- sim: ethereum/eels/consume-engine
@@ -152,10 +157,10 @@ jobs:
limit: .*tests/homestead.*
- sim: ethereum/eels/consume-engine
limit: .*tests/frontier.*
- sim: ethereum/eels/consume-engine
limit: .*tests/paris.*
# consume-rlp
- sim: ethereum/eels/consume-rlp
limit: .*tests/amsterdam.*
- sim: ethereum/eels/consume-rlp
limit: .*tests/osaka.*
- sim: ethereum/eels/consume-rlp
@@ -172,13 +177,11 @@ jobs:
limit: .*tests/homestead.*
- sim: ethereum/eels/consume-rlp
limit: .*tests/frontier.*
- sim: ethereum/eels/consume-rlp
limit: .*tests/paris.*
needs:
- prepare-reth
- prepare-hive
name: run ${{ matrix.scenario.sim }}${{ matrix.scenario.limit && format(' - {0}', matrix.scenario.limit) }}
runs-on: depot-ubuntu-latest-16
runs-on: depot-ubuntu-latest
permissions:
issues: write
steps:
@@ -187,13 +190,13 @@ jobs:
fetch-depth: 0
- name: Download hive assets
uses: actions/download-artifact@v7
uses: actions/download-artifact@v5
with:
name: hive_assets
path: /tmp
- name: Download reth image
uses: actions/download-artifact@v7
uses: actions/download-artifact@v5
with:
name: artifacts
path: /tmp
@@ -245,7 +248,7 @@ jobs:
notify-on-error:
needs: test
if: failure()
runs-on: ubuntu-latest
runs-on: depot-ubuntu-latest
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2

View File

@@ -6,7 +6,7 @@ on:
pull_request:
merge_group:
push:
branches: [main]
branches: ["**"]
schedule:
# Run once a day at 3:00 UTC
- cron: "0 3 * * *"
@@ -14,7 +14,6 @@ on:
env:
CARGO_TERM_COLOR: always
SEED: rustethereumethereumrust
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -24,7 +23,7 @@ jobs:
test:
name: test / ${{ matrix.network }}
if: github.event_name != 'schedule'
runs-on: depot-ubuntu-latest-4
runs-on: depot-ubuntu-latest-16
env:
RUST_BACKTRACE: 1
strategy:
@@ -38,7 +37,6 @@ jobs:
- name: Install Geth
run: .github/assets/install_geth.sh
- uses: taiki-e/install-action@nextest
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -76,7 +74,6 @@ jobs:
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -41,7 +41,7 @@ jobs:
fetch-depth: 0
- name: Download reth image
uses: actions/download-artifact@v7
uses: actions/download-artifact@v6
with:
name: artifacts
path: /tmp
@@ -85,7 +85,7 @@ jobs:
notify-on-error:
needs: test
if: failure()
runs-on: ubuntu-latest
runs-on: depot-ubuntu-latest
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2

View File

@@ -39,7 +39,7 @@ jobs:
fetch-depth: 0
- name: Download reth image
uses: actions/download-artifact@v7
uses: actions/download-artifact@v6
with:
name: artifacts
path: /tmp
@@ -58,7 +58,7 @@ jobs:
notify-on-error:
needs: test
if: failure()
runs-on: ubuntu-latest
runs-on: depot-ubuntu-latest
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2

View File

@@ -4,11 +4,10 @@ on:
pull_request:
merge_group:
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: "sccache"
jobs:
clippy-binaries:
@@ -27,7 +26,6 @@ jobs:
- uses: dtolnay/rust-toolchain@clippy
with:
components: clippy
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -42,7 +40,7 @@ jobs:
clippy:
name: clippy
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
@@ -50,7 +48,6 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -68,7 +65,6 @@ jobs:
with:
target: wasm32-wasip1
- uses: taiki-e/install-action@cargo-hack
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -88,7 +84,6 @@ jobs:
with:
target: riscv32imac-unknown-none-elf
- uses: taiki-e/install-action@cargo-hack
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -98,18 +93,17 @@ jobs:
crate-checks:
name: crate-checks (${{ matrix.partition }}/${{ matrix.total_partitions }})
runs-on: depot-ubuntu-latest-4
runs-on: depot-ubuntu-latest-16
strategy:
matrix:
partition: [1, 2, 3]
total_partitions: [3]
partition: [1, 2]
total_partitions: [2]
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -130,7 +124,6 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.88" # MSRV
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -140,13 +133,12 @@ jobs:
docs:
name: docs
runs-on: depot-ubuntu-latest-4
runs-on: depot-ubuntu-latest-16
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -166,19 +158,17 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Run fmt
run: cargo fmt --all --check
udeps:
name: udeps
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -187,13 +177,12 @@ jobs:
book:
name: book
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@nightly
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -245,14 +234,17 @@ jobs:
# Checks that selected crates can compile with power set of features
features:
name: features
runs-on: depot-ubuntu-latest
name: features (${{ matrix.partition }}/${{ matrix.total_partitions }})
runs-on: depot-ubuntu-latest-16
strategy:
matrix:
partition: [1, 2]
total_partitions: [2]
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@clippy
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -264,7 +256,7 @@ jobs:
--package reth-primitives-traits \
--package reth-primitives \
--feature-powerset \
--depth 2
--partition ${{ matrix.partition }}/${{ matrix.total_partitions }}
env:
RUSTFLAGS: -D warnings
@@ -275,7 +267,6 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: rui314/setup-mold@v1
- uses: taiki-e/cache-cargo-install-action@v2
with:

View File

@@ -50,7 +50,7 @@ jobs:
- name: Upload reth image
id: upload
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v5
with:
name: artifacts
path: ./artifacts

View File

@@ -22,7 +22,6 @@ env:
CARGO_TERM_COLOR: always
DOCKER_IMAGE_NAME_URL: https://ghcr.io/${{ github.repository_owner }}/reth
DOCKER_OP_IMAGE_NAME_URL: https://ghcr.io/${{ github.repository_owner }}/op-reth
RUSTC_WRAPPER: "sccache"
jobs:
dry-run:
@@ -52,7 +51,6 @@ jobs:
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Verify crate version matches tag
# Check that the Cargo version starts with the tag,
# so that Cargo version 1.4.8 can be matched against both v1.4.8 and v1.4.8-rc.1
@@ -106,7 +104,6 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.configs.target }}
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Install cross main
id: cross_main
run: |
@@ -144,14 +141,14 @@ jobs:
- name: Upload artifact
if: ${{ github.event.inputs.dry_run != 'true' }}
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz
path: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz
- name: Upload signature
if: ${{ github.event.inputs.dry_run != 'true' }}
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz.asc
path: ${{ matrix.build.binary }}-${{ needs.extract-version.outputs.VERSION }}-${{ matrix.configs.target }}.tar.gz.asc
@@ -173,7 +170,7 @@ jobs:
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v7
uses: actions/download-artifact@v6
- name: Generate full changelog
id: changelog
run: |

View File

@@ -42,7 +42,7 @@ jobs:
echo "Binaries SHA256 on ${{ matrix.machine }}: $(cat checksum.sha256)"
- name: Upload the hash
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v5
with:
name: checksum-${{ matrix.machine }}
path: |
@@ -55,12 +55,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download artifacts from machine-1
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
with:
name: checksum-machine-1
path: machine-1/
- name: Download artifacts from machine-2
uses: actions/download-artifact@v7
uses: actions/download-artifact@v4
with:
name: checksum-machine-2
path: machine-2/

View File

@@ -6,13 +6,12 @@ on:
pull_request:
merge_group:
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
FROM_BLOCK: 0
TO_BLOCK: 50000
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -32,7 +31,6 @@ jobs:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -9,7 +9,6 @@ on:
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -42,7 +41,6 @@ jobs:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -9,7 +9,6 @@ on:
env:
CARGO_TERM_COLOR: always
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -42,7 +41,6 @@ jobs:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -4,14 +4,14 @@ name: unit
on:
pull_request:
branches: ["**"]
merge_group:
push:
branches: [main]
branches: ["**"]
env:
CARGO_TERM_COLOR: always
SEED: rustethereumethereumrust
RUSTC_WRAPPER: "sccache"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -20,7 +20,7 @@ concurrency:
jobs:
test:
name: test / ${{ matrix.type }} (${{ matrix.partition }}/${{ matrix.total_partitions }})
runs-on: depot-ubuntu-latest-4
runs-on: depot-ubuntu-latest-16
env:
RUST_BACKTRACE: 1
strategy:
@@ -47,7 +47,6 @@ jobs:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -93,7 +92,6 @@ jobs:
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@nextest
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -101,7 +99,7 @@ jobs:
doc:
name: doc tests
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
env:
RUST_BACKTRACE: 1
timeout-minutes: 30
@@ -109,7 +107,6 @@ jobs:
- uses: actions/checkout@v6
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

View File

@@ -27,7 +27,7 @@ jobs:
./fetch_superchain_config.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: update superchain config"
title: "chore: update superchain config"

View File

@@ -4,17 +4,14 @@ name: windows
on:
push:
branches: [main]
branches: ["**"]
pull_request:
branches: [main]
branches: ["**"]
merge_group:
env:
RUSTC_WRAPPER: "sccache"
jobs:
check-reth:
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
timeout-minutes: 60
steps:
@@ -24,7 +21,6 @@ jobs:
with:
target: x86_64-pc-windows-gnu
- uses: taiki-e/install-action@cross
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
@@ -34,7 +30,7 @@ jobs:
run: cargo check --target x86_64-pc-windows-gnu
check-op-reth:
runs-on: depot-ubuntu-latest
runs-on: depot-ubuntu-latest-16
timeout-minutes: 60
steps:
@@ -44,7 +40,6 @@ jobs:
with:
target: x86_64-pc-windows-gnu
- uses: taiki-e/install-action@cross
- uses: mozilla-actions/sccache-action@v0.0.9
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

249
Cargo.lock generated
View File

@@ -113,8 +113,7 @@ dependencies = [
[[package]]
name = "alloy-consensus"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e318e25fb719e747a7e8db1654170fc185024f3ed5b10f86c08d448a912f6e2"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -141,8 +140,7 @@ dependencies = [
[[package]]
name = "alloy-consensus-any"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "364380a845193a317bcb7a5398fc86cdb66c47ebe010771dde05f6869bf9e64a"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -156,8 +154,7 @@ dependencies = [
[[package]]
name = "alloy-contract"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d39c80ffc806f27a76ed42f3351a455f3dc4f81d6ff92c8aad2cf36b7d3a34"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-dyn-abi",
@@ -241,11 +238,11 @@ dependencies = [
[[package]]
name = "alloy-eip7928"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "926b2c0d34e641cf8b17bf54ce50fda16715b9f68ad878fa6128bae410c6f890"
source = "git+https://github.com/alloy-rs/eips.git#2197bdb48ae842b00f43b2cb29d59f20b29ec419"
dependencies = [
"alloy-primitives",
"alloy-rlp",
"arbitrary",
"borsh",
"serde",
]
@@ -253,12 +250,12 @@ dependencies = [
[[package]]
name = "alloy-eips"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c4d7c5839d9f3a467900c625416b24328450c65702eb3d8caff8813e4d1d33"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-eip2124",
"alloy-eip2930",
"alloy-eip7702",
"alloy-eip7928",
"alloy-primitives",
"alloy-rlp",
"alloy-serde",
@@ -278,9 +275,8 @@ dependencies = [
[[package]]
name = "alloy-evm"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6ccc4c702c840148af1ce784cc5c6ed9274a020ef32417c5b1dbeab8c317673"
version = "0.24.2"
source = "git+https://github.com/Rimeeeeee/evm?branch=new-approach4#2b07037ef61397244f23fa832aee8e593a840201"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -296,13 +292,13 @@ dependencies = [
"op-revm",
"revm",
"thiserror 2.0.17",
"tracing",
]
[[package]]
name = "alloy-genesis"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ba4b1be0988c11f0095a2380aa596e35533276b8fa6c9e06961bbfe0aebcac5"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -329,9 +325,9 @@ dependencies = [
[[package]]
name = "alloy-json-abi"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bfca3dbbcb7498f0f60e67aff2ad6aff57032e22eb2fd03189854be11a22c03"
checksum = "5513d5e6bd1cba6bdcf5373470f559f320c05c8c59493b6e98912fbe6733943f"
dependencies = [
"alloy-primitives",
"alloy-sol-type-parser",
@@ -342,8 +338,7 @@ dependencies = [
[[package]]
name = "alloy-json-rpc"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f72cf87cda808e593381fb9f005ffa4d2475552b7a6c5ac33d087bf77d82abd0"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"alloy-sol-types",
@@ -357,8 +352,7 @@ dependencies = [
[[package]]
name = "alloy-network"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12aeb37b6f2e61b93b1c3d34d01ee720207c76fe447e2a2c217e433ac75b17f5"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-consensus-any",
@@ -383,8 +377,7 @@ dependencies = [
[[package]]
name = "alloy-network-primitives"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abd29ace62872083e30929cd9b282d82723196d196db589f3ceda67edcc05552"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -395,9 +388,8 @@ dependencies = [
[[package]]
name = "alloy-op-evm"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f640da852f93ddaa3b9a602b7ca41d80e0023f77a67b68aaaf511c32f1fe0ce"
version = "0.24.2"
source = "git+https://github.com/Rimeeeeee/evm?branch=new-approach4#2b07037ef61397244f23fa832aee8e593a840201"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -426,12 +418,13 @@ dependencies = [
[[package]]
name = "alloy-primitives"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c850e6ccbd34b8a463a1e934ffc8fc00e1efc5e5489f2ad82d7797949f3bd4e"
checksum = "355bf68a433e0fd7f7d33d5a9fc2583fde70bf5c530f63b80845f8da5505cf28"
dependencies = [
"alloy-rlp",
"arbitrary",
"borsh",
"bytes",
"cfg-if",
"const-hex",
@@ -447,7 +440,6 @@ dependencies = [
"proptest",
"proptest-derive 0.6.0",
"rand 0.9.2",
"rapidhash",
"ruint",
"rustc-hash",
"serde",
@@ -458,8 +450,7 @@ dependencies = [
[[package]]
name = "alloy-provider"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b710636d7126e08003b8217e24c09f0cca0b46d62f650a841736891b1ed1fc1"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-chains",
"alloy-consensus",
@@ -503,8 +494,7 @@ dependencies = [
[[package]]
name = "alloy-pubsub"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdd4c64eb250a18101d22ae622357c6b505e158e9165d4c7974d59082a600c5e"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-json-rpc",
"alloy-primitives",
@@ -547,8 +537,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-client"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0882e72d2c1c0c79dcf4ab60a67472d3f009a949f774d4c17d0bdb669cfde05"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-json-rpc",
"alloy-primitives",
@@ -573,8 +562,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cf1398cb33aacb139a960fa3d8cf8b1202079f320e77e952a0b95967bf7a9f"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"alloy-rpc-types-engine",
@@ -586,8 +574,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-admin"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65a583d2029b171301f5dcf122aa2ef443a65a373778ec76540d999691ae867d"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-genesis",
"alloy-primitives",
@@ -598,8 +585,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-anvil"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3ce4c24e416bd0f17fceeb2f26cd8668df08fe19e1dc02f9d41c3b8ed1e93e0"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"alloy-rpc-types-eth",
@@ -610,8 +596,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-any"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a63fb40ed24e4c92505f488f9dd256e2afaed17faa1b7a221086ebba74f4122"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus-any",
"alloy-rpc-types-eth",
@@ -621,8 +606,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-beacon"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16633087e23d8d75161c3a59aa183203637b817a5a8d2f662f612ccb6d129af0"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-eips",
"alloy-primitives",
@@ -641,8 +625,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-debug"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4936f579d9d10eae01772b2ab3497f9d568684f05f26f8175e12f9a1a2babc33"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"derive_more",
@@ -653,8 +636,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-engine"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c60bdce3be295924122732b7ecd0b2495ce4790bedc5370ca7019c08ad3f26e"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -674,8 +656,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-eth"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9eae0c7c40da20684548cbc8577b6b7447f7bf4ddbac363df95e3da220e41e72"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-consensus-any",
@@ -696,8 +677,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-mev"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81c0dd81c24944cfbf45b5df7cd149d9cd3e354db81ccf08aa47e0e05be8ab97"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -711,8 +691,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-trace"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef206a4b8d436fbb7cf2e6a61c692d11df78f9382becc3c9a283bd58e64f0583"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"alloy-rpc-types-eth",
@@ -725,8 +704,7 @@ dependencies = [
[[package]]
name = "alloy-rpc-types-txpool"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecb5a795264a02222f9534435b8f40dcbd88de8e9d586647884aae24f389ebf2"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"alloy-rpc-types-eth",
@@ -737,8 +715,7 @@ dependencies = [
[[package]]
name = "alloy-serde"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0df1987ed0ff2d0159d76b52e7ddfc4e4fbddacc54d2fbee765e0d14d7c01b5"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"arbitrary",
@@ -749,8 +726,7 @@ dependencies = [
[[package]]
name = "alloy-signer"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ff69deedee7232d7ce5330259025b868c5e6a52fa8dffda2c861fb3a5889b24"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-primitives",
"async-trait",
@@ -764,8 +740,7 @@ dependencies = [
[[package]]
name = "alloy-signer-local"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72cfe0be3ec5a8c1a46b2e5a7047ed41121d360d97f4405bb7c1c784880c86cb"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-consensus",
"alloy-network",
@@ -782,9 +757,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2218e3aeb3ee665d117fdf188db0d5acfdc3f7b7502c827421cb78f26a2aec0"
checksum = "f3ce480400051b5217f19d6e9a82d9010cdde20f1ae9c00d53591e4a1afbb312"
dependencies = [
"alloy-sol-macro-expander",
"alloy-sol-macro-input",
@@ -796,9 +771,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro-expander"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b231cb8cc48e66dd1c6e11a1402f3ac86c3667cbc13a6969a0ac030ba7bb8c88"
checksum = "6d792e205ed3b72f795a8044c52877d2e6b6e9b1d13f431478121d8d4eaa9028"
dependencies = [
"alloy-sol-macro-input",
"const-hex",
@@ -814,9 +789,9 @@ dependencies = [
[[package]]
name = "alloy-sol-macro-input"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49a522d79929c1bf0152b07567a38f7eaed3ab149e53e7528afa78ff11994668"
checksum = "0bd1247a8f90b465ef3f1207627547ec16940c35597875cdc09c49d58b19693c"
dependencies = [
"const-hex",
"dunce",
@@ -830,9 +805,9 @@ dependencies = [
[[package]]
name = "alloy-sol-type-parser"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0475c459859c8d9428af6ff3736614655a57efda8cc435a3b8b4796fa5ac1dd0"
checksum = "954d1b2533b9b2c7959652df3076954ecb1122a28cc740aa84e7b0a49f6ac0a9"
dependencies = [
"serde",
"winnow",
@@ -840,9 +815,9 @@ dependencies = [
[[package]]
name = "alloy-sol-types"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35287d9d821d5f26011bcd8d9101340898f761c9933cf50fca689bb7ed62fdeb"
checksum = "70319350969a3af119da6fb3e9bddb1bce66c9ea933600cb297c8b1850ad2a3c"
dependencies = [
"alloy-json-abi",
"alloy-primitives",
@@ -853,8 +828,7 @@ dependencies = [
[[package]]
name = "alloy-transport"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be98b07210d24acf5b793c99b759e9a696e4a2e67593aec0487ae3b3e1a2478c"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-json-rpc",
"auto_impl",
@@ -876,8 +850,7 @@ dependencies = [
[[package]]
name = "alloy-transport-http"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4198a1ee82e562cab85e7f3d5921aab725d9bd154b6ad5017f82df1695877c97"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-json-rpc",
"alloy-transport",
@@ -891,8 +864,7 @@ dependencies = [
[[package]]
name = "alloy-transport-ipc"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8db249779ebc20dc265920c7e706ed0d31dbde8627818d1cbde60919b875bb0"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-json-rpc",
"alloy-pubsub",
@@ -911,8 +883,7 @@ dependencies = [
[[package]]
name = "alloy-transport-ws"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ad2344a12398d7105e3722c9b7a7044ea837128e11d453604dec6e3731a86e2"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"alloy-pubsub",
"alloy-transport",
@@ -949,8 +920,7 @@ dependencies = [
[[package]]
name = "alloy-tx-macros"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "333544408503f42d7d3792bfc0f7218b643d968a03d2c0ed383ae558fb4a76d0"
source = "git+https://github.com/Soubhik-10/alloy?branch=bal#34c5b093a4a9e889634c1c20de5365bb6a7477ef"
dependencies = [
"darling 0.21.3",
"proc-macro2",
@@ -1382,9 +1352,9 @@ dependencies = [
[[package]]
name = "async-compression"
version = "0.4.36"
version = "0.4.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98ec5f6c2f8bc326c994cb9e241cc257ddaba9afa8555a43cffbb5dd86efaa37"
checksum = "07a926debf178f2d355197f9caddb08e54a9329d44748034bba349c5848cb519"
dependencies = [
"compression-codecs",
"compression-core",
@@ -2390,9 +2360,9 @@ dependencies = [
[[package]]
name = "compression-codecs"
version = "0.4.35"
version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0f7ac3e5b97fdce45e8922fb05cae2c37f7bbd63d30dd94821dacfd8f3f2bf2"
checksum = "34a3cbbb8b6eca96f3a5c4bf6938d5b27ced3675d69f95bb51948722870bc323"
dependencies = [
"brotli",
"compression-core",
@@ -6212,9 +6182,9 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "op-alloy"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9b8fee21003dd4f076563de9b9d26f8c97840157ef78593cd7f262c5ca99848"
checksum = "c3b13412d297c1f9341f678b763750b120a73ffe998fa54a94d6eda98449e7ca"
dependencies = [
"op-alloy-consensus",
"op-alloy-network",
@@ -6225,9 +6195,9 @@ dependencies = [
[[package]]
name = "op-alloy-consensus"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "736381a95471d23e267263cfcee9e1d96d30b9754a94a2819148f83379de8a86"
checksum = "726da827358a547be9f1e37c2a756b9e3729cb0350f43408164794b370cad8ae"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -6251,9 +6221,9 @@ checksum = "a79f352fc3893dcd670172e615afef993a41798a1d3fc0db88a3e60ef2e70ecc"
[[package]]
name = "op-alloy-network"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4034183dca6bff6632e7c24c92e75ff5f0eabb58144edb4d8241814851334d47"
checksum = "f63f27e65be273ec8fcb0b6af0fd850b550979465ab93423705ceb3dfddbd2ab"
dependencies = [
"alloy-consensus",
"alloy-network",
@@ -6267,9 +6237,9 @@ dependencies = [
[[package]]
name = "op-alloy-provider"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6753d90efbaa8ea8bcb89c1737408ca85fa60d7adb875049d3f382c063666f86"
checksum = "a71456699aa256dc20119736422ad9a44da8b9585036117afb936778122093b9"
dependencies = [
"alloy-network",
"alloy-primitives",
@@ -6282,9 +6252,9 @@ dependencies = [
[[package]]
name = "op-alloy-rpc-jsonrpsee"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1c820ef9c802ebc732281a940bfb6ac2345af4d9fff041cbb64b4b546676686"
checksum = "8ef9114426b16172254555aad34a8ea96c01895e40da92f5d12ea680a1baeaa7"
dependencies = [
"alloy-primitives",
"jsonrpsee",
@@ -6292,9 +6262,9 @@ dependencies = [
[[package]]
name = "op-alloy-rpc-types"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddd87c6b9e5b6eee8d6b76f41b04368dca0e9f38d83338e5b00e730c282098a4"
checksum = "562dd4462562c41f9fdc4d860858c40e14a25df7f983ae82047f15f08fce4d19"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -6312,9 +6282,9 @@ dependencies = [
[[package]]
name = "op-alloy-rpc-types-engine"
version = "0.23.1"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77727699310a18cdeed32da3928c709e2704043b6584ed416397d5da65694efc"
checksum = "d8f24b8cb66e4b33e6c9e508bf46b8ecafc92eadd0b93fedd306c0accb477657"
dependencies = [
"alloy-consensus",
"alloy-eips",
@@ -6328,7 +6298,6 @@ dependencies = [
"ethereum_ssz_derive",
"op-alloy-consensus",
"serde",
"sha2",
"snap",
"thiserror 2.0.17",
]
@@ -6354,8 +6323,7 @@ dependencies = [
[[package]]
name = "op-revm"
version = "14.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1475a779c73999fc803778524042319691b31f3d6699d2b560c4ed8be1db802a"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"auto_impl",
"revm",
@@ -7210,16 +7178,6 @@ dependencies = [
"rand_core 0.9.3",
]
[[package]]
name = "rapidhash"
version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8e65c75143ce5d47c55b510297eeb1182f3c739b6043c537670e9fc18612dae"
dependencies = [
"rand 0.9.2",
"rustversion",
]
[[package]]
name = "ratatui"
version = "0.29.0"
@@ -7805,11 +7763,13 @@ dependencies = [
"alloy-consensus",
"alloy-eips",
"alloy-primitives",
"alloy-rlp",
"rand 0.9.2",
"reth-chainspec",
"reth-consensus",
"reth-ethereum-primitives",
"reth-primitives-traits",
"tracing",
]
[[package]]
@@ -8231,7 +8191,6 @@ name = "reth-engine-tree"
version = "1.9.3"
dependencies = [
"alloy-consensus",
"alloy-eip7928",
"alloy-eips",
"alloy-evm",
"alloy-primitives",
@@ -8318,6 +8277,7 @@ dependencies = [
"reth-primitives-traits",
"reth-revm",
"reth-storage-api",
"revm",
"serde",
"serde_json",
"tokio",
@@ -8533,6 +8493,7 @@ dependencies = [
"alloy-consensus",
"alloy-eips",
"alloy-primitives",
"alloy-rlp",
"reth-chainspec",
"reth-consensus",
"reth-consensus-common",
@@ -8650,7 +8611,6 @@ dependencies = [
"derive_more",
"futures-util",
"metrics",
"rayon",
"reth-ethereum-forks",
"reth-ethereum-primitives",
"reth-execution-errors",
@@ -8672,6 +8632,7 @@ dependencies = [
"alloy-evm",
"alloy-genesis",
"alloy-primitives",
"alloy-rlp",
"alloy-rpc-types-engine",
"derive_more",
"parking_lot",
@@ -8956,7 +8917,6 @@ dependencies = [
"pin-project",
"rand 0.8.5",
"rand 0.9.2",
"rayon",
"reth-chainspec",
"reth-consensus",
"reth-discv4",
@@ -9258,7 +9218,6 @@ dependencies = [
"alloy-sol-types",
"eyre",
"futures",
"jsonrpsee-core",
"rand 0.9.2",
"reth-chainspec",
"reth-db",
@@ -9294,7 +9253,6 @@ dependencies = [
"serde",
"serde_json",
"similar-asserts",
"tempfile",
"tokio",
]
@@ -10185,7 +10143,6 @@ dependencies = [
"reth-db-api",
"reth-engine-primitives",
"reth-errors",
"reth-ethereum-engine-primitives",
"reth-ethereum-primitives",
"reth-evm",
"reth-evm-ethereum",
@@ -10248,9 +10205,6 @@ dependencies = [
"reth-network-peers",
"reth-rpc-eth-api",
"reth-trie-common",
"serde",
"serde_json",
"tokio",
]
[[package]]
@@ -10315,7 +10269,6 @@ dependencies = [
"reth-rpc-server-types",
"reth-storage-api",
"reth-tasks",
"reth-tokio-util",
"reth-tracing",
"reth-transaction-pool",
"serde",
@@ -10907,7 +10860,6 @@ dependencies = [
"pretty_assertions",
"proptest",
"proptest-arbitrary-interop",
"rand 0.9.2",
"reth-ethereum-primitives",
"reth-execution-errors",
"reth-metrics",
@@ -11083,8 +11035,7 @@ dependencies = [
[[package]]
name = "revm"
version = "33.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c85ed0028f043f87b3c88d4a4cb6f0a76440085523b6a8afe5ff003cf418054"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"revm-bytecode",
"revm-context",
@@ -11102,8 +11053,7 @@ dependencies = [
[[package]]
name = "revm-bytecode"
version = "7.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2c6b5e6e8dd1e28a4a60e5f46615d4ef0809111c9e63208e55b5c7058200fb0"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"bitvec",
"phf",
@@ -11114,8 +11064,7 @@ dependencies = [
[[package]]
name = "revm-context"
version = "12.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f038f0c9c723393ac897a5df9140b21cfa98f5753a2cb7d0f28fa430c4118abf"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"bitvec",
"cfg-if",
@@ -11131,8 +11080,7 @@ dependencies = [
[[package]]
name = "revm-context-interface"
version = "13.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "431c9a14e4ef1be41ae503708fd02d974f80ef1f2b6b23b5e402e8d854d1b225"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"alloy-eip2930",
"alloy-eip7702",
@@ -11147,8 +11095,7 @@ dependencies = [
[[package]]
name = "revm-database"
version = "9.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "980d8d6bba78c5dd35b83abbb6585b0b902eb25ea4448ed7bfba6283b0337191"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"alloy-eips",
"revm-bytecode",
@@ -11161,21 +11108,20 @@ dependencies = [
[[package]]
name = "revm-database-interface"
version = "8.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cce03e3780287b07abe58faf4a7f5d8be7e81321f93ccf3343c8f7755602bae"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"auto_impl",
"either",
"revm-primitives",
"revm-state",
"serde",
"thiserror 2.0.17",
]
[[package]]
name = "revm-handler"
version = "14.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d44f8f6dbeec3fecf9fe55f78ef0a758bdd92ea46cd4f1ca6e2a946b32c367f3"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"auto_impl",
"derive-where",
@@ -11193,8 +11139,7 @@ dependencies = [
[[package]]
name = "revm-inspector"
version = "14.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5617e49216ce1ca6c8826bcead0386bc84f49359ef67cde6d189961735659f93"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"auto_impl",
"either",
@@ -11210,9 +11155,9 @@ dependencies = [
[[package]]
name = "revm-inspectors"
version = "0.33.2"
version = "0.33.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01def7351cd9af844150b8e88980bcd11304f33ce23c3d7c25f2a8dab87c1345"
checksum = "6c93974333e7acc4b2dc024b10def99707f7375a4d53db7a7f8351722d25673f"
dependencies = [
"alloy-primitives",
"alloy-rpc-types-eth",
@@ -11231,8 +11176,7 @@ dependencies = [
[[package]]
name = "revm-interpreter"
version = "31.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26ec36405f7477b9dccdc6caa3be19adf5662a7a0dffa6270cdb13a090c077e5"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"revm-bytecode",
"revm-context-interface",
@@ -11244,8 +11188,7 @@ dependencies = [
[[package]]
name = "revm-precompile"
version = "31.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a62958af953cc4043e93b5be9b8497df84cc3bd612b865c49a7a7dfa26a84e2"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"ark-bls12-381",
"ark-bn254",
@@ -11269,8 +11212,7 @@ dependencies = [
[[package]]
name = "revm-primitives"
version = "21.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29e161db429d465c09ba9cbff0df49e31049fe6b549e28eb0b7bd642fcbd4412"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"alloy-primitives",
"num_enum",
@@ -11281,9 +11223,9 @@ dependencies = [
[[package]]
name = "revm-state"
version = "8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d8be953b7e374dbdea0773cf360debed8df394ea8d82a8b240a6b5da37592fc"
source = "git+https://github.com/Rimeeeeee/revm?branch=rakita%2Fbal#d86e05673463cb83e0fb0c69e39b3119ba5916bd"
dependencies = [
"alloy-eip7928",
"bitflags 2.10.0",
"revm-bytecode",
"revm-primitives",
@@ -11458,6 +11400,7 @@ dependencies = [
"ark-ff 0.3.0",
"ark-ff 0.4.2",
"ark-ff 0.5.0",
"borsh",
"bytes",
"fastrlp 0.3.1",
"fastrlp 0.4.0",
@@ -12351,9 +12294,9 @@ dependencies = [
[[package]]
name = "syn-solidity"
version = "1.5.0"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60ceeb7c95a4536de0c0e1649bd98d1a72a4bb9590b1f3e45a8a0bfdb7c188c0"
checksum = "ff790eb176cc81bb8936aed0f7b9f14fc4670069a2d371b3e3b0ecce908b2cb3"
dependencies = [
"paste",
"proc-macro2",

View File

@@ -376,11 +376,11 @@ reth-era-utils = { path = "crates/era-utils" }
reth-errors = { path = "crates/errors" }
reth-eth-wire = { path = "crates/net/eth-wire" }
reth-eth-wire-types = { path = "crates/net/eth-wire-types" }
reth-ethereum-payload-builder = { path = "crates/ethereum/payload" }
reth-ethereum-cli = { path = "crates/ethereum/cli", default-features = false }
reth-ethereum-consensus = { path = "crates/ethereum/consensus", default-features = false }
reth-ethereum-engine-primitives = { path = "crates/ethereum/engine-primitives", default-features = false }
reth-ethereum-forks = { path = "crates/ethereum/hardforks", default-features = false }
reth-ethereum-payload-builder = { path = "crates/ethereum/payload" }
reth-ethereum-primitives = { path = "crates/ethereum/primitives", default-features = false }
reth-ethereum = { path = "crates/ethereum/reth" }
reth-etl = { path = "crates/etl" }
@@ -475,24 +475,24 @@ reth-ress-provider = { path = "crates/ress/provider" }
# revm
revm = { version = "33.1.0", default-features = false }
revm-bytecode = { version = "7.1.1", default-features = false }
revm-database = { version = "9.0.5", default-features = false }
revm-database = { version = "9.0.6", default-features = false }
revm-state = { version = "8.1.1", default-features = false }
revm-primitives = { version = "21.0.2", default-features = false }
revm-interpreter = { version = "31.1.0", default-features = false }
revm-database-interface = { version = "8.0.5", default-features = false }
op-revm = { version = "14.1.0", default-features = false }
revm-inspectors = "0.33.2"
revm-inspectors = "0.33.1"
# eth
alloy-primitives = { version = "1.4.1", default-features = false, features = ["map-foldhash"] }
alloy-chains = { version = "0.2.5", default-features = false }
alloy-evm = { version = "0.24.2", default-features = false }
alloy-dyn-abi = "1.4.1"
alloy-eip2124 = { version = "0.2.0", default-features = false }
alloy-eip7928 = { version = "0.1.0" }
alloy-evm = { version = "0.25.1", default-features = false }
alloy-primitives = { version = "1.5.0", default-features = false, features = ["map-foldhash"] }
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
alloy-sol-macro = "1.5.0"
alloy-sol-types = { version = "1.5.0", default-features = false }
alloy-sol-macro = "1.4.1"
alloy-sol-types = { version = "1.4.1", default-features = false }
alloy-trie = { version = "0.9.1", default-features = false }
alloy-hardforks = "0.4.5"
@@ -526,13 +526,13 @@ alloy-transport-ipc = { version = "1.1.3", default-features = false }
alloy-transport-ws = { version = "1.1.3", default-features = false }
# op
alloy-op-evm = { version = "0.25.0", default-features = false }
alloy-op-hardforks = "0.4.4"
op-alloy-rpc-types = { version = "0.23.1", default-features = false }
op-alloy-rpc-types-engine = { version = "0.23.1", default-features = false }
op-alloy-network = { version = "0.23.1", default-features = false }
op-alloy-consensus = { version = "0.23.1", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.23.1", default-features = false }
alloy-op-evm = { version = "0.24.2", default-features = false }
alloy-op-hardforks = "0.4.3"
op-alloy-rpc-types = { version = "0.22.0", default-features = false }
op-alloy-rpc-types-engine = { version = "0.22.0", default-features = false }
op-alloy-network = { version = "0.22.0", default-features = false }
op-alloy-consensus = { version = "0.22.0", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.22.0", default-features = false }
op-alloy-flz = { version = "0.13.1", default-features = false }
# misc
@@ -736,39 +736,40 @@ vergen = "9.0.4"
visibility = "0.1.1"
walkdir = "2.3.3"
vergen-git2 = "1.0.5"
# networking
ipnet = "2.11"
# [patch.crates-io]
# alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-genesis = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-network-primitives = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-provider = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-admin = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-anvil = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-beacon = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-debug = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-engine = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-eth = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-mev = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-trace = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-rpc-types-txpool = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-serde = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-signer-local = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-transport = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-transport-http = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-transport-ipc = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
# alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "3049f232fbb44d1909883e154eb38ec5962f53a3" }
[patch.crates-io]
alloy-consensus = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-contract = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-eips = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-genesis = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-json-rpc = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-network = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-network-primitives = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-provider = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-pubsub = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-client = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-admin = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-anvil = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-beacon = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-debug = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-engine = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-eth = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-mev = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-trace = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-rpc-types-txpool = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-serde = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-signer = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-signer-local = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-transport = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-transport-http = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-transport-ipc = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
alloy-transport-ws = { git = "https://github.com/Soubhik-10/alloy", branch = "bal" }
# alloy-hardforks = { git = "https://github.com/Rimeeeeee/hardforks", branch = "amsterdam" }
# alloy-op-hardforks = { git = "https://github.com/Rimeeeeee/hardforks", branch = "amsterdam" }
# op-alloy-consensus = { git = "https://github.com/alloy-rs/op-alloy", rev = "a79d6fc" }
# op-alloy-network = { git = "https://github.com/alloy-rs/op-alloy", rev = "a79d6fc" }
# op-alloy-rpc-types = { git = "https://github.com/alloy-rs/op-alloy", rev = "a79d6fc" }
@@ -776,6 +777,20 @@ ipnet = "2.11"
# op-alloy-rpc-jsonrpsee = { git = "https://github.com/alloy-rs/op-alloy", rev = "a79d6fc" }
#
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors", rev = "1207e33" }
# need to change to bluealloy rakita/bal
revm = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
alloy-evm = { git = "https://github.com/Rimeeeeee/evm", branch = "new-approach4" }
alloy-op-evm = { git = "https://github.com/Rimeeeeee/evm", branch = "new-approach4" }
revm-bytecode = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-database = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-state = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-primitives = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-interpreter = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-inspector = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-context = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-context-interface = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
revm-database-interface = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
op-revm = { git = "https://github.com/Rimeeeeee/revm", branch = "rakita/bal" }
#
# jsonrpsee = { git = "https://github.com/paradigmxyz/jsonrpsee", branch = "matt/make-rpc-service-pub" }
# jsonrpsee-core = { git = "https://github.com/paradigmxyz/jsonrpsee", branch = "matt/make-rpc-service-pub" }

View File

@@ -521,3 +521,5 @@ pr:
make update-book-cli && \
cargo docs --document-private-items && \
make test
check-features:

View File

@@ -150,6 +150,45 @@ pub(crate) fn block_to_new_payload(
let (payload, sidecar) = ExecutionPayload::from_block_slow(&block);
let (version, params) = match payload {
ExecutionPayload::V4(payload) => {
let cancun = sidecar.cancun().unwrap();
if let Some(prague) = sidecar.prague() {
if is_optimism {
(
EngineApiMessageVersion::V4,
serde_json::to_value((
OpExecutionPayloadV4 {
payload_inner: payload.payload_inner,
withdrawals_root: block.withdrawals_root.unwrap(),
},
cancun.versioned_hashes.clone(),
cancun.parent_beacon_block_root,
Requests::default(),
))?,
)
} else {
(
EngineApiMessageVersion::V4,
serde_json::to_value((
payload,
cancun.versioned_hashes.clone(),
cancun.parent_beacon_block_root,
prague.requests.requests_hash(),
))?,
)
}
} else {
(
EngineApiMessageVersion::V3,
serde_json::to_value((
payload,
cancun.versioned_hashes.clone(),
cancun.parent_beacon_block_root,
))?,
)
}
}
ExecutionPayload::V3(payload) => {
let cancun = sidecar.cancun().unwrap();
@@ -244,7 +283,10 @@ pub(crate) async fn call_forkchoice_updated<N, P: EngineApiValidWaitExt<N>>(
payload_attributes: Option<PayloadAttributes>,
) -> TransportResult<ForkchoiceUpdated> {
match message_version {
EngineApiMessageVersion::V3 | EngineApiMessageVersion::V4 | EngineApiMessageVersion::V5 => {
EngineApiMessageVersion::V3 |
EngineApiMessageVersion::V4 |
EngineApiMessageVersion::V5 |
EngineApiMessageVersion::V6 => {
provider.fork_choice_updated_v3_wait(forkchoice_state, payload_attributes).await
}
EngineApiMessageVersion::V2 => {

View File

@@ -81,7 +81,7 @@ backon.workspace = true
tempfile.workspace = true
[features]
default = ["jemalloc", "otlp", "reth-revm/portable", "js-tracer", "keccak-cache-global"]
default = ["jemalloc", "otlp", "reth-revm/portable", "js-tracer"]
otlp = [
"reth-ethereum-cli/otlp",
@@ -102,9 +102,7 @@ asm-keccak = [
"reth-ethereum-cli/asm-keccak",
"reth-node-ethereum/asm-keccak",
]
keccak-cache-global = [
"reth-node-ethereum/keccak-cache-global",
]
jemalloc = [
"reth-cli-util/jemalloc",
"reth-node-core/jemalloc",

View File

@@ -173,6 +173,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
transactions: transactions.into_iter().map(|tx| tx.into_inner()).collect(),
ommers: Vec::new(),
withdrawals: Some(vec![].into()),
block_access_list: None,
},
)
}

View File

@@ -45,6 +45,10 @@ use reth_network_peers::{
};
use reth_primitives_traits::{sync::LazyLock, BlockHeader, SealedHeader};
/// The hash of an empty block access list.
const EMPTY_BLOCK_ACCESS_LIST_HASH: B256 =
b256!("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347");
/// Helper method building a [`Header`] given [`Genesis`] and [`ChainHardforks`].
pub fn make_genesis_header(genesis: &Genesis, hardforks: &ChainHardforks) -> Header {
// If London is activated at genesis, we set the initial base fee as per EIP-1559.
@@ -79,6 +83,12 @@ pub fn make_genesis_header(genesis: &Genesis, hardforks: &ChainHardforks) -> Hea
.active_at_timestamp(genesis.timestamp)
.then_some(EMPTY_REQUESTS_HASH);
// If Amsterdam is activated at genesis we set block access list hash empty hash.
let block_access_list_hash = hardforks
.fork(EthereumHardfork::Amsterdam)
.active_at_timestamp(genesis.timestamp)
.then_some(EMPTY_BLOCK_ACCESS_LIST_HASH);
Header {
gas_limit: genesis.gas_limit,
difficulty: genesis.difficulty,
@@ -94,6 +104,7 @@ pub fn make_genesis_header(genesis: &Genesis, hardforks: &ChainHardforks) -> Hea
blob_gas_used,
excess_blob_gas,
requests_hash,
block_access_list_hash,
..Default::default()
}
}
@@ -298,6 +309,7 @@ pub fn create_chain_config(
cancun_time: timestamp(EthereumHardfork::Cancun),
prague_time: timestamp(EthereumHardfork::Prague),
osaka_time: timestamp(EthereumHardfork::Osaka),
amsterdam_time: timestamp(EthereumHardfork::Amsterdam),
bpo1_time: timestamp(EthereumHardfork::Bpo1),
bpo2_time: timestamp(EthereumHardfork::Bpo2),
bpo3_time: timestamp(EthereumHardfork::Bpo3),
@@ -887,6 +899,7 @@ impl From<Genesis> for ChainSpec {
(EthereumHardfork::Bpo3.boxed(), genesis.config.bpo3_time),
(EthereumHardfork::Bpo4.boxed(), genesis.config.bpo4_time),
(EthereumHardfork::Bpo5.boxed(), genesis.config.bpo5_time),
(EthereumHardfork::Amsterdam.boxed(), genesis.config.amsterdam_time),
];
let mut time_hardforks = time_hardfork_opts
@@ -1193,6 +1206,19 @@ impl ChainSpecBuilder {
self
}
/// Enable Amsterdam at genesis.
pub fn amsterdam_activated(mut self) -> Self {
self = self.osaka_activated();
self.hardforks.insert(EthereumHardfork::Amsterdam, ForkCondition::Timestamp(0));
self
}
/// Enable Amsterdam at the given timestamp.
pub fn with_amsterdam_at(mut self, timestamp: u64) -> Self {
self.hardforks.insert(EthereumHardfork::Amsterdam, ForkCondition::Timestamp(timestamp));
self
}
/// Build the resulting [`ChainSpec`].
///
/// # Panics

View File

@@ -23,7 +23,7 @@ use reth_node_core::{
dirs::{ChainPath, DataDirPath},
};
use reth_provider::{
providers::{BlockchainProvider, NodeTypesForProvider, RocksDBProvider, StaticFileProvider},
providers::{BlockchainProvider, NodeTypesForProvider, StaticFileProvider},
ProviderFactory, StaticFileProviderFactory,
};
use reth_stages::{sets::DefaultStages, Pipeline, PipelineTarget};
@@ -75,12 +75,10 @@ impl<C: ChainSpecParser> EnvironmentArgs<C> {
let data_dir = self.datadir.clone().resolve_datadir(self.chain.chain());
let db_path = data_dir.db();
let sf_path = data_dir.static_files();
let rocksdb_path = data_dir.rocksdb();
if access.is_read_write() {
reth_fs_util::create_dir_all(&db_path)?;
reth_fs_util::create_dir_all(&sf_path)?;
reth_fs_util::create_dir_all(&rocksdb_path)?;
}
let config_path = self.config.clone().unwrap_or_else(|| data_dir.config());
@@ -110,14 +108,8 @@ impl<C: ChainSpecParser> EnvironmentArgs<C> {
StaticFileProvider::read_only(sf_path, false)?,
),
};
// TransactionDB only support read-write mode
let rocksdb_provider = RocksDBProvider::builder(data_dir.rocksdb())
.with_default_tables()
.with_database_log_level(self.db.log_level)
.build()?;
let provider_factory =
self.create_provider_factory(&config, db, sfp, rocksdb_provider, access)?;
let provider_factory = self.create_provider_factory(&config, db, sfp, access)?;
if access.is_read_write() {
debug!(target: "reth::cli", chain=%self.chain.chain(), genesis=?self.chain.genesis_hash(), "Initializing genesis");
init_genesis_with_settings(&provider_factory, self.static_files.to_settings())?;
@@ -136,7 +128,6 @@ impl<C: ChainSpecParser> EnvironmentArgs<C> {
config: &Config,
db: Arc<DatabaseEnv>,
static_file_provider: StaticFileProvider<N::Primitives>,
rocksdb_provider: RocksDBProvider,
access: AccessRights,
) -> eyre::Result<ProviderFactory<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>>
where
@@ -147,7 +138,6 @@ impl<C: ChainSpecParser> EnvironmentArgs<C> {
db,
self.chain.clone(),
static_file_provider,
rocksdb_provider,
)?
.with_prune_modes(prune_modes.clone());

View File

@@ -2,7 +2,6 @@ use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
use clap::{Parser, Subcommand};
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_cli::chainspec::ChainSpecParser;
use reth_cli_runner::CliContext;
use reth_db::version::{get_db_version, DatabaseVersionError, DB_VERSION};
use reth_db_common::DbTool;
use std::{
@@ -80,10 +79,7 @@ macro_rules! db_exec {
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
/// Execute `db` command
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
self,
ctx: CliContext,
) -> eyre::Result<()> {
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
let data_dir = self.env.datadir.clone().resolve_datadir(self.env.chain.chain());
let db_path = data_dir.db();
let static_files_path = data_dir.static_files();
@@ -162,7 +158,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
let access_rights =
if command.dry_run { AccessRights::RO } else { AccessRights::RW };
db_exec!(self.env, tool, N, access_rights, {
command.execute(&tool, ctx.task_executor.clone())?;
command.execute(&tool)?;
});
}
Subcommands::StaticFileHeader(command) => {

View File

@@ -18,7 +18,6 @@ use reth_node_metrics::{
};
use reth_provider::{providers::ProviderNodeTypes, ChainSpecProvider, StageCheckpointReader};
use reth_stages::StageId;
use reth_tasks::TaskExecutor;
use reth_trie::{
verify::{Output, Verifier},
Nibbles,
@@ -49,37 +48,52 @@ pub struct Command {
impl Command {
/// Execute `db repair-trie` command
pub fn execute<N: ProviderNodeTypes>(
self,
tool: &DbTool<N>,
task_executor: TaskExecutor,
) -> eyre::Result<()> {
pub fn execute<N: ProviderNodeTypes>(self, tool: &DbTool<N>) -> eyre::Result<()> {
// Set up metrics server if requested
let _metrics_handle = if let Some(listen_addr) = self.metrics {
// Spawn an OS thread with a single-threaded tokio runtime for the metrics server
let chain_name = tool.provider_factory.chain_spec().chain().to_string();
let executor = task_executor.clone();
let handle = task_executor.spawn_critical("metrics server", async move {
let config = MetricServerConfig::new(
listen_addr,
VersionInfo {
version: version_metadata().cargo_pkg_version.as_ref(),
build_timestamp: version_metadata().vergen_build_timestamp.as_ref(),
cargo_features: version_metadata().vergen_cargo_features.as_ref(),
git_sha: version_metadata().vergen_git_sha.as_ref(),
target_triple: version_metadata().vergen_cargo_target_triple.as_ref(),
build_profile: version_metadata().build_profile_name.as_ref(),
},
ChainSpecInfo { name: chain_name },
executor,
Hooks::builder().build(),
);
let handle = std::thread::Builder::new().name("metrics-server".to_string()).spawn(
move || {
// Create a single-threaded tokio runtime
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.expect("Failed to create tokio runtime for metrics server");
// Spawn the metrics server
if let Err(e) = MetricServer::new(config).serve().await {
tracing::error!("Metrics server error: {}", e);
}
});
let handle = runtime.handle().clone();
runtime.block_on(async move {
let task_manager = reth_tasks::TaskManager::new(handle.clone());
let task_executor = task_manager.executor();
let config = MetricServerConfig::new(
listen_addr,
VersionInfo {
version: version_metadata().cargo_pkg_version.as_ref(),
build_timestamp: version_metadata().vergen_build_timestamp.as_ref(),
cargo_features: version_metadata().vergen_cargo_features.as_ref(),
git_sha: version_metadata().vergen_git_sha.as_ref(),
target_triple: version_metadata()
.vergen_cargo_target_triple
.as_ref(),
build_profile: version_metadata().build_profile_name.as_ref(),
},
ChainSpecInfo { name: chain_name },
task_executor,
Hooks::builder().build(),
);
// Spawn the metrics server
if let Err(e) = MetricServer::new(config).serve().await {
tracing::error!("Metrics server error: {}", e);
}
// Block forever to keep the runtime alive
std::future::pending::<()>().await
});
},
)?;
Some(handle)
} else {

View File

@@ -92,8 +92,6 @@ impl Command {
receipts_in_static_files: _,
transaction_senders_in_static_files: _,
storages_history_in_rocksdb: _,
transaction_hash_numbers_in_rocksdb: _,
account_history_in_rocksdb: _,
} = settings.unwrap_or_else(StorageSettings::legacy);
// Update the setting based on the key

View File

@@ -189,7 +189,7 @@ impl<C: ChainSpecParser> DownloadArgs<C> {
let net = NetworkConfigBuilder::<N::NetworkPrimitives>::new(p2p_secret_key)
.peer_config(config.peers_config_with_basic_nodes_from_file(None))
.external_ip_resolver(self.network.nat.clone())
.external_ip_resolver(self.network.nat)
.network_id(self.network.network_id)
.boot_nodes(boot_nodes.clone())
.apply(|builder| {

View File

@@ -110,6 +110,7 @@ impl<C: ChainSpecParser> Command<C> {
tx.clear::<tables::TransactionBlocks>()?;
tx.clear::<tables::BlockOmmers<HeaderTy<N>>>()?;
tx.clear::<tables::BlockWithdrawals>()?;
tx.clear::<tables::BlockAccessLists>()?;
reset_stage_checkpoint(tx, StageId::Bodies)?;
insert_genesis_header(&provider_rw, &self.env.chain)?;

View File

@@ -9,7 +9,7 @@ use reth_evm::ConfigureEvm;
use reth_node_builder::NodeTypesWithDB;
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_provider::{
providers::{ProviderNodeTypes, RocksDBProvider, StaticFileProvider},
providers::{ProviderNodeTypes, StaticFileProvider},
DatabaseProviderFactory, ProviderFactory,
};
use reth_stages::{stages::ExecutionStage, Stage, StageCheckpoint, UnwindInput};
@@ -42,7 +42,6 @@ where
Arc::new(output_db),
db_tool.chain(),
StaticFileProvider::read_write(output_datadir.static_files())?,
RocksDBProvider::builder(output_datadir.rocksdb()).build()?,
)?,
to,
from,

View File

@@ -6,7 +6,7 @@ use reth_db_api::{database::Database, table::TableImporter, tables};
use reth_db_common::DbTool;
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_provider::{
providers::{ProviderNodeTypes, RocksDBProvider, StaticFileProvider},
providers::{ProviderNodeTypes, StaticFileProvider},
DatabaseProviderFactory, ProviderFactory,
};
use reth_stages::{stages::AccountHashingStage, Stage, StageCheckpoint, UnwindInput};
@@ -39,7 +39,6 @@ pub(crate) async fn dump_hashing_account_stage<N: ProviderNodeTypes<DB = Arc<Dat
Arc::new(output_db),
db_tool.chain(),
StaticFileProvider::read_write(output_datadir.static_files())?,
RocksDBProvider::builder(output_datadir.rocksdb()).build()?,
)?,
to,
from,

View File

@@ -5,7 +5,7 @@ use reth_db_api::{database::Database, table::TableImporter, tables};
use reth_db_common::DbTool;
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_provider::{
providers::{ProviderNodeTypes, RocksDBProvider, StaticFileProvider},
providers::{ProviderNodeTypes, StaticFileProvider},
DatabaseProviderFactory, ProviderFactory,
};
use reth_stages::{stages::StorageHashingStage, Stage, StageCheckpoint, UnwindInput};
@@ -29,7 +29,6 @@ pub(crate) async fn dump_hashing_storage_stage<N: ProviderNodeTypes<DB = Arc<Dat
Arc::new(output_db),
db_tool.chain(),
StaticFileProvider::read_write(output_datadir.static_files())?,
RocksDBProvider::builder(output_datadir.rocksdb()).build()?,
)?,
to,
from,

View File

@@ -12,7 +12,7 @@ use reth_evm::ConfigureEvm;
use reth_exex::ExExManagerHandle;
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_provider::{
providers::{ProviderNodeTypes, RocksDBProvider, StaticFileProvider},
providers::{ProviderNodeTypes, StaticFileProvider},
DatabaseProviderFactory, ProviderFactory,
};
use reth_stages::{
@@ -62,7 +62,6 @@ where
Arc::new(output_db),
db_tool.chain(),
StaticFileProvider::read_write(output_datadir.static_files())?,
RocksDBProvider::builder(output_datadir.rocksdb()).build()?,
)?,
to,
from,

View File

@@ -97,57 +97,6 @@ impl CliRunner {
command_res
}
/// Executes a command in a blocking context with access to `CliContext`.
///
/// See [`Runtime::spawn_blocking`](tokio::runtime::Runtime::spawn_blocking).
pub fn run_blocking_command_until_exit<F, E>(
self,
command: impl FnOnce(CliContext) -> F + Send + 'static,
) -> Result<(), E>
where
F: Future<Output = Result<(), E>> + Send + 'static,
E: Send + Sync + From<std::io::Error> + From<reth_tasks::PanickedTaskError> + 'static,
{
let AsyncCliRunner { context, mut task_manager, tokio_runtime } =
AsyncCliRunner::new(self.tokio_runtime);
// Spawn the command on the blocking thread pool
let handle = tokio_runtime.handle().clone();
let command_handle =
tokio_runtime.handle().spawn_blocking(move || handle.block_on(command(context)));
// Wait for the command to complete or ctrl-c
let command_res = tokio_runtime.block_on(run_to_completion_or_panic(
&mut task_manager,
run_until_ctrl_c(
async move { command_handle.await.expect("Failed to join blocking task") },
),
));
if command_res.is_err() {
error!(target: "reth::cli", "shutting down due to error");
} else {
debug!(target: "reth::cli", "shutting down gracefully");
task_manager.graceful_shutdown_with_timeout(Duration::from_secs(5));
}
// Shutdown the runtime on a separate thread
let (tx, rx) = mpsc::channel();
std::thread::Builder::new()
.name("tokio-runtime-shutdown".to_string())
.spawn(move || {
drop(tokio_runtime);
let _ = tx.send(());
})
.unwrap();
let _ = rx.recv_timeout(Duration::from_secs(5)).inspect_err(|err| {
debug!(target: "reth::cli", %err, "tokio runtime shutdown timed out");
});
command_res
}
/// Executes a regular future until completion or until external signal received.
pub fn run_until_ctrl_c<F, E>(self, fut: F) -> Result<(), E>
where

View File

@@ -14,11 +14,14 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-consensus.workspace = true
tracing.workspace = true
# ethereum
reth-primitives-traits.workspace = true
alloy-consensus.workspace = true
alloy-primitives.workspace = true
alloy-eips.workspace = true
alloy-rlp.workspace = true
[dev-dependencies]
alloy-primitives = { workspace = true, features = ["rand"] }
@@ -35,4 +38,6 @@ std = [
"reth-primitives-traits/std",
"reth-ethereum-primitives/std",
"alloy-primitives/std",
"alloy-rlp/std",
"tracing/std",
]

View File

@@ -69,6 +69,29 @@ pub fn validate_shanghai_withdrawals<B: Block>(
Ok(())
}
/// Validate that block access lists are present in Amsterdam
///
/// [EIP-7928]: https://eips.ethereum.org/EIPS/eip-7928
#[inline]
pub fn validate_amsterdam_block_access_lists<B: Block>(
block: &SealedBlock<B>,
) -> Result<(), ConsensusError> {
let bal = block.body().block_access_list().ok_or(ConsensusError::BlockAccessListMissing)?;
let bal_hash = alloy_primitives::keccak256(alloy_rlp::encode(bal));
let header_bal_hash =
block.block_access_list_hash().ok_or(ConsensusError::BlockAccessListHashMissing)?;
if bal_hash != header_bal_hash {
tracing::error!(
target: "consensus",
?header_bal_hash,
?bal,
"Block access list hash mismatch in validation.rs in L81"
);
return Err(ConsensusError::InvalidBalHash);
}
Ok(())
}
/// Validate that blob gas is present in the block if Cancun is active.
///
/// See [EIP-4844]: Shard Blob Transactions
@@ -131,6 +154,21 @@ where
}
_ => return Err(ConsensusError::WithdrawalsRootUnexpected),
}
if let (Some(expected_hash), Some(body_bal)) =
(header.block_access_list_hash(), body.block_access_list())
{
let got_hash = alloy_primitives::keccak256(alloy_rlp::encode(body_bal));
if got_hash != expected_hash {
tracing::error!(
target: "consensus",
?expected_hash,
?body_bal,
"Block access list hash mismatch in validation.rs in L164"
);
return Err(ConsensusError::InvalidBalHash);
}
}
Ok(())
}
@@ -217,6 +255,10 @@ where
})
}
if chain_spec.is_amsterdam_active_at_timestamp(block.header().timestamp()) {
validate_amsterdam_block_access_lists(block)?;
}
Ok(())
}
@@ -279,28 +321,20 @@ pub fn validate_against_parent_hash_number<H: BlockHeader>(
header: &H,
parent: &SealedHeader<H>,
) -> Result<(), ConsensusError> {
if parent.hash() != header.parent_hash() {
return Err(ConsensusError::ParentHashMismatch(
GotExpected { got: header.parent_hash(), expected: parent.hash() }.into(),
))
}
let Some(parent_number) = parent.number().checked_add(1) else {
// parent block already reached the maximum
return Err(ConsensusError::ParentBlockNumberMismatch {
parent_block_number: parent.number(),
block_number: u64::MAX,
})
};
// Parent number is consistent.
if parent_number != header.number() {
if parent.number() + 1 != header.number() {
return Err(ConsensusError::ParentBlockNumberMismatch {
parent_block_number: parent.number(),
block_number: header.number(),
})
}
if parent.hash() != header.parent_hash() {
return Err(ConsensusError::ParentHashMismatch(
GotExpected { got: header.parent_hash(), expected: parent.hash() }.into(),
))
}
Ok(())
}
@@ -492,6 +526,7 @@ mod tests {
transactions: vec![transaction],
ommers: vec![],
withdrawals: Some(Withdrawals::default()),
block_access_list: None,
};
let block = SealedBlock::seal_slow(alloy_consensus::Block { header, body });

View File

@@ -404,9 +404,41 @@ pub enum ConsensusError {
/// The maximum allowed RLP length.
max_rlp_length: usize,
},
/// Error when the hash of block access list is different from the expected hash.
#[error("Block header's BAL hash does not match the computed BAL hash.")]
InvalidBalHash,
/// Error when the block access list hash is missing.
#[error("block access list hash missing")]
BlockAccessListHashMissing,
/// Error when the block access list is different from the expected access list.
#[error("Block's access list is invalid.")]
InvalidBlockAccessList,
/// Error when the block access list is missing.
#[error("block access list missing")]
BlockAccessListMissing,
/// Error when the block access list hash is unexpected.
#[error("block access list hash unexpected")]
BlockAccessListHashUnexpected,
/// Error when the block access list contains an account change that is not present in the
/// computed access list.
#[error("Block BAL contains an account change that is not present in the computed BAL.")]
InvalidBalExtraAccount,
/// Error when the block access list is missing an account change that is present in the
/// computed access list.
#[error("Block BAL is missing an account change that is present in the computed BAL.")]
InvalidBalMissingAccount,
/// EIP-7825: Transaction gas limit exceeds maximum allowed
#[error(transparent)]
TransactionGasLimitTooHigh(Box<TxGasLimitTooHighErr>),
/// Other, likely an injected L2 error.
#[error("{0}")]
Other(String),

View File

@@ -1,5 +1,5 @@
use crate::BlockProvider;
use alloy_provider::{ConnectionConfig, Network, Provider, ProviderBuilder, WebSocketConfig};
use alloy_provider::{ConnectionConfig, Network, Provider, ProviderBuilder};
use alloy_transport::TransportResult;
use futures::{Stream, StreamExt};
use reth_node_api::Block;
@@ -29,12 +29,7 @@ impl<N: Network, PrimitiveBlock> RpcBlockProvider<N, PrimitiveBlock> {
ProviderBuilder::default()
.connect_with_config(
rpc_url,
ConnectionConfig::default().with_max_retries(u32::MAX).with_ws_config(
WebSocketConfig::default()
// allow larger messages/frames for big blocks
.max_frame_size(Some(128 * 1024 * 1024))
.max_message_size(Some(128 * 1024 * 1024)),
),
ConnectionConfig::default().with_max_retries(u32::MAX),
)
.await?,
),

View File

@@ -110,7 +110,6 @@ pub async fn setup_engine_with_chain_import(
// Create database path and static files path
let db_path = datadir.join("db");
let static_files_path = datadir.join("static_files");
let rocksdb_dir_path = datadir.join("rocksdb");
// Initialize the database using init_db (same as CLI import command)
// Use the same database arguments as the node will use
@@ -126,7 +125,6 @@ pub async fn setup_engine_with_chain_import(
db.clone(),
chain_spec.clone(),
reth_provider::providers::StaticFileProvider::read_write(static_files_path.clone())?,
reth_provider::providers::RocksDBProvider::builder(rocksdb_dir_path).build().unwrap(),
)?;
// Initialize genesis if needed
@@ -313,7 +311,6 @@ mod tests {
std::fs::create_dir_all(&datadir).unwrap();
let db_path = datadir.join("db");
let static_files_path = datadir.join("static_files");
let rocksdb_dir_path = datadir.join("rocksdb");
// Import the chain
{
@@ -327,9 +324,6 @@ mod tests {
chain_spec.clone(),
reth_provider::providers::StaticFileProvider::read_write(static_files_path.clone())
.unwrap(),
reth_provider::providers::RocksDBProvider::builder(rocksdb_dir_path.clone())
.build()
.unwrap(),
)
.expect("failed to create provider factory");
@@ -391,9 +385,6 @@ mod tests {
chain_spec.clone(),
reth_provider::providers::StaticFileProvider::read_only(static_files_path, false)
.unwrap(),
reth_provider::providers::RocksDBProvider::builder(rocksdb_dir_path)
.build()
.unwrap(),
)
.expect("failed to create provider factory");
@@ -481,15 +472,11 @@ mod tests {
// Create static files path
let static_files_path = datadir.join("static_files");
// Create rocksdb path
let rocksdb_dir_path = datadir.join("rocksdb");
// Create a provider factory
let provider_factory: ProviderFactory<MockNodeTypesWithDB> = ProviderFactory::new(
db.clone(),
chain_spec.clone(),
reth_provider::providers::StaticFileProvider::read_write(static_files_path).unwrap(),
reth_provider::providers::RocksDBProvider::builder(rocksdb_dir_path).build().unwrap(),
)
.expect("failed to create provider factory");

View File

@@ -56,6 +56,7 @@ pub fn generate_test_blocks(chain_spec: &ChainSpec, count: u64) -> Vec<SealedBlo
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_hash: None,
block_access_list_hash: None,
};
// Set required fields based on chain spec
@@ -106,6 +107,7 @@ pub fn generate_test_blocks(chain_spec: &ChainSpec, count: u64) -> Vec<SealedBlo
transactions: vec![],
ommers: vec![],
withdrawals: header.withdrawals_root.is_some().then(Withdrawals::default),
block_access_list: None,
};
// Create the block

View File

@@ -448,12 +448,14 @@ mod tests {
nonce: account.nonce,
code_hash: account.bytecode_hash.unwrap_or_default(),
code: None,
storage_id: None,
}),
original_info: (i == 0).then(|| AccountInfo {
balance: account.balance.checked_div(U256::from(2)).unwrap_or(U256::ZERO),
nonce: 0,
code_hash: account.bytecode_hash.unwrap_or_default(),
code: None,
storage_id: None,
}),
storage,
status: AccountStatus::default(),
@@ -839,6 +841,7 @@ mod tests {
receipts: vec![],
requests: Requests::default(),
gas_used: 0,
block_access_list: Default::default(),
blob_gas_used: 0,
},
};

View File

@@ -204,7 +204,7 @@ where
EngineApiMessageVersion::default(),
)
.await?;
tracing::debug!(target: "engine::local", "FCU result: {res:?}");
if !res.is_valid() {
eyre::bail!("Invalid payload status")
}

View File

@@ -1,7 +1,5 @@
//! Engine tree configuration.
use alloy_eips::merge::EPOCH_SLOTS;
/// Triggers persistence when the number of canonical blocks in memory exceeds this threshold.
pub const DEFAULT_PERSISTENCE_THRESHOLD: u64 = 2;
@@ -42,7 +40,7 @@ pub const DEFAULT_RESERVED_CPU_CORES: usize = 1;
/// Default maximum concurrency for prewarm task.
pub const DEFAULT_PREWARM_MAX_CONCURRENCY: usize = 16;
const DEFAULT_BLOCK_BUFFER_LIMIT: u32 = EPOCH_SLOTS as u32 * 2;
const DEFAULT_BLOCK_BUFFER_LIMIT: u32 = 256;
const DEFAULT_MAX_INVALID_HEADER_CACHE_LENGTH: u32 = 256;
const DEFAULT_MAX_EXECUTE_BLOCK_BATCH_SIZE: usize = 4;
const DEFAULT_CROSS_BLOCK_CACHE_SIZE: u64 = 4 * 1024 * 1024 * 1024;
@@ -91,8 +89,6 @@ pub struct TreeConfig {
/// Whether to always compare trie updates from the state root task to the trie updates from
/// the regular state root calculation.
always_compare_trie_updates: bool,
/// Whether to disable state cache.
disable_state_cache: bool,
/// Whether to disable parallel prewarming.
disable_prewarming: bool,
/// Whether to disable the parallel sparse trie state root algorithm.
@@ -101,7 +97,7 @@ pub struct TreeConfig {
state_provider_metrics: bool,
/// Cross-block cache size in bytes.
cross_block_cache_size: u64,
/// Whether the host has enough parallelism to run state root task.
/// Whether the host has enough parallelism to run state root in parallel.
has_enough_parallelism: bool,
/// Whether multiproof task should chunk proof targets.
multiproof_chunking_enabled: bool,
@@ -147,7 +143,6 @@ impl Default for TreeConfig {
max_execute_block_batch_size: DEFAULT_MAX_EXECUTE_BLOCK_BATCH_SIZE,
legacy_state_root: false,
always_compare_trie_updates: false,
disable_state_cache: false,
disable_prewarming: false,
disable_parallel_sparse_trie: false,
state_provider_metrics: false,
@@ -178,7 +173,6 @@ impl TreeConfig {
max_execute_block_batch_size: usize,
legacy_state_root: bool,
always_compare_trie_updates: bool,
disable_state_cache: bool,
disable_prewarming: bool,
disable_parallel_sparse_trie: bool,
state_provider_metrics: bool,
@@ -203,7 +197,6 @@ impl TreeConfig {
max_execute_block_batch_size,
legacy_state_root,
always_compare_trie_updates,
disable_state_cache,
disable_prewarming,
disable_parallel_sparse_trie,
state_provider_metrics,
@@ -278,12 +271,7 @@ impl TreeConfig {
self.disable_parallel_sparse_trie
}
/// Returns whether or not state cache is disabled.
pub const fn disable_state_cache(&self) -> bool {
self.disable_state_cache
}
/// Returns whether or not parallel prewarming is disabled.
/// Returns whether or not parallel prewarming should be used.
pub const fn disable_prewarming(&self) -> bool {
self.disable_prewarming
}
@@ -375,12 +363,6 @@ impl TreeConfig {
self
}
/// Setter for whether to disable state cache.
pub const fn without_state_cache(mut self, disable_state_cache: bool) -> Self {
self.disable_state_cache = disable_state_cache;
self
}
/// Setter for whether to disable parallel prewarming.
pub const fn without_prewarming(mut self, disable_prewarming: bool) -> Self {
self.disable_prewarming = disable_prewarming;
@@ -403,12 +385,17 @@ impl TreeConfig {
self
}
/// Setter for has enough parallelism.
/// Setter for whether or not the host has enough parallelism to run state root in parallel.
pub const fn with_has_enough_parallelism(mut self, has_enough_parallelism: bool) -> Self {
self.has_enough_parallelism = has_enough_parallelism;
self
}
/// Whether or not the host has enough parallelism to run state root in parallel.
pub const fn has_enough_parallelism(&self) -> bool {
self.has_enough_parallelism
}
/// Setter for state provider metrics.
pub const fn with_state_provider_metrics(mut self, state_provider_metrics: bool) -> Self {
self.state_provider_metrics = state_provider_metrics;

View File

@@ -22,8 +22,7 @@ use reth_trie_common::HashedPostState;
use serde::{de::DeserializeOwned, Serialize};
// Re-export [`ExecutionPayload`] moved to `reth_payload_primitives`
#[cfg(feature = "std")]
pub use reth_evm::{ConfigureEngineEvm, ExecutableTxIterator, ExecutableTxTuple};
pub use reth_evm::{ConfigureEngineEvm, ExecutableTxIterator};
pub use reth_payload_primitives::ExecutionPayload;
mod error;
@@ -62,7 +61,8 @@ pub trait EngineTypes:
+ TryInto<Self::ExecutionPayloadEnvelopeV2>
+ TryInto<Self::ExecutionPayloadEnvelopeV3>
+ TryInto<Self::ExecutionPayloadEnvelopeV4>
+ TryInto<Self::ExecutionPayloadEnvelopeV5>,
+ TryInto<Self::ExecutionPayloadEnvelopeV5>
+ TryInto<Self::ExecutionPayloadEnvelopeV6>,
> + DeserializeOwned
+ Serialize
{
@@ -106,6 +106,14 @@ pub trait EngineTypes:
+ Send
+ Sync
+ 'static;
/// Execution Payload V6 envelope type.
type ExecutionPayloadEnvelopeV6: DeserializeOwned
+ Serialize
+ Clone
+ Unpin
+ Send
+ Sync
+ 'static;
}
/// Type that validates the payloads processed by the engine API.

View File

@@ -16,7 +16,7 @@ reth-chain-state.workspace = true
reth-chainspec = { workspace = true, optional = true }
reth-consensus.workspace = true
reth-db.workspace = true
reth-engine-primitives = { workspace = true, features = ["std"] }
reth-engine-primitives.workspace = true
reth-errors.workspace = true
reth-execution-types.workspace = true
reth-evm = { workspace = true, features = ["metrics"] }
@@ -39,7 +39,6 @@ reth-trie.workspace = true
alloy-evm.workspace = true
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-eip7928.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-rpc-types-engine.workspace = true

View File

@@ -26,10 +26,12 @@ fn create_bench_state(num_accounts: usize) -> EvmState {
nonce: 10,
code_hash: B256::from_slice(&rng.random::<[u8; 32]>()),
code: Default::default(),
storage_id: None,
},
storage,
status: AccountStatus::empty(),
transaction_id: 0,
..Default::default()
};
let address = Address::with_last_byte(i as u8);

View File

@@ -62,6 +62,7 @@ fn create_bench_state_updates(params: &BenchParams) -> Vec<EvmState> {
storage: HashMap::default(),
status: AccountStatus::SelfDestructed,
transaction_id: 0,
..Default::default()
}
} else {
RevmAccount {
@@ -70,6 +71,7 @@ fn create_bench_state_updates(params: &BenchParams) -> Vec<EvmState> {
nonce: rng.random::<u64>(),
code_hash: KECCAK_EMPTY,
code: Some(Default::default()),
storage_id: None,
},
storage: (0..rng.random_range(0..=params.storage_slots_per_account))
.map(|_| {
@@ -85,6 +87,7 @@ fn create_bench_state_updates(params: &BenchParams) -> Vec<EvmState> {
.collect(),
status: AccountStatus::Touched,
transaction_id: 0,
..Default::default()
}
};
@@ -230,18 +233,17 @@ fn bench_state_root(c: &mut Criterion) {
let mut handle = payload_processor.spawn(
Default::default(),
(
Vec::<
core::iter::empty::<
Result<
Recovered<TransactionSigned>,
core::convert::Infallible,
>,
>::new(),
>(),
std::convert::identity,
),
StateProviderBuilder::new(provider.clone(), genesis_hash, None),
OverlayStateProviderFactory::new(provider),
&TreeConfig::default(),
None,
);
let mut state_hook = handle.state_hook();

View File

@@ -22,7 +22,7 @@ const NANOS_PER_SEC: u32 = 1_000_000_000;
/// An atomic version of [`Duration`], using an [`AtomicU64`] to store the total nanoseconds in the
/// duration.
#[derive(Debug, Default)]
#[derive(Default)]
pub(crate) struct AtomicDuration {
/// The nanoseconds part of the duration
///
@@ -59,8 +59,7 @@ impl AtomicDuration {
}
/// A wrapper of a state provider and latency metrics.
#[derive(Debug)]
pub struct InstrumentedStateProvider<S> {
pub(crate) struct InstrumentedStateProvider<S> {
/// The state provider
state_provider: S,
@@ -81,12 +80,11 @@ impl<S> InstrumentedStateProvider<S>
where
S: StateProvider,
{
/// Creates a new [`InstrumentedStateProvider`] from a state provider with the provided label
/// for metrics.
pub fn from_state_provider(state_provider: S, source: &'static str) -> Self {
/// Creates a new [`InstrumentedStateProvider`] from a state provider
pub(crate) fn from_state_provider(state_provider: S) -> Self {
Self {
state_provider,
metrics: StateProviderMetrics::new_with_labels(&[("source", source)]),
metrics: StateProviderMetrics::default(),
total_storage_fetch_latency: AtomicDuration::zero(),
total_code_fetch_latency: AtomicDuration::zero(),
total_account_fetch_latency: AtomicDuration::zero(),
@@ -136,12 +134,6 @@ impl<S> InstrumentedStateProvider<S> {
}
}
impl<S> Drop for InstrumentedStateProvider<S> {
fn drop(&mut self) {
self.record_total_latency();
}
}
/// Metrics for the instrumented state provider
#[derive(Metrics, Clone)]
#[metrics(scope = "sync.state_provider")]

View File

@@ -477,6 +477,7 @@ mod tests {
receipts: vec![],
requests: Requests::default(),
gas_used: 1000,
block_access_list: None,
blob_gas_used: 0,
},
))
@@ -570,10 +571,12 @@ mod tests {
nonce: 10,
code_hash: B256::random(),
code: Default::default(),
storage_id: None,
},
storage,
status: AccountStatus::default(),
transaction_id: 0,
..Default::default()
},
);
state

View File

@@ -54,7 +54,7 @@ use tracing::*;
mod block_buffer;
mod cached_state;
pub mod error;
pub mod instrumented_state;
mod instrumented_state;
mod invalid_headers;
mod metrics;
mod payload_processor;
@@ -536,7 +536,7 @@ where
// null}` if the expected and the actual arrays don't match.
//
// This validation **MUST** be instantly run in all cases even during active sync process.
tracing::debug!("Payload received {:?}", payload);
let num_hash = payload.num_hash();
let engine_event = ConsensusEngineEvent::BlockReceived(num_hash);
self.emit_event(EngineApiEvent::BeaconConsensus(engine_event));
@@ -545,6 +545,7 @@ where
// Check for invalid ancestors
if let Some(invalid) = self.find_invalid_ancestor(&payload) {
tracing::debug!(target: "engine::tree", ?invalid, "found invalid ancestor for payload");
let status = self.handle_invalid_ancestor_payload(payload, invalid)?;
return Ok(TreeOutcome::new(status));
}
@@ -553,6 +554,7 @@ where
self.metrics.block_validation.record_payload_validation(start.elapsed().as_secs_f64());
let status = if self.backfill_sync_state.is_idle() {
tracing::debug!(target: "engine::tree", "inserting payload directly");
self.try_insert_payload(payload)?
} else {
self.try_buffer_payload(payload)?
@@ -591,7 +593,7 @@ where
let parent_hash = payload.parent_hash();
let mut latest_valid_hash = None;
match self.insert_payload(payload) {
match self.insert_payload(payload.clone()) {
Ok(status) => {
let status = match status {
InsertPayloadOk::Inserted(BlockStatus::Valid) => {
@@ -613,7 +615,10 @@ where
Ok(PayloadStatus::new(status, latest_valid_hash))
}
Err(error) => match error {
InsertPayloadError::Block(error) => Ok(self.on_insert_block_error(error)?),
InsertPayloadError::Block(error) => {
tracing::debug!("payload in new payload l 617 {:?}", payload);
Ok(self.on_insert_block_error(error)?)
}
InsertPayloadError::Payload(error) => {
Ok(self.on_new_payload_error(error, num_hash, parent_hash)?)
}

View File

@@ -1,318 +0,0 @@
//! BAL (Block Access List, EIP-7928) related functionality.
use alloy_consensus::constants::KECCAK_EMPTY;
use alloy_eip7928::BlockAccessList;
use alloy_primitives::{keccak256, U256};
use reth_primitives_traits::Account;
use reth_provider::{AccountReader, ProviderError};
use reth_trie::{HashedPostState, HashedStorage};
/// Converts a Block Access List into a [`HashedPostState`] by extracting the final state
/// of modified accounts and storage slots.
pub fn bal_to_hashed_post_state<P>(
bal: &BlockAccessList,
provider: &P,
) -> Result<HashedPostState, ProviderError>
where
P: AccountReader,
{
let mut hashed_state = HashedPostState::with_capacity(bal.len());
for account_changes in bal {
let address = account_changes.address;
let hashed_address = keccak256(address);
// Get the latest balance (last balance change if any)
let balance = account_changes.balance_changes.last().map(|change| change.post_balance);
// Get the latest nonce (last nonce change if any)
let nonce = account_changes.nonce_changes.last().map(|change| change.new_nonce);
// Get the latest code (last code change if any)
let code_hash = if let Some(code_change) = account_changes.code_changes.last() {
if code_change.new_code.is_empty() {
Some(Some(KECCAK_EMPTY))
} else {
Some(Some(keccak256(&code_change.new_code)))
}
} else {
None
};
// Only fetch account from provider if we're missing any field
let existing_account = if balance.is_none() || nonce.is_none() || code_hash.is_none() {
provider.basic_account(&address)?
} else {
None
};
// Build the final account state
let account = Account {
balance: balance.unwrap_or_else(|| {
existing_account.as_ref().map(|acc| acc.balance).unwrap_or(U256::ZERO)
}),
nonce: nonce
.unwrap_or_else(|| existing_account.as_ref().map(|acc| acc.nonce).unwrap_or(0)),
bytecode_hash: code_hash.unwrap_or_else(|| {
existing_account.as_ref().and_then(|acc| acc.bytecode_hash).or(Some(KECCAK_EMPTY))
}),
};
hashed_state.accounts.insert(hashed_address, Some(account));
// Process storage changes
if !account_changes.storage_changes.is_empty() {
let mut storage_map = HashedStorage::new(false);
for slot_changes in &account_changes.storage_changes {
let hashed_slot = keccak256(slot_changes.slot);
// Get the last change for this slot
if let Some(last_change) = slot_changes.changes.last() {
storage_map
.storage
.insert(hashed_slot, U256::from_be_bytes(last_change.new_value.0));
}
}
if !storage_map.storage.is_empty() {
hashed_state.storages.insert(hashed_address, storage_map);
}
}
}
Ok(hashed_state)
}
#[cfg(test)]
mod tests {
use super::*;
use alloy_eip7928::{
AccountChanges, BalanceChange, CodeChange, NonceChange, SlotChanges, StorageChange,
};
use alloy_primitives::{Address, Bytes, StorageKey, B256};
use reth_revm::test_utils::StateProviderTest;
#[test]
fn test_bal_to_hashed_post_state_basic() {
let provider = StateProviderTest::default();
let address = Address::random();
let account_changes = AccountChanges {
address,
storage_changes: vec![],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(100))],
nonce_changes: vec![NonceChange::new(0, 1)],
code_changes: vec![],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
assert_eq!(result.accounts.len(), 1);
let hashed_address = keccak256(address);
let account_opt = result.accounts.get(&hashed_address).unwrap();
assert!(account_opt.is_some());
let account = account_opt.as_ref().unwrap();
assert_eq!(account.balance, U256::from(100));
assert_eq!(account.nonce, 1);
assert_eq!(account.bytecode_hash, Some(KECCAK_EMPTY));
}
#[test]
fn test_bal_with_storage_changes() {
let provider = StateProviderTest::default();
let address = Address::random();
let slot = StorageKey::random();
let value = B256::random();
let slot_changes = SlotChanges { slot, changes: vec![StorageChange::new(0, value)] };
let account_changes = AccountChanges {
address,
storage_changes: vec![slot_changes],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(500))],
nonce_changes: vec![NonceChange::new(0, 2)],
code_changes: vec![],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
assert!(result.storages.contains_key(&hashed_address));
let storage = result.storages.get(&hashed_address).unwrap();
let hashed_slot = keccak256(slot);
let stored_value = storage.storage.get(&hashed_slot).unwrap();
assert_eq!(*stored_value, U256::from_be_bytes(value.0));
}
#[test]
fn test_bal_with_code_change() {
let provider = StateProviderTest::default();
let address = Address::random();
let code = Bytes::from(vec![0x60, 0x80, 0x60, 0x40]); // Some bytecode
let account_changes = AccountChanges {
address,
storage_changes: vec![],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(1000))],
nonce_changes: vec![NonceChange::new(0, 1)],
code_changes: vec![CodeChange::new(0, code.clone())],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
let account_opt = result.accounts.get(&hashed_address).unwrap();
let account = account_opt.as_ref().unwrap();
let expected_code_hash = keccak256(&code);
assert_eq!(account.bytecode_hash, Some(expected_code_hash));
}
#[test]
fn test_bal_with_empty_code() {
let provider = StateProviderTest::default();
let address = Address::random();
let empty_code = Bytes::default();
let account_changes = AccountChanges {
address,
storage_changes: vec![],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(1000))],
nonce_changes: vec![NonceChange::new(0, 1)],
code_changes: vec![CodeChange::new(0, empty_code)],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
let account_opt = result.accounts.get(&hashed_address).unwrap();
let account = account_opt.as_ref().unwrap();
assert_eq!(account.bytecode_hash, Some(KECCAK_EMPTY));
}
#[test]
fn test_bal_multiple_changes_takes_last() {
let provider = StateProviderTest::default();
let address = Address::random();
// Multiple balance changes - should take the last one
let account_changes = AccountChanges {
address,
storage_changes: vec![],
storage_reads: vec![],
balance_changes: vec![
BalanceChange::new(0, U256::from(100)),
BalanceChange::new(1, U256::from(200)),
BalanceChange::new(2, U256::from(300)),
],
nonce_changes: vec![
NonceChange::new(0, 1),
NonceChange::new(1, 2),
NonceChange::new(2, 3),
],
code_changes: vec![],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
let account_opt = result.accounts.get(&hashed_address).unwrap();
let account = account_opt.as_ref().unwrap();
// Should have the last values
assert_eq!(account.balance, U256::from(300));
assert_eq!(account.nonce, 3);
}
#[test]
fn test_bal_uses_provider_for_missing_fields() {
let mut provider = StateProviderTest::default();
let address = Address::random();
let code_hash = B256::random();
let existing_account =
Account { balance: U256::from(999), nonce: 42, bytecode_hash: Some(code_hash) };
provider.insert_account(address, existing_account, None, Default::default());
// Only change balance, nonce and code should come from provider
let account_changes = AccountChanges {
address,
storage_changes: vec![],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(1500))],
nonce_changes: vec![],
code_changes: vec![],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
let account_opt = result.accounts.get(&hashed_address).unwrap();
let account = account_opt.as_ref().unwrap();
// Balance should be updated
assert_eq!(account.balance, U256::from(1500));
// Nonce and bytecode_hash should come from provider
assert_eq!(account.nonce, 42);
assert_eq!(account.bytecode_hash, Some(code_hash));
}
#[test]
fn test_bal_multiple_storage_changes_per_slot() {
let provider = StateProviderTest::default();
let address = Address::random();
let slot = StorageKey::random();
// Multiple changes to the same slot - should take the last one
let slot_changes = SlotChanges {
slot,
changes: vec![
StorageChange::new(0, B256::from(U256::from(100).to_be_bytes::<32>())),
StorageChange::new(1, B256::from(U256::from(200).to_be_bytes::<32>())),
StorageChange::new(2, B256::from(U256::from(300).to_be_bytes::<32>())),
],
};
let account_changes = AccountChanges {
address,
storage_changes: vec![slot_changes],
storage_reads: vec![],
balance_changes: vec![BalanceChange::new(0, U256::from(100))],
nonce_changes: vec![NonceChange::new(0, 1)],
code_changes: vec![],
};
let bal = vec![account_changes];
let result = bal_to_hashed_post_state(&bal, &provider).unwrap();
let hashed_address = keccak256(address);
let storage = result.storages.get(&hashed_address).unwrap();
let hashed_slot = keccak256(slot);
let stored_value = storage.storage.get(&hashed_slot).unwrap();
// Should have the last value
assert_eq!(*stored_value, U256::from(300));
}
}

View File

@@ -13,7 +13,6 @@ use crate::tree::{
sparse_trie::SparseTrieTask,
StateProviderBuilder, TreeConfig,
};
use alloy_eip7928::BlockAccessList;
use alloy_eips::eip1898::BlockWithParent;
use alloy_evm::{block::StateChangeSource, ToTxEnv};
use alloy_primitives::B256;
@@ -22,7 +21,7 @@ use executor::WorkloadExecutor;
use multiproof::{SparseTrieUpdate, *};
use parking_lot::RwLock;
use prewarm::PrewarmMetrics;
use rayon::prelude::*;
use rayon::iter::{ParallelBridge, ParallelIterator};
use reth_engine_primitives::ExecutableTxIterator;
use reth_evm::{
execute::{ExecutableTxFor, WithTxEnv},
@@ -50,9 +49,8 @@ use std::{
},
time::Instant,
};
use tracing::{debug, debug_span, error, instrument, warn, Span};
use tracing::{debug, debug_span, instrument, warn, Span};
pub mod bal;
mod configured_sparse_trie;
pub mod executor;
pub mod multiproof;
@@ -108,8 +106,6 @@ where
cross_block_cache_size: u64,
/// Whether transactions should not be executed on prewarming task.
disable_transaction_prewarming: bool,
/// Whether state cache should be disable
disable_state_cache: bool,
/// Determines how to configure the evm for execution.
evm_config: Evm,
/// Whether precompile cache should be disabled.
@@ -153,7 +149,6 @@ where
cross_block_cache_size: config.cross_block_cache_size(),
disable_transaction_prewarming: config.disable_prewarming(),
evm_config,
disable_state_cache: config.disable_state_cache(),
precompile_cache_disabled: config.precompile_cache_disabled(),
precompile_cache_map,
sparse_state_trie: Arc::default(),
@@ -214,7 +209,6 @@ where
provider_builder: StateProviderBuilder<N, P>,
multiproof_provider_factory: F,
config: &TreeConfig,
bal: Option<Arc<BlockAccessList>>,
) -> PayloadHandle<WithTxEnv<TxEnvFor<Evm>, I::Tx>, I::Error>
where
P: BlockReader + StateProviderFactory + StateReader + Clone + 'static,
@@ -255,45 +249,19 @@ where
// wire the multiproof task to the prewarm task
let to_multi_proof = Some(multi_proof_task.state_root_message_sender());
// Handle BAL-based optimization if available
let prewarm_handle = if let Some(bal) = bal {
// When BAL is present, skip spawning prewarm tasks entirely and send BAL to multiproof
debug!(target: "engine::tree::payload_processor", "BAL present, skipping prewarm tasks");
// Send BAL message immediately to MultiProofTask
if let Some(ref sender) = to_multi_proof &&
let Err(err) = sender.send(MultiProofMessage::BlockAccessList(bal))
{
// In this case state root validation will simply fail
error!(target: "engine::tree::payload_processor", ?err, "Failed to send BAL to MultiProofTask");
}
// Spawn minimal cache-only task without prewarming
self.spawn_caching_with(
env,
prewarm_rx,
transaction_count_hint,
provider_builder.clone(),
None, // Don't send proof targets when BAL is present
)
} else {
// Normal path: spawn with full prewarming
self.spawn_caching_with(
env,
prewarm_rx,
transaction_count_hint,
provider_builder.clone(),
to_multi_proof.clone(),
)
};
let prewarm_handle = self.spawn_caching_with(
env,
prewarm_rx,
transaction_count_hint,
provider_builder,
to_multi_proof.clone(),
);
// spawn multi-proof task
let parent_span = span.clone();
self.executor.spawn_blocking(move || {
let _enter = parent_span.entered();
// Build a state provider for the multiproof task
let provider = provider_builder.build().expect("failed to build provider");
multi_proof_task.run(provider);
multi_proof_task.run();
});
// wire the sparse trie to the state root response receiver
@@ -347,32 +315,36 @@ where
usize,
) {
let (transactions, convert) = transactions.into();
let transactions = transactions.into_par_iter();
let transaction_count_hint = transactions.len();
let transactions = transactions.into_iter();
// Get the transaction count for prewarming task
// Use upper bound if available (more accurate), otherwise use lower bound
let (lower, upper) = transactions.size_hint();
let transaction_count_hint = upper.unwrap_or(lower);
let (ooo_tx, ooo_rx) = mpsc::channel();
let (prewarm_tx, prewarm_rx) = mpsc::channel();
let (execute_tx, execute_rx) = mpsc::channel();
// Spawn a task that `convert`s all transactions in parallel and sends them out-of-order.
// Spawn a task that iterates through all transactions in parallel and sends them to the
// main task.
let (tx, rx) = mpsc::channel();
self.executor.spawn_blocking(move || {
transactions.enumerate().for_each_with(ooo_tx, |ooo_tx, (idx, tx)| {
transactions.enumerate().par_bridge().for_each_with(tx, |sender, (idx, tx)| {
let tx = convert(tx);
let tx = tx.map(|tx| WithTxEnv { tx_env: tx.to_tx_env(), tx: Arc::new(tx) });
// Only send Ok(_) variants to prewarming task.
if let Ok(tx) = &tx {
let _ = prewarm_tx.send(tx.clone());
}
let _ = ooo_tx.send((idx, tx));
let _ = sender.send((idx, tx));
});
});
// Spawn a task that processes out-of-order transactions from the task above and sends them
// to the execution task in order.
// to prewarming and execution tasks.
let (prewarm_tx, prewarm_rx) = mpsc::channel();
let (execute_tx, execute_rx) = mpsc::channel();
self.executor.spawn_blocking(move || {
let mut next_for_execution = 0;
let mut queue = BTreeMap::new();
while let Ok((idx, tx)) = ooo_rx.recv() {
while let Ok((idx, tx)) = rx.recv() {
// only send Ok(_) variants to prewarming task
if let Ok(tx) = &tx {
let _ = prewarm_tx.send(tx.clone());
}
if next_for_execution == idx {
let _ = execute_tx.send(tx);
next_for_execution += 1;
@@ -410,15 +382,9 @@ where
transactions = mpsc::channel().1;
}
let (saved_cache, cache, cache_metrics) = if self.disable_state_cache {
(None, None, None)
} else {
let saved_cache = self.cache_for(env.parent_hash);
let cache = saved_cache.cache().clone();
let cache_metrics = saved_cache.metrics().clone();
(Some(saved_cache), Some(cache), Some(cache_metrics))
};
let saved_cache = self.cache_for(env.parent_hash);
let cache = saved_cache.cache().clone();
let cache_metrics = saved_cache.metrics().clone();
// configure prewarming
let prewarm_ctx = PrewarmContext {
env,
@@ -624,18 +590,18 @@ impl<Tx, Err> PayloadHandle<Tx, Err> {
move |source: StateChangeSource, state: &EvmState| {
if let Some(sender) = &to_multi_proof {
let _ = sender.send(MultiProofMessage::StateUpdate(source.into(), state.clone()));
let _ = sender.send(MultiProofMessage::StateUpdate(source, state.clone()));
}
}
}
/// Returns a clone of the caches used by prewarming
pub(super) fn caches(&self) -> Option<StateExecutionCache> {
pub(super) fn caches(&self) -> StateExecutionCache {
self.prewarm_handle.cache.clone()
}
/// Returns a clone of the cache metrics used by prewarming
pub(super) fn cache_metrics(&self) -> Option<CachedStateMetrics> {
pub(super) fn cache_metrics(&self) -> CachedStateMetrics {
self.prewarm_handle.cache_metrics.clone()
}
@@ -665,9 +631,9 @@ impl<Tx, Err> PayloadHandle<Tx, Err> {
#[derive(Debug)]
pub(crate) struct CacheTaskHandle {
/// The shared cache the task operates with.
cache: Option<StateExecutionCache>,
cache: StateExecutionCache,
/// Metrics for the caches
cache_metrics: Option<CachedStateMetrics>,
cache_metrics: CachedStateMetrics,
/// Channel to the spawned prewarm task if any
to_prewarm_task: Option<std::sync::mpsc::Sender<PrewarmTaskEvent>>,
}
@@ -1006,10 +972,12 @@ mod tests {
nonce: rng.random::<u64>(),
code_hash: KECCAK_EMPTY,
code: Some(Default::default()),
storage_id: None,
},
storage,
status: AccountStatus::Touched,
transaction_id: 0,
..Default::default()
};
state_update.insert(address, account);
@@ -1082,17 +1050,19 @@ mod tests {
let provider_factory = BlockchainProvider::new(factory).unwrap();
let mut handle = payload_processor.spawn(
Default::default(),
(
Vec::<Result<Recovered<TransactionSigned>, core::convert::Infallible>>::new(),
std::convert::identity,
),
StateProviderBuilder::new(provider_factory.clone(), genesis_hash, None),
OverlayStateProviderFactory::new(provider_factory),
&TreeConfig::default(),
None, // No BAL for test
);
let mut handle =
payload_processor.spawn(
Default::default(),
(
core::iter::empty::<
Result<Recovered<TransactionSigned>, core::convert::Infallible>,
>(),
std::convert::identity,
),
StateProviderBuilder::new(provider_factory.clone(), genesis_hash, None),
OverlayStateProviderFactory::new(provider_factory),
&TreeConfig::default(),
);
let mut state_hook = handle.state_hook();

View File

@@ -1,7 +1,5 @@
//! Multiproof task related functionality.
use crate::tree::payload_processor::bal::bal_to_hashed_post_state;
use alloy_eip7928::BlockAccessList;
use alloy_evm::block::StateChangeSource;
use alloy_primitives::{
keccak256,
@@ -13,7 +11,6 @@ use dashmap::DashMap;
use derive_more::derive::Deref;
use metrics::{Gauge, Histogram};
use reth_metrics::Metrics;
use reth_provider::AccountReader;
use reth_revm::state::EvmState;
use reth_trie::{
added_removed_keys::MultiAddedRemovedKeys, DecodedMultiProof, HashedPostState, HashedStorage,
@@ -29,30 +26,6 @@ use reth_trie_parallel::{
use std::{collections::BTreeMap, mem, ops::DerefMut, sync::Arc, time::Instant};
use tracing::{debug, error, instrument, trace};
/// Source of state changes, either from EVM execution or from a Block Access List.
#[derive(Clone, Copy)]
pub enum Source {
/// State changes from EVM execution.
Evm(StateChangeSource),
/// State changes from Block Access List (EIP-7928).
BlockAccessList,
}
impl std::fmt::Debug for Source {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Evm(source) => source.fmt(f),
Self::BlockAccessList => f.write_str("BlockAccessList"),
}
}
}
impl From<StateChangeSource> for Source {
fn from(source: StateChangeSource) -> Self {
Self::Evm(source)
}
}
/// Maximum number of targets to batch together for prefetch batching.
/// Prefetches are just proof requests (no state merging), so we allow a higher cap than state
/// updates
@@ -109,7 +82,7 @@ pub(super) enum MultiProofMessage {
/// Prefetch proof targets
PrefetchProofs(MultiProofTargets),
/// New state update from transaction execution with its source
StateUpdate(Source, EvmState),
StateUpdate(StateChangeSource, EvmState),
/// State update that can be applied to the sparse trie without any new proofs.
///
/// It can be the case when all accounts and storage slots from the state update were already
@@ -120,11 +93,6 @@ pub(super) enum MultiProofMessage {
/// The state update that was used to calculate the proof
state: HashedPostState,
},
/// Block Access List (EIP-7928; BAL) containing complete state changes for the block.
///
/// When received, the task generates a single state update from the BAL and processes it.
/// No further messages are expected after receiving this variant.
BlockAccessList(Arc<BlockAccessList>),
/// Signals state update stream end.
///
/// This is triggered by block execution, indicating that no additional state updates are
@@ -312,7 +280,7 @@ impl StorageMultiproofInput {
/// Input parameters for dispatching a multiproof calculation.
#[derive(Debug)]
struct MultiproofInput {
source: Option<Source>,
source: Option<StateChangeSource>,
hashed_state_update: HashedPostState,
proof_targets: MultiProofTargets,
proof_sequence_number: u64,
@@ -386,7 +354,7 @@ impl MultiproofManager {
fn dispatch(&self, input: PendingMultiproofTask) {
// If there are no proof targets, we can just send an empty multiproof back immediately
if input.proof_targets_is_empty() {
trace!(
debug!(
sequence_number = input.proof_sequence_number(),
"No proof targets, sending empty multiproof back immediately"
);
@@ -915,19 +883,9 @@ impl MultiProofTask {
skip(self, update),
fields(accounts = update.len(), chunks = 0)
)]
fn on_state_update(&mut self, source: Source, update: EvmState) -> u64 {
fn on_state_update(&mut self, source: StateChangeSource, update: EvmState) -> u64 {
let hashed_state_update = evm_state_to_hashed_post_state(update);
self.on_hashed_state_update(source, hashed_state_update)
}
/// Processes a hashed state update and dispatches multiproofs as needed.
///
/// Returns the number of state updates dispatched (both `EmptyProof` and regular multiproofs).
fn on_hashed_state_update(
&mut self,
source: Source,
hashed_state_update: HashedPostState,
) -> u64 {
// Update removed keys based on the state update.
self.multi_added_removed_keys.update_with_state(&hashed_state_update);
@@ -1024,16 +982,12 @@ impl MultiProofTask {
/// This preserves ordering without requeuing onto the channel.
///
/// Returns `true` if done, `false` to continue.
fn process_multiproof_message<P>(
fn process_multiproof_message(
&mut self,
msg: MultiProofMessage,
ctx: &mut MultiproofBatchCtx,
batch_metrics: &mut MultiproofBatchMetrics,
provider: &P,
) -> bool
where
P: AccountReader,
{
) -> bool {
match msg {
// Prefetch proofs: batch consecutive prefetch requests up to target/message limits
MultiProofMessage::PrefetchProofs(targets) => {
@@ -1091,7 +1045,7 @@ impl MultiProofTask {
let storage_targets =
merged_targets.values().map(|slots| slots.len()).sum::<usize>();
batch_metrics.prefetch_proofs_requested += self.on_prefetch_proof(merged_targets);
trace!(
debug!(
target: "engine::tree::payload_processor::multiproof",
account_targets,
storage_targets,
@@ -1181,7 +1135,7 @@ impl MultiProofTask {
let batch_len = merged_update.len();
batch_metrics.state_update_proofs_requested +=
self.on_state_update(batch_source, merged_update);
trace!(
debug!(
target: "engine::tree::payload_processor::multiproof",
?batch_source,
len = batch_len,
@@ -1192,56 +1146,6 @@ impl MultiProofTask {
false
}
// Process Block Access List (BAL) - complete state changes provided upfront
MultiProofMessage::BlockAccessList(bal) => {
trace!(target: "engine::tree::payload_processor::multiproof", "processing MultiProofMessage::BAL");
if ctx.first_update_time.is_none() {
self.metrics
.first_update_wait_time_histogram
.record(ctx.start.elapsed().as_secs_f64());
ctx.first_update_time = Some(Instant::now());
debug!(target: "engine::tree::payload_processor::multiproof", "Started state root calculation from BAL");
}
// Convert BAL to HashedPostState and process it
match bal_to_hashed_post_state(&bal, &provider) {
Ok(hashed_state) => {
debug!(
target: "engine::tree::payload_processor::multiproof",
accounts = hashed_state.accounts.len(),
storages = hashed_state.storages.len(),
"Processing BAL state update"
);
// Use BlockAccessList as source for BAL-derived state updates
batch_metrics.state_update_proofs_requested +=
self.on_hashed_state_update(Source::BlockAccessList, hashed_state);
}
Err(err) => {
error!(target: "engine::tree::payload_processor::multiproof", ?err, "Failed to convert BAL to hashed state");
return true;
}
}
// Mark updates as finished since BAL provides complete state
ctx.updates_finished_time = Some(Instant::now());
// Check if we're done (might need to wait for proofs to complete)
if self.is_done(
batch_metrics.proofs_processed,
batch_metrics.state_update_proofs_requested,
batch_metrics.prefetch_proofs_requested,
ctx.updates_finished(),
) {
debug!(
target: "engine::tree::payload_processor::multiproof",
"BAL processed and all proofs complete, ending calculation"
);
return true;
}
false
}
// Signal that no more state updates will arrive
MultiProofMessage::FinishedStateUpdates => {
trace!(target: "engine::tree::payload_processor::multiproof", "processing MultiProofMessage::FinishedStateUpdates");
@@ -1334,10 +1238,7 @@ impl MultiProofTask {
target = "engine::tree::payload_processor::multiproof",
skip_all
)]
pub(crate) fn run<P>(mut self, provider: P)
where
P: AccountReader,
{
pub(crate) fn run(mut self) {
let mut ctx = MultiproofBatchCtx::new(Instant::now());
let mut batch_metrics = MultiproofBatchMetrics::default();
@@ -1347,7 +1248,7 @@ impl MultiProofTask {
trace!(target: "engine::tree::payload_processor::multiproof", "entering main channel receiving loop");
if let Some(msg) = ctx.pending_msg.take() {
if self.process_multiproof_message(msg, &mut ctx, &mut batch_metrics, &provider) {
if self.process_multiproof_message(msg, &mut ctx, &mut batch_metrics) {
break 'main;
}
continue;
@@ -1370,7 +1271,7 @@ impl MultiProofTask {
// Convert ProofResultMessage to SparseTrieUpdate
match proof_result.result {
Ok(proof_result_data) => {
trace!(
debug!(
target: "engine::tree::payload_processor::multiproof",
sequence = proof_result.sequence_number,
total_proofs = batch_metrics.proofs_processed,
@@ -1422,7 +1323,7 @@ impl MultiProofTask {
}
};
if self.process_multiproof_message(msg, &mut ctx, &mut batch_metrics, &provider) {
if self.process_multiproof_message(msg, &mut ctx, &mut batch_metrics) {
break 'main;
}
}
@@ -1473,7 +1374,7 @@ struct MultiproofBatchCtx {
/// Reusable buffer for accumulating prefetch targets during batching.
accumulated_prefetch_targets: Vec<MultiProofTargets>,
/// Reusable buffer for accumulating state updates during batching.
accumulated_state_updates: Vec<(Source, EvmState)>,
accumulated_state_updates: Vec<(StateChangeSource, EvmState)>,
}
impl MultiproofBatchCtx {
@@ -1591,44 +1492,34 @@ where
/// are safe to merge because they originate from the same logical execution and can be
/// coalesced to amortize proof work.
fn can_batch_state_update(
batch_source: Source,
batch_source: StateChangeSource,
batch_update: &EvmState,
next_source: Source,
next_source: StateChangeSource,
next_update: &EvmState,
) -> bool {
if !same_source(batch_source, next_source) {
if !same_state_change_source(batch_source, next_source) {
return false;
}
match (batch_source, next_source) {
(
Source::Evm(StateChangeSource::PreBlock(_)),
Source::Evm(StateChangeSource::PreBlock(_)),
) |
(
Source::Evm(StateChangeSource::PostBlock(_)),
Source::Evm(StateChangeSource::PostBlock(_)),
) => batch_update == next_update,
(StateChangeSource::PreBlock(_), StateChangeSource::PreBlock(_)) |
(StateChangeSource::PostBlock(_), StateChangeSource::PostBlock(_)) => {
batch_update == next_update
}
_ => true,
}
}
/// Checks whether two sources refer to the same origin.
fn same_source(lhs: Source, rhs: Source) -> bool {
/// Checks whether two state change sources refer to the same origin.
fn same_state_change_source(lhs: StateChangeSource, rhs: StateChangeSource) -> bool {
match (lhs, rhs) {
(
Source::Evm(StateChangeSource::Transaction(a)),
Source::Evm(StateChangeSource::Transaction(b)),
) => a == b,
(
Source::Evm(StateChangeSource::PreBlock(a)),
Source::Evm(StateChangeSource::PreBlock(b)),
) => mem::discriminant(&a) == mem::discriminant(&b),
(
Source::Evm(StateChangeSource::PostBlock(a)),
Source::Evm(StateChangeSource::PostBlock(b)),
) => mem::discriminant(&a) == mem::discriminant(&b),
(Source::BlockAccessList, Source::BlockAccessList) => true,
(StateChangeSource::Transaction(a), StateChangeSource::Transaction(b)) => a == b,
(StateChangeSource::PreBlock(a), StateChangeSource::PreBlock(b)) => {
mem::discriminant(&a) == mem::discriminant(&b)
}
(StateChangeSource::PostBlock(a), StateChangeSource::PostBlock(b)) => {
mem::discriminant(&a) == mem::discriminant(&b)
}
_ => false,
}
}
@@ -1648,8 +1539,7 @@ fn estimate_evm_state_targets(state: &EvmState) -> usize {
#[cfg(test)]
mod tests {
use super::*;
use alloy_eip7928::{AccountChanges, BalanceChange};
use alloy_primitives::{map::B256Set, Address};
use alloy_primitives::map::B256Set;
use reth_provider::{
providers::OverlayStateProviderFactory, test_utils::create_test_provider_factory,
BlockReader, DatabaseProviderFactory, PruneCheckpointReader, StageCheckpointReader,
@@ -1658,7 +1548,7 @@ mod tests {
use reth_trie::MultiProof;
use reth_trie_parallel::proof_task::{ProofTaskCtx, ProofWorkerHandle};
use revm_primitives::{B256, U256};
use std::sync::{Arc, OnceLock};
use std::sync::OnceLock;
use tokio::runtime::{Handle, Runtime};
/// Get a handle to the test runtime, creating it if necessary
@@ -2193,7 +2083,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2209,7 +2101,9 @@ mod tests {
nonce: 2,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2219,8 +2113,8 @@ mod tests {
let source = StateChangeSource::Transaction(0);
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::StateUpdate(source.into(), update1.clone())).unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), update2.clone())).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, update1.clone())).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, update2.clone())).unwrap();
let proofs_requested =
if let Ok(MultiProofMessage::StateUpdate(_src, update)) = task.rx.recv() {
@@ -2239,7 +2133,7 @@ mod tests {
assert!(merged_update.contains_key(&addr1));
assert!(merged_update.contains_key(&addr2));
task.on_state_update(source.into(), merged_update)
task.on_state_update(source, merged_update)
} else {
panic!("Expected StateUpdate message");
};
@@ -2269,7 +2163,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2283,20 +2179,20 @@ mod tests {
// Queue: A1 (immediate dispatch), B1 (batched), A2 (should become pending)
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::StateUpdate(source_a.into(), create_state_update(addr_a1, 100)))
tx.send(MultiProofMessage::StateUpdate(source_a, create_state_update(addr_a1, 100)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source_b.into(), create_state_update(addr_b1, 200)))
tx.send(MultiProofMessage::StateUpdate(source_b, create_state_update(addr_b1, 200)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source_a.into(), create_state_update(addr_a2, 300)))
tx.send(MultiProofMessage::StateUpdate(source_a, create_state_update(addr_a2, 300)))
.unwrap();
let mut pending_msg: Option<MultiProofMessage> = None;
if let Ok(MultiProofMessage::StateUpdate(first_source, _)) = task.rx.recv() {
assert!(same_source(first_source, source_a.into()));
assert!(same_state_change_source(first_source, source_a));
// Simulate batching loop for remaining messages
let mut accumulated_updates: Vec<(Source, EvmState)> = Vec::new();
let mut accumulated_updates: Vec<(StateChangeSource, EvmState)> = Vec::new();
let mut accumulated_targets = 0usize;
loop {
@@ -2344,7 +2240,7 @@ mod tests {
assert_eq!(accumulated_updates.len(), 1, "Should only batch matching sources");
let batch_source = accumulated_updates[0].0;
assert!(same_source(batch_source, source_b.into()));
assert!(same_state_change_source(batch_source, source_b));
let batch_source = accumulated_updates[0].0;
let mut merged_update = accumulated_updates.remove(0).1;
@@ -2352,7 +2248,10 @@ mod tests {
merged_update.extend(next_update);
}
assert!(same_source(batch_source, source_b.into()), "Batch should use matching source");
assert!(
same_state_change_source(batch_source, source_b),
"Batch should use matching source"
);
assert!(merged_update.contains_key(&addr_b1));
assert!(!merged_update.contains_key(&addr_a1));
assert!(!merged_update.contains_key(&addr_a2));
@@ -2362,7 +2261,7 @@ mod tests {
match pending_msg {
Some(MultiProofMessage::StateUpdate(pending_source, pending_update)) => {
assert!(same_source(pending_source, source_a.into()));
assert!(same_state_change_source(pending_source, source_a));
assert!(pending_update.contains_key(&addr_a2));
}
other => panic!("Expected pending StateUpdate with source_a, got {:?}", other),
@@ -2392,7 +2291,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2405,20 +2306,17 @@ mod tests {
// Queue: first update dispatched immediately, next two should not merge
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::StateUpdate(source.into(), create_state_update(addr1, 100)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), create_state_update(addr2, 200)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), create_state_update(addr3, 300)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(addr1, 100))).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(addr2, 200))).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(addr3, 300))).unwrap();
let mut pending_msg: Option<MultiProofMessage> = None;
if let Ok(MultiProofMessage::StateUpdate(first_source, first_update)) = task.rx.recv() {
assert!(same_source(first_source, source.into()));
assert!(same_state_change_source(first_source, source));
assert!(first_update.contains_key(&addr1));
let mut accumulated_updates: Vec<(Source, EvmState)> = Vec::new();
let mut accumulated_updates: Vec<(StateChangeSource, EvmState)> = Vec::new();
let mut accumulated_targets = 0usize;
loop {
@@ -2470,7 +2368,7 @@ mod tests {
"Second pre-block update should not merge with a different payload"
);
let (batched_source, batched_update) = accumulated_updates.remove(0);
assert!(same_source(batched_source, source.into()));
assert!(same_state_change_source(batched_source, source));
assert!(batched_update.contains_key(&addr2));
assert!(!batched_update.contains_key(&addr3));
@@ -2520,7 +2418,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2537,7 +2437,9 @@ mod tests {
nonce: 2,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2550,8 +2452,8 @@ mod tests {
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::PrefetchProofs(targets1)).unwrap();
tx.send(MultiProofMessage::PrefetchProofs(targets2)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), state_update1)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), state_update2)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, state_update1)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, state_update2)).unwrap();
tx.send(MultiProofMessage::PrefetchProofs(targets3.clone())).unwrap();
// Step 1: Receive and batch PrefetchProofs (should get targets1 + targets2)
@@ -2618,7 +2520,6 @@ mod tests {
use revm_state::Account;
let test_provider_factory = create_test_provider_factory();
let test_provider = test_provider_factory.latest().unwrap();
let mut task = create_test_state_root_task(test_provider_factory);
// Queue: Prefetch1, StateUpdate, Prefetch2
@@ -2639,7 +2540,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2650,7 +2553,7 @@ mod tests {
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::PrefetchProofs(prefetch1)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source.into(), state_update)).unwrap();
tx.send(MultiProofMessage::StateUpdate(source, state_update)).unwrap();
tx.send(MultiProofMessage::PrefetchProofs(prefetch2.clone())).unwrap();
let mut ctx = MultiproofBatchCtx::new(Instant::now());
@@ -2659,22 +2562,12 @@ mod tests {
// First message: Prefetch1 batches; StateUpdate becomes pending.
let first = task.rx.recv().unwrap();
assert!(matches!(first, MultiProofMessage::PrefetchProofs(_)));
assert!(!task.process_multiproof_message(
first,
&mut ctx,
&mut batch_metrics,
&test_provider
));
assert!(!task.process_multiproof_message(first, &mut ctx, &mut batch_metrics));
let pending = ctx.pending_msg.take().expect("pending message captured");
assert!(matches!(pending, MultiProofMessage::StateUpdate(_, _)));
// Pending message should be handled before the next select loop.
assert!(!task.process_multiproof_message(
pending,
&mut ctx,
&mut batch_metrics,
&test_provider
));
assert!(!task.process_multiproof_message(pending, &mut ctx, &mut batch_metrics));
// Prefetch2 should now be in pending_msg (captured by StateUpdate's batching loop).
match ctx.pending_msg.take() {
@@ -2732,7 +2625,9 @@ mod tests {
nonce: 1,
code_hash: Default::default(),
code: Default::default(),
storage_id: Some(0),
},
original_info: Default::default(),
transaction_id: Default::default(),
storage: Default::default(),
status: revm_state::AccountStatus::Touched,
@@ -2746,21 +2641,12 @@ mod tests {
// Queue: [Prefetch1, State1, State2, State3, Prefetch2]
let tx = task.state_root_message_sender();
tx.send(MultiProofMessage::PrefetchProofs(prefetch1.clone())).unwrap();
tx.send(MultiProofMessage::StateUpdate(
source.into(),
create_state_update(state_addr1, 100),
))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(
source.into(),
create_state_update(state_addr2, 200),
))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(
source.into(),
create_state_update(state_addr3, 300),
))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(state_addr1, 100)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(state_addr2, 200)))
.unwrap();
tx.send(MultiProofMessage::StateUpdate(source, create_state_update(state_addr3, 300)))
.unwrap();
tx.send(MultiProofMessage::PrefetchProofs(prefetch2.clone())).unwrap();
// Simulate the state-machine loop behavior
@@ -2833,44 +2719,4 @@ mod tests {
_ => panic!("Prefetch2 was lost!"),
}
}
/// Verifies that BAL messages are processed correctly and generate state updates.
#[test]
fn test_bal_message_processing() {
let test_provider_factory = create_test_provider_factory();
let test_provider = test_provider_factory.latest().unwrap();
let mut task = create_test_state_root_task(test_provider_factory);
// Create a simple BAL with one account change
let account_address = Address::random();
let account_changes = AccountChanges {
address: account_address,
balance_changes: vec![BalanceChange::new(0, U256::from(1000))],
nonce_changes: vec![],
code_changes: vec![],
storage_changes: vec![],
storage_reads: vec![],
};
let bal = Arc::new(vec![account_changes]);
let mut ctx = MultiproofBatchCtx::new(Instant::now());
let mut batch_metrics = MultiproofBatchMetrics::default();
let should_finish = task.process_multiproof_message(
MultiProofMessage::BlockAccessList(bal),
&mut ctx,
&mut batch_metrics,
&test_provider,
);
// BAL should mark updates as finished
assert!(ctx.updates_finished_time.is_some());
// Should have dispatched state update proofs
assert!(batch_metrics.state_update_proofs_requested > 0);
// Should need to wait for the results of those proofs to arrive
assert!(!should_finish, "Should continue waiting for proofs");
}
}

View File

@@ -29,7 +29,7 @@ use metrics::{Counter, Gauge, Histogram};
use reth_evm::{execute::ExecutableTxFor, ConfigureEvm, Evm, EvmFor, SpecFor};
use reth_metrics::Metrics;
use reth_primitives_traits::NodePrimitives;
use reth_provider::{BlockReader, StateProviderBox, StateProviderFactory, StateReader};
use reth_provider::{BlockReader, StateProviderFactory, StateReader};
use reth_revm::{database::StateProviderDatabase, db::BundleState, state::EvmState};
use reth_trie::MultiProofTargets;
use std::{
@@ -255,35 +255,31 @@ where
self;
let hash = env.hash;
if let Some(saved_cache) = saved_cache {
debug!(target: "engine::caching", parent_hash=?hash, "Updating execution cache");
// Perform all cache operations atomically under the lock
execution_cache.update_with_guard(|cached| {
// consumes the `SavedCache` held by the prewarming task, which releases its usage
// guard
let (caches, cache_metrics) = saved_cache.split();
let new_cache = SavedCache::new(hash, caches, cache_metrics);
debug!(target: "engine::caching", parent_hash=?hash, "Updating execution cache");
// Perform all cache operations atomically under the lock
execution_cache.update_with_guard(|cached| {
// consumes the `SavedCache` held by the prewarming task, which releases its usage guard
let (caches, cache_metrics) = saved_cache.split();
let new_cache = SavedCache::new(hash, caches, cache_metrics);
// Insert state into cache while holding the lock
if new_cache.cache().insert_state(&state).is_err() {
// Clear the cache on error to prevent having a polluted cache
*cached = None;
debug!(target: "engine::caching", "cleared execution cache on update error");
return;
}
// Insert state into cache while holding the lock
if new_cache.cache().insert_state(&state).is_err() {
// Clear the cache on error to prevent having a polluted cache
*cached = None;
debug!(target: "engine::caching", "cleared execution cache on update error");
return;
}
new_cache.update_metrics();
new_cache.update_metrics();
// Replace the shared cache with the new one; the previous cache (if any) is
// dropped.
*cached = Some(new_cache);
});
// Replace the shared cache with the new one; the previous cache (if any) is dropped.
*cached = Some(new_cache);
});
let elapsed = start.elapsed();
debug!(target: "engine::caching", parent_hash=?hash, elapsed=?elapsed, "Updated execution cache");
let elapsed = start.elapsed();
debug!(target: "engine::caching", parent_hash=?hash, elapsed=?elapsed, "Updated execution cache");
metrics.cache_saving_duration.set(elapsed.as_secs_f64());
}
metrics.cache_saving_duration.set(elapsed.as_secs_f64());
}
/// Executes the task.
@@ -360,7 +356,7 @@ where
{
pub(super) env: ExecutionEnv<Evm>,
pub(super) evm_config: Evm,
pub(super) saved_cache: Option<SavedCache>,
pub(super) saved_cache: SavedCache,
/// Provider to obtain the state
pub(super) provider: StateProviderBuilder<N, P>,
pub(super) metrics: PrewarmMetrics,
@@ -404,13 +400,10 @@ where
};
// Use the caches to create a new provider with caching
let state_provider: StateProviderBox = if let Some(saved_cache) = saved_cache {
let caches = saved_cache.cache().clone();
let cache_metrics = saved_cache.metrics().clone();
Box::new(CachedStateProvider::new_with_caches(state_provider, caches, cache_metrics))
} else {
state_provider
};
let caches = saved_cache.cache().clone();
let cache_metrics = saved_cache.metrics().clone();
let state_provider =
CachedStateProvider::new_with_caches(state_provider, caches, cache_metrics);
let state_provider = StateProviderDatabase::new(state_provider);

View File

@@ -11,11 +11,9 @@ use crate::tree::{
StateProviderDatabase, TreeConfig,
};
use alloy_consensus::transaction::Either;
use alloy_eip7928::BlockAccessList;
use alloy_eips::{eip1898::BlockWithParent, NumHash};
use alloy_evm::Evm;
use alloy_primitives::B256;
use rayon::prelude::*;
use reth_chain_state::{CanonicalInMemoryState, DeferredTrieData, ExecutedBlock};
use reth_consensus::{ConsensusError, FullConsensus};
use reth_engine_primitives::{
@@ -222,7 +220,7 @@ where
.map_err(NewPayloadError::other)?
.into();
let iter = Either::Left(iter.into_par_iter().map(Either::Left));
let iter = Either::Left(iter.into_iter().map(Either::Left));
let convert = move |tx| {
let Either::Left(tx) = tx else { unreachable!() };
convert(tx).map(Either::Left).map_err(Either::Left)
@@ -232,9 +230,8 @@ where
Ok((iter, Box::new(convert) as Box<dyn Fn(_) -> _ + Send + Sync + 'static>))
}
BlockOrPayload::Block(block) => {
let iter = Either::Right(
block.body().clone_transactions().into_par_iter().map(Either::Right),
);
let iter =
Either::Right(block.body().clone_transactions().into_iter().map(Either::Right));
let convert = move |tx: Either<_, N::SignedTx>| {
let Either::Right(tx) = tx else { unreachable!() };
tx.try_into_recovered().map(Either::Right).map_err(Either::Right)
@@ -371,7 +368,7 @@ where
)
.into())
};
let mut state_provider = ensure_ok!(provider_builder.build());
let state_provider = ensure_ok!(provider_builder.build());
drop(_enter);
// fetch parent block
@@ -402,14 +399,6 @@ where
// use prewarming background task
let txs = self.tx_iterator_for(&input)?;
// Extract the BAL, if valid and available
let block_access_list = ensure_ok!(input
.block_access_list()
.transpose()
// Eventually gets converted to a `InsertBlockErrorKind::Other`
.map_err(Box::<dyn std::error::Error + Send + Sync>::from))
.map(Arc::new);
// Spawn the appropriate processor based on strategy
let mut handle = ensure_ok!(self.spawn_payload_processor(
env.clone(),
@@ -418,24 +407,22 @@ where
parent_hash,
ctx.state(),
strategy,
block_access_list,
));
// Use cached state provider before executing, used in execution after prewarming threads
// complete
if let Some((caches, cache_metrics)) = handle.caches().zip(handle.cache_metrics()) {
state_provider = Box::new(CachedStateProvider::new_with_caches(
state_provider,
caches,
cache_metrics,
));
};
let state_provider = CachedStateProvider::new_with_caches(
state_provider,
handle.caches(),
handle.cache_metrics(),
);
// Execute the block and handle any execution errors
let (output, senders) = match if self.config.state_provider_metrics() {
let state_provider =
InstrumentedStateProvider::from_state_provider(&state_provider, "engine");
self.execute_block(&state_provider, env, &input, &mut handle)
let state_provider = InstrumentedStateProvider::from_state_provider(&state_provider);
let result = self.execute_block(&state_provider, env, &input, &mut handle);
state_provider.record_total_latency();
result
} else {
self.execute_block(&state_provider, env, &input, &mut handle)
} {
@@ -615,12 +602,14 @@ where
Evm: ConfigureEngineEvm<T::ExecutionData, Primitives = N>,
{
debug!(target: "engine::tree::payload_validator", "Executing block");
let mut db = State::builder()
.with_database(StateProviderDatabase::new(&state_provider))
.with_bundle_update()
.with_bal_builder() //TODO
.without_state_clear()
.build();
db.bal_state.bal_index = 0;
db.bal_state.bal_builder = Some(revm::state::bal::Bal::new());
let evm = self.evm_config.evm_with_env(&mut db, env.evm_env.clone());
let ctx =
@@ -788,7 +777,6 @@ where
parent_hash: B256,
state: &EngineApiTreeState<N>,
strategy: StateRootStrategy,
block_access_list: Option<Arc<BlockAccessList>>,
) -> Result<
PayloadHandle<
impl ExecutableTxFor<Evm> + use<N, P, Evm, V, T>,
@@ -818,14 +806,12 @@ where
.record(trie_input_start.elapsed().as_secs_f64());
let spawn_start = Instant::now();
let handle = self.payload_processor.spawn(
env,
txs,
provider_builder,
multiproof_provider_factory,
&self.config,
block_access_list,
);
// record prewarming initialization duration
@@ -888,7 +874,7 @@ where
/// Note: Use state root task only if prefix sets are empty, otherwise proof generation is
/// too expensive because it requires walking all paths in every proof.
const fn plan_state_root_computation(&self) -> StateRootStrategy {
if self.config.state_root_fallback() {
if self.config.state_root_fallback() || !self.config.has_enough_parallelism() {
StateRootStrategy::Synchronous
} else if self.config.use_state_root_task() {
StateRootStrategy::StateRootTask
@@ -1259,10 +1245,4 @@ impl<T: PayloadTypes> BlockOrPayload<T> {
Self::Block(_) => "block",
}
}
/// Returns the block access list if available.
pub const fn block_access_list(&self) -> Option<Result<BlockAccessList, alloy_rlp::Error>> {
// TODO decode and return `BlockAccessList`
None
}
}

View File

@@ -276,9 +276,9 @@ mod tests {
let dyn_precompile: DynPrecompile = (|_input: PrecompileInput<'_>| -> PrecompileResult {
Ok(PrecompileOutput {
gas_used: 0,
gas_refunded: 0,
bytes: Bytes::default(),
reverted: false,
gas_refunded: 0,
})
})
.into();
@@ -288,9 +288,9 @@ mod tests {
let output = PrecompileOutput {
gas_used: 50,
gas_refunded: 0,
bytes: alloy_primitives::Bytes::copy_from_slice(b"cached_result"),
reverted: false,
gas_refunded: 0,
};
let key = CacheKey::new(SpecId::PRAGUE, b"test_input".into());
@@ -321,9 +321,9 @@ mod tests {
Ok(PrecompileOutput {
gas_used: 5000,
gas_refunded: 0,
bytes: alloy_primitives::Bytes::copy_from_slice(b"output_from_precompile_1"),
reverted: false,
gas_refunded: 0,
})
}
})
@@ -336,9 +336,9 @@ mod tests {
Ok(PrecompileOutput {
gas_used: 7000,
gas_refunded: 0,
bytes: alloy_primitives::Bytes::copy_from_slice(b"output_from_precompile_2"),
reverted: false,
gas_refunded: 0,
})
}
})

View File

@@ -16,7 +16,7 @@ reth-primitives-traits.workspace = true
reth-errors.workspace = true
reth-chainspec.workspace = true
reth-fs-util.workspace = true
reth-engine-primitives = { workspace = true, features = ["std"] }
reth-engine-primitives.workspace = true
reth-engine-tree.workspace = true
reth-evm.workspace = true
reth-revm.workspace = true
@@ -27,6 +27,9 @@ reth-payload-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true
# revm
revm.workspace = true
# async
tokio = { workspace = true, default-features = false }
tokio-util.workspace = true

View File

@@ -283,8 +283,12 @@ where
let mut state = State::builder()
.with_database_ref(StateProviderDatabase::new(&state_provider))
.with_bundle_update()
.with_bal_builder()
.build();
state.bal_state.bal_index = 0;
state.bal_state.bal_builder = Some(revm::state::bal::Bal::new());
let ctx = evm_config.context_for_block(&reorg_target).map_err(RethError::other)?;
let evm = evm_config.evm_for_block(&mut state, &reorg_target).map_err(RethError::other)?;
let mut builder = evm_config.create_block_builder(evm, &reorg_target_parent, ctx);

View File

@@ -150,12 +150,6 @@ where
let era1_id = Era1Id::new(&config.network, start_block, block_count as u32)
.with_hash(historical_root);
let era1_id = if config.max_blocks_per_file == MAX_BLOCKS_PER_ERA1 as u64 {
era1_id
} else {
era1_id.with_era_count()
};
debug!("Final file name {}", era1_id.to_file_name());
let file_path = config.dir.join(era1_id.to_file_name());
let file = std::fs::File::create(&file_path)?;

View File

@@ -24,7 +24,7 @@ fn test_export_with_genesis_only() {
assert!(file_path.exists(), "Exported file should exist on disk");
let file_name = file_path.file_name().unwrap().to_str().unwrap();
assert!(
file_name.starts_with("mainnet-00000-"),
file_name.starts_with("mainnet-00000-00001-"),
"File should have correct prefix with era format"
);
assert!(file_name.ends_with(".era1"), "File should have correct extension");

View File

@@ -30,11 +30,8 @@ pub trait EraFileFormat: Sized {
/// Era file identifiers
pub trait EraFileId: Clone {
/// File type for this identifier
const FILE_TYPE: EraFileType;
/// Number of items, slots for `era`, blocks for `era1`, per era
const ITEMS_PER_ERA: u64;
/// Convert to standardized file name
fn to_file_name(&self) -> String;
/// Get the network name
fn network_name(&self) -> &str;
@@ -44,43 +41,6 @@ pub trait EraFileId: Clone {
/// Get the count of items
fn count(&self) -> u32;
/// Get the optional hash identifier
fn hash(&self) -> Option<[u8; 4]>;
/// Whether to include era count in filename
fn include_era_count(&self) -> bool;
/// Calculate era number
fn era_number(&self) -> u64 {
self.start_number() / Self::ITEMS_PER_ERA
}
/// Calculate the number of eras spanned per file.
///
/// If the user can decide how many slots/blocks per era file there are, we need to calculate
/// it. Most of the time it should be 1, but it can never be more than 2 eras per file
/// as there is a maximum of 8192 slots/blocks per era file.
fn era_count(&self) -> u64 {
if self.count() == 0 {
return 0;
}
let first_era = self.era_number();
let last_number = self.start_number() + self.count() as u64 - 1;
let last_era = last_number / Self::ITEMS_PER_ERA;
last_era - first_era + 1
}
/// Convert to standardized file name.
fn to_file_name(&self) -> String {
Self::FILE_TYPE.format_filename(
self.network_name(),
self.era_number(),
self.hash(),
self.include_era_count(),
self.era_count(),
)
}
}
/// [`StreamReader`] for reading era-format files
@@ -194,37 +154,6 @@ impl EraFileType {
}
}
/// Generate era file name.
///
/// Standard format: `<config-name>-<era-number>-<short-historical-root>.<ext>`
/// See also <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md#file-name>
///
/// With era count (for custom exports):
/// `<config-name>-<era-number>-<era-count>-<short-historical-root>.<ext>`
pub fn format_filename(
&self,
network_name: &str,
era_number: u64,
hash: Option<[u8; 4]>,
include_era_count: bool,
era_count: u64,
) -> String {
let hash = format_hash(hash);
if include_era_count {
format!(
"{}-{:05}-{:05}-{}{}",
network_name,
era_number,
era_count,
hash,
self.extension()
)
} else {
format!("{}-{:05}-{}{}", network_name, era_number, hash, self.extension())
}
}
/// Detect file type from URL
/// By default, it assumes `Era` type
pub fn from_url(url: &str) -> Self {
@@ -235,11 +164,3 @@ impl EraFileType {
}
}
}
/// Format hash as hex string, or placeholder if none
pub fn format_hash(hash: Option<[u8; 4]>) -> String {
match hash {
Some(h) => format!("{:02x}{:02x}{:02x}{:02x}", h[0], h[1], h[2], h[3]),
None => "00000000".to_string(),
}
}

View File

@@ -3,7 +3,7 @@
//! See also <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md>
use crate::{
common::file_ops::{EraFileId, EraFileType},
common::file_ops::EraFileId,
e2s::types::{Entry, IndexEntry, SLOT_INDEX},
era::types::consensus::{CompressedBeaconState, CompressedSignedBeaconBlock},
};
@@ -163,22 +163,12 @@ pub struct EraId {
/// Optional hash identifier for this file
/// First 4 bytes of the last historical root in the last state in the era file
pub hash: Option<[u8; 4]>,
/// Whether to include era count in filename
/// It is used for custom exports when we don't use the max number of items per file
include_era_count: bool,
}
impl EraId {
/// Create a new [`EraId`]
pub fn new(network_name: impl Into<String>, start_slot: u64, slot_count: u32) -> Self {
Self {
network_name: network_name.into(),
start_slot,
slot_count,
hash: None,
include_era_count: false,
}
Self { network_name: network_name.into(), start_slot, slot_count, hash: None }
}
/// Add a hash identifier to [`EraId`]
@@ -187,18 +177,32 @@ impl EraId {
self
}
/// Include era count in filename, for custom slot-per-file exports
pub const fn with_era_count(mut self) -> Self {
self.include_era_count = true;
self
/// Calculate which era number the file starts at
pub const fn era_number(&self) -> u64 {
self.start_slot / SLOTS_PER_HISTORICAL_ROOT
}
// Helper function to calculate the number of eras per era1 file,
// If the user can decide how many blocks per era1 file there are, we need to calculate it.
// Most of the time it should be 1, but it can never be more than 2 eras per file
// as there is a maximum of 8192 blocks per era1 file.
const fn calculate_era_count(&self) -> u64 {
if self.slot_count == 0 {
return 0;
}
let first_era = self.era_number();
// Calculate the actual last slot number in the range
let last_slot = self.start_slot + self.slot_count as u64 - 1;
// Find which era the last block belongs to
let last_era = last_slot / SLOTS_PER_HISTORICAL_ROOT;
// Count how many eras we span
last_era - first_era + 1
}
}
impl EraFileId for EraId {
const FILE_TYPE: EraFileType = EraFileType::Era;
const ITEMS_PER_ERA: u64 = SLOTS_PER_HISTORICAL_ROOT;
fn network_name(&self) -> &str {
&self.network_name
}
@@ -210,13 +214,24 @@ impl EraFileId for EraId {
fn count(&self) -> u32 {
self.slot_count
}
/// Convert to file name following the era file naming:
/// `<config-name>-<era-number>-<era-count>-<short-historical-root>.era`
/// <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md#file-name>
/// See also <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md>
fn to_file_name(&self) -> String {
let era_number = self.era_number();
let era_count = self.calculate_era_count();
fn hash(&self) -> Option<[u8; 4]> {
self.hash
}
fn include_era_count(&self) -> bool {
self.include_era_count
if let Some(hash) = self.hash {
format!(
"{}-{:05}-{:05}-{:02x}{:02x}{:02x}{:02x}.era",
self.network_name, era_number, era_count, hash[0], hash[1], hash[2], hash[3]
)
} else {
// era spec format with placeholder hash when no hash available
// Format: `<config-name>-<era-number>-<era-count>-00000000.era`
format!("{}-{:05}-{:05}-00000000.era", self.network_name, era_number, era_count)
}
}
}
@@ -384,40 +399,4 @@ mod tests {
let parsed_offset = index.offsets[0];
assert_eq!(parsed_offset, -1024);
}
#[test_case::test_case(
EraId::new("mainnet", 0, 8192).with_hash([0x4b, 0x36, 0x3d, 0xb9]),
"mainnet-00000-4b363db9.era";
"Mainnet era 0"
)]
#[test_case::test_case(
EraId::new("mainnet", 8192, 8192).with_hash([0x40, 0xcf, 0x2f, 0x3c]),
"mainnet-00001-40cf2f3c.era";
"Mainnet era 1"
)]
#[test_case::test_case(
EraId::new("mainnet", 0, 8192),
"mainnet-00000-00000000.era";
"Without hash"
)]
fn test_era_id_file_naming(id: EraId, expected_file_name: &str) {
let actual_file_name = id.to_file_name();
assert_eq!(actual_file_name, expected_file_name);
}
// File naming with era-count, for custom exports
#[test_case::test_case(
EraId::new("mainnet", 0, 8192).with_hash([0x4b, 0x36, 0x3d, 0xb9]).with_era_count(),
"mainnet-00000-00001-4b363db9.era";
"Mainnet era 0 with count"
)]
#[test_case::test_case(
EraId::new("mainnet", 8000, 500).with_hash([0xab, 0xcd, 0xef, 0x12]).with_era_count(),
"mainnet-00000-00002-abcdef12.era";
"Spanning two eras with count"
)]
fn test_era_id_file_naming_with_era_count(id: EraId, expected_file_name: &str) {
let actual_file_name = id.to_file_name();
assert_eq!(actual_file_name, expected_file_name);
}
}

View File

@@ -39,6 +39,7 @@
//! transactions: vec![Bytes::from(vec![1, 2, 3])],
//! ommers: vec![],
//! withdrawals: None,
//! block_access_list: None,
//! };
//! // Compress the body: rlp encoding and snappy compression
//! let compressed_body = CompressedBody::from_body(&body)?;
@@ -581,8 +582,12 @@ mod tests {
#[test]
fn test_block_body_conversion() {
let block_body: BlockBody<Bytes> =
BlockBody { transactions: vec![], ommers: vec![], withdrawals: None };
let block_body: BlockBody<Bytes> = BlockBody {
transactions: vec![],
ommers: vec![],
withdrawals: None,
block_access_list: None,
};
let compressed_body = CompressedBody::from_body(&block_body).unwrap();
@@ -637,7 +642,8 @@ mod tests {
let withdrawals = Some(Withdrawals(vec![]));
let block_body = BlockBody { transactions, ommers: vec![], withdrawals };
let block_body =
BlockBody { transactions, ommers: vec![], withdrawals, block_access_list: None };
let block = Block::new(header, block_body);

View File

@@ -3,7 +3,7 @@
//! See also <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era1.md>
use crate::{
common::file_ops::{EraFileId, EraFileType},
common::file_ops::EraFileId,
e2s::types::{Entry, IndexEntry},
era1::types::execution::{Accumulator, BlockTuple, MAX_BLOCKS_PER_ERA1},
};
@@ -105,10 +105,6 @@ pub struct Era1Id {
/// Optional hash identifier for this file
/// First 4 bytes of the last historical root in the last state in the era file
pub hash: Option<[u8; 4]>,
/// Whether to include era count in filename
/// It is used for custom exports when we don't use the max number of items per file
pub include_era_count: bool,
}
impl Era1Id {
@@ -118,13 +114,7 @@ impl Era1Id {
start_block: BlockNumber,
block_count: u32,
) -> Self {
Self {
network_name: network_name.into(),
start_block,
block_count,
hash: None,
include_era_count: false,
}
Self { network_name: network_name.into(), start_block, block_count, hash: None }
}
/// Add a hash identifier to [`Era1Id`]
@@ -133,17 +123,21 @@ impl Era1Id {
self
}
/// Include era count in filename, for custom block-per-file exports
pub const fn with_era_count(mut self) -> Self {
self.include_era_count = true;
self
// Helper function to calculate the number of eras per era1 file,
// If the user can decide how many blocks per era1 file there are, we need to calculate it.
// Most of the time it should be 1, but it can never be more than 2 eras per file
// as there is a maximum of 8192 blocks per era1 file.
const fn calculate_era_count(&self, first_era: u64) -> u64 {
// Calculate the actual last block number in the range
let last_block = self.start_block + self.block_count as u64 - 1;
// Find which era the last block belongs to
let last_era = last_block / MAX_BLOCKS_PER_ERA1 as u64;
// Count how many eras we span
last_era - first_era + 1
}
}
impl EraFileId for Era1Id {
const FILE_TYPE: EraFileType = EraFileType::Era1;
const ITEMS_PER_ERA: u64 = MAX_BLOCKS_PER_ERA1 as u64;
fn network_name(&self) -> &str {
&self.network_name
}
@@ -155,13 +149,24 @@ impl EraFileId for Era1Id {
fn count(&self) -> u32 {
self.block_count
}
fn hash(&self) -> Option<[u8; 4]> {
self.hash
}
fn include_era_count(&self) -> bool {
self.include_era_count
/// Convert to file name following the era file naming:
/// `<config-name>-<era-number>-<era-count>-<short-historical-root>.era(1)`
/// <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md#file-name>
/// See also <https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era1.md>
fn to_file_name(&self) -> String {
// Find which era the first block belongs to
let era_number = self.start_block / MAX_BLOCKS_PER_ERA1 as u64;
let era_count = self.calculate_era_count(era_number);
if let Some(hash) = self.hash {
format!(
"{}-{:05}-{:05}-{:02x}{:02x}{:02x}{:02x}.era1",
self.network_name, era_number, era_count, hash[0], hash[1], hash[2], hash[3]
)
} else {
// era spec format with placeholder hash when no hash available
// Format: `<config-name>-<era-number>-<era-count>-00000000.era1`
format!("{}-{:05}-{:05}-00000000.era1", self.network_name, era_number, era_count)
}
}
}
@@ -309,51 +314,35 @@ mod tests {
#[test_case::test_case(
Era1Id::new("mainnet", 0, 8192).with_hash([0x5e, 0xc1, 0xff, 0xb8]),
"mainnet-00000-5ec1ffb8.era1";
"mainnet-00000-00001-5ec1ffb8.era1";
"Mainnet era 0"
)]
#[test_case::test_case(
Era1Id::new("mainnet", 8192, 8192).with_hash([0x5e, 0xcb, 0x9b, 0xf9]),
"mainnet-00001-5ecb9bf9.era1";
"mainnet-00001-00001-5ecb9bf9.era1";
"Mainnet era 1"
)]
#[test_case::test_case(
Era1Id::new("sepolia", 0, 8192).with_hash([0x90, 0x91, 0x84, 0x72]),
"sepolia-00000-90918472.era1";
"sepolia-00000-00001-90918472.era1";
"Sepolia era 0"
)]
#[test_case::test_case(
Era1Id::new("sepolia", 155648, 8192).with_hash([0xfa, 0x77, 0x00, 0x19]),
"sepolia-00019-fa770019.era1";
"sepolia-00019-00001-fa770019.era1";
"Sepolia era 19"
)]
#[test_case::test_case(
Era1Id::new("mainnet", 1000, 100),
"mainnet-00000-00000000.era1";
"mainnet-00000-00001-00000000.era1";
"ID without hash"
)]
#[test_case::test_case(
Era1Id::new("sepolia", 101130240, 8192).with_hash([0xab, 0xcd, 0xef, 0x12]),
"sepolia-12345-abcdef12.era1";
"sepolia-12345-00001-abcdef12.era1";
"Large block number era 12345"
)]
fn test_era1_id_file_naming(id: Era1Id, expected_file_name: &str) {
let actual_file_name = id.to_file_name();
assert_eq!(actual_file_name, expected_file_name);
}
// File naming with era-count, for custom exports
#[test_case::test_case(
Era1Id::new("mainnet", 0, 8192).with_hash([0x5e, 0xc1, 0xff, 0xb8]).with_era_count(),
"mainnet-00000-00001-5ec1ffb8.era1";
"Mainnet era 0 with count"
)]
#[test_case::test_case(
Era1Id::new("mainnet", 8000, 500).with_hash([0xab, 0xcd, 0xef, 0x12]).with_era_count(),
"mainnet-00000-00002-abcdef12.era1";
"Spanning two eras with count"
)]
fn test_era1_id_file_naming_with_era_count(id: Era1Id, expected_file_name: &str) {
fn test_era1id_file_naming(id: Era1Id, expected_file_name: &str) {
let actual_file_name = id.to_file_name();
assert_eq!(actual_file_name, expected_file_name);
}

View File

@@ -34,6 +34,7 @@ pub(crate) fn create_header() -> Header {
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_hash: None,
block_access_list_hash: None,
}
}
@@ -138,6 +139,7 @@ pub(crate) fn create_test_block_with_compressed_data(number: BlockNumber) -> Blo
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_hash: None,
block_access_list_hash: None,
};
// Create test body
@@ -145,6 +147,7 @@ pub(crate) fn create_test_block_with_compressed_data(number: BlockNumber) -> Blo
transactions: vec![Bytes::from(vec![(number % 256) as u8; 10])],
ommers: vec![],
withdrawals: Some(Withdrawals(vec![])),
block_access_list: None,
};
// Create test receipt list with bloom

View File

@@ -154,9 +154,7 @@ where
Commands::ImportEra(command) => runner.run_blocking_until_ctrl_c(command.execute::<N>()),
Commands::ExportEra(command) => runner.run_blocking_until_ctrl_c(command.execute::<N>()),
Commands::DumpGenesis(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Db(command) => {
runner.run_blocking_command_until_exit(|ctx| command.execute::<N>(ctx))
}
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute::<N>()),
Commands::Download(command) => runner.run_blocking_until_ctrl_c(command.execute::<N>()),
Commands::Stage(command) => {
runner.run_command_until_exit(|ctx| command.execute::<N, _>(ctx, components))

View File

@@ -22,6 +22,7 @@ reth-consensus.workspace = true
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-consensus.workspace = true
alloy-rlp.workspace = true
tracing.workspace = true
@@ -38,6 +39,7 @@ std = [
"reth-execution-types/std",
"reth-primitives-traits/std",
"tracing/std",
"alloy-rlp/std",
]
[dev-dependencies]

View File

@@ -75,7 +75,13 @@ where
block: &RecoveredBlock<N::Block>,
result: &BlockExecutionResult<N::Receipt>,
) -> Result<(), ConsensusError> {
validate_block_post_execution(block, &self.chain_spec, &result.receipts, &result.requests)
validate_block_post_execution(
block,
&self.chain_spec,
&result.receipts,
&result.requests,
&result.block_access_list,
)
}
}
@@ -176,6 +182,15 @@ where
} else if header.requests_hash().is_some() {
return Err(ConsensusError::RequestsHashUnexpected)
}
// if self.chain_spec.is_amsterdam_active_at_timestamp(header.timestamp()) &&
// header.block_access_list_hash().is_none()
// {
// return Err(ConsensusError::BlockAccessListHashMissing)
// } else if !self.chain_spec.is_amsterdam_active_at_timestamp(header.timestamp()) &&
// header.block_access_list_hash().is_some()
// {
// return Err(ConsensusError::BlockAccessListHashUnexpected)
// }
Ok(())
}

View File

@@ -1,11 +1,11 @@
use alloc::vec::Vec;
use alloy_consensus::{proofs::calculate_receipt_root, BlockHeader, TxReceipt};
use alloy_eips::{eip7685::Requests, Encodable2718};
use alloy_eips::{eip7685::Requests, eip7928::BlockAccessList, Encodable2718};
use alloy_primitives::{Bloom, Bytes, B256};
use reth_chainspec::EthereumHardforks;
use reth_consensus::ConsensusError;
use reth_primitives_traits::{
receipt::gas_spent_by_transactions, Block, GotExpected, Receipt, RecoveredBlock,
receipt::gas_spent_by_transactions, Block, BlockBody, GotExpected, Receipt, RecoveredBlock,
};
/// Validate a block with regard to execution results:
@@ -17,6 +17,7 @@ pub fn validate_block_post_execution<B, R, ChainSpec>(
chain_spec: &ChainSpec,
receipts: &[R],
requests: &Requests,
block_access_list: &Option<BlockAccessList>,
) -> Result<(), ConsensusError>
where
B: Block,
@@ -65,6 +66,33 @@ where
}
}
// Validate bal hash matches the calculated hash
if chain_spec.is_amsterdam_active_at_timestamp(block.header().timestamp()) {
let Some(header_block_access_list_hash) = block.header().block_access_list_hash() else {
return Err(ConsensusError::BlockAccessListHashMissing)
};
if let Some(bal) = block_access_list {
let bal_hash = alloy_primitives::keccak256(alloy_rlp::encode(bal));
let block_bal = block.body().block_access_list();
tracing::debug!("Block Bal :{:?}", block_bal);
if let Some(body_bal) = block_bal {
if body_bal.len() == 0 {
tracing::debug!("Hit Empty BAL : Block is {:?}", block);
}
verify_bal(body_bal, bal)?;
}
if bal_hash != header_block_access_list_hash {
tracing::debug!(
?bal_hash,
?header_block_access_list_hash,
"block access list hash mismatch"
);
return Err(ConsensusError::InvalidBalHash);
}
}
}
Ok(())
}
@@ -115,6 +143,47 @@ fn compare_receipts_root_and_logs_bloom(
Ok(())
}
/// Validates that the block access list in the body matches the expected block access list.
fn verify_bal(
body_bal: &BlockAccessList,
expected_bal: &BlockAccessList,
) -> Result<(), ConsensusError> {
if body_bal == expected_bal {
return Ok(());
}
// Extract addresses
let body_addrs: Vec<_> = body_bal.iter().map(|a| a.address).collect();
let expected_addrs: Vec<_> = expected_bal.iter().map(|a| a.address).collect();
// Missing accounts (expected but not found in body)
for addr in &expected_addrs {
if !body_addrs.contains(addr) {
tracing::debug!("Missing acc : computed bal {:?},body bal{:?}", expected_bal, body_bal);
tracing::debug!("Missing Address: {:?}", addr);
return Err(ConsensusError::InvalidBalMissingAccount);
}
}
// Extra accounts (body has accounts not in expected)
for addr in &body_addrs {
if !expected_addrs.contains(addr) {
tracing::debug!("Extra acc : computed bal {:?},body bal{:?}", expected_bal, body_bal);
tracing::debug!("Extra Address: {:?}", addr);
return Err(ConsensusError::InvalidBalExtraAccount);
}
}
tracing::debug!(
?expected_bal,
?body_bal,
"block access list in body does not match the provided block access list"
);
// Fallback: mismatched access lists
Err(ConsensusError::InvalidBlockAccessList)
}
#[cfg(test)]
mod tests {
use super::*;

View File

@@ -17,7 +17,9 @@ pub use payload::{payload_id, BlobSidecars, EthBuiltPayload, EthPayloadBuilderAt
mod error;
pub use error::*;
use alloy_rpc_types_engine::{ExecutionData, ExecutionPayload, ExecutionPayloadEnvelopeV5};
use alloy_rpc_types_engine::{
ExecutionData, ExecutionPayload, ExecutionPayloadEnvelopeV5, ExecutionPayloadEnvelopeV6,
};
pub use alloy_rpc_types_engine::{
ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3, ExecutionPayloadEnvelopeV4,
ExecutionPayloadV1, PayloadAttributes as EthPayloadAttributes,
@@ -66,13 +68,15 @@ where
+ TryInto<ExecutionPayloadEnvelopeV2>
+ TryInto<ExecutionPayloadEnvelopeV3>
+ TryInto<ExecutionPayloadEnvelopeV4>
+ TryInto<ExecutionPayloadEnvelopeV5>,
+ TryInto<ExecutionPayloadEnvelopeV5>
+ TryInto<ExecutionPayloadEnvelopeV6>,
{
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = ExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = ExecutionPayloadEnvelopeV4;
type ExecutionPayloadEnvelopeV5 = ExecutionPayloadEnvelopeV5;
type ExecutionPayloadEnvelopeV6 = ExecutionPayloadEnvelopeV6;
}
/// A default payload type for [`EthEngineTypes`]

View File

@@ -11,8 +11,9 @@ use alloy_primitives::{Address, B256, U256};
use alloy_rlp::Encodable;
use alloy_rpc_types_engine::{
BlobsBundleV1, BlobsBundleV2, ExecutionPayloadEnvelopeV2, ExecutionPayloadEnvelopeV3,
ExecutionPayloadEnvelopeV4, ExecutionPayloadEnvelopeV5, ExecutionPayloadFieldV2,
ExecutionPayloadV1, ExecutionPayloadV3, PayloadAttributes, PayloadId,
ExecutionPayloadEnvelopeV4, ExecutionPayloadEnvelopeV5, ExecutionPayloadEnvelopeV6,
ExecutionPayloadFieldV2, ExecutionPayloadV1, ExecutionPayloadV3, ExecutionPayloadV4,
PayloadAttributes, PayloadId,
};
use core::convert::Infallible;
use reth_ethereum_primitives::EthPrimitives;
@@ -158,6 +159,38 @@ impl EthBuiltPayload {
execution_requests: requests.unwrap_or_default(),
})
}
/// Try converting built payload into [`ExecutionPayloadEnvelopeV6`].
pub fn try_into_v6(self) -> Result<ExecutionPayloadEnvelopeV6, BuiltPayloadConversionError> {
let Self { block, fees, sidecars, requests, .. } = self;
let blobs_bundle = match sidecars {
BlobSidecars::Empty => BlobsBundleV2::empty(),
BlobSidecars::Eip7594(sidecars) => BlobsBundleV2::from(sidecars),
BlobSidecars::Eip4844(_) => {
return Err(BuiltPayloadConversionError::UnexpectedEip4844Sidecars)
}
};
Ok(ExecutionPayloadEnvelopeV6 {
execution_payload: ExecutionPayloadV4::from_block_unchecked(
block.hash(),
&Arc::unwrap_or_clone(block).into_block(),
),
block_value: fees,
// From the engine API spec:
//
// > Client software **MAY** use any heuristics to decide whether to set
// `shouldOverrideBuilder` flag or not. If client software does not implement any
// heuristic this flag **SHOULD** be set to `false`.
//
// Spec:
// <https://github.com/ethereum/execution-apis/blob/fe8e13c288c592ec154ce25c534e26cb7ce0530d/src/engine/cancun.md#specification-2>
should_override_builder: false,
blobs_bundle,
execution_requests: requests.unwrap_or_default(),
})
}
}
impl<N: NodePrimitives> BuiltPayload for EthBuiltPayload<N> {
@@ -225,6 +258,14 @@ impl TryFrom<EthBuiltPayload> for ExecutionPayloadEnvelopeV5 {
}
}
impl TryFrom<EthBuiltPayload> for ExecutionPayloadEnvelopeV6 {
type Error = BuiltPayloadConversionError;
fn try_from(value: EthBuiltPayload) -> Result<Self, Self::Error> {
value.try_into_v6()
}
}
/// An enum representing blob transaction sidecars belonging to [`EthBuiltPayload`].
#[derive(Clone, Default, Debug)]
pub enum BlobSidecars {

View File

@@ -27,6 +27,7 @@ alloy-eips.workspace = true
alloy-evm.workspace = true
alloy-consensus.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-rlp.workspace = true
# Misc
parking_lot = { workspace = true, optional = true }
@@ -57,6 +58,7 @@ std = [
"derive_more?/std",
"alloy-rpc-types-engine/std",
"reth-storage-errors/std",
"alloy-rlp/std",
]
test-utils = [
"dep:parking_lot",

View File

@@ -5,6 +5,7 @@ use alloy_consensus::{
};
use alloy_eips::merge::BEACON_NONCE;
use alloy_evm::{block::BlockExecutorFactory, eth::EthBlockExecutionCtx};
use alloy_primitives::Bytes;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_evm::execute::{BlockAssembler, BlockAssemblerInput, BlockExecutionError};
use reth_execution_types::BlockExecutionResult;
@@ -16,12 +17,14 @@ use revm::context::Block as _;
pub struct EthBlockAssembler<ChainSpec = reth_chainspec::ChainSpec> {
/// The chainspec.
pub chain_spec: Arc<ChainSpec>,
/// Extra data to use for the blocks.
pub extra_data: Bytes,
}
impl<ChainSpec> EthBlockAssembler<ChainSpec> {
/// Creates a new [`EthBlockAssembler`].
pub const fn new(chain_spec: Arc<ChainSpec>) -> Self {
Self { chain_spec }
pub fn new(chain_spec: Arc<ChainSpec>) -> Self {
Self { chain_spec, extra_data: Default::default() }
}
}
@@ -45,7 +48,8 @@ where
execution_ctx: ctx,
parent,
transactions,
output: BlockExecutionResult { receipts, requests, gas_used, blob_gas_used },
output:
BlockExecutionResult { receipts, requests, gas_used, blob_gas_used, block_access_list },
state_root,
..
} = input;
@@ -90,6 +94,18 @@ where
};
}
let (built_block_access_list, block_access_list_hash) =
if self.chain_spec.is_amsterdam_active_at_timestamp(timestamp) {
if let Some(bal) = block_access_list {
let hash = alloy_primitives::keccak256(alloy_rlp::encode(bal));
(Some(bal), Some(hash))
} else {
(None, None)
}
} else {
(None, None)
};
let header = Header {
parent_hash: ctx.parent_hash,
ommers_hash: EMPTY_OMMER_ROOT_HASH,
@@ -107,16 +123,22 @@ where
gas_limit: evm_env.block_env.gas_limit(),
difficulty: evm_env.block_env.difficulty(),
gas_used: *gas_used,
extra_data: ctx.extra_data,
extra_data: self.extra_data.clone(),
parent_beacon_block_root: ctx.parent_beacon_block_root,
blob_gas_used: block_blob_gas_used,
excess_blob_gas,
requests_hash,
block_access_list_hash,
};
Ok(Block {
header,
body: BlockBody { transactions, ommers: Default::default(), withdrawals },
body: BlockBody {
transactions,
ommers: Default::default(),
withdrawals,
block_access_list: built_block_access_list.cloned(),
},
})
}
}

View File

@@ -19,36 +19,31 @@ extern crate alloc;
use alloc::{borrow::Cow, sync::Arc};
use alloy_consensus::Header;
use alloy_eips::Decodable2718;
pub use alloy_evm::EthEvm;
use alloy_evm::{
eth::{EthBlockExecutionCtx, EthBlockExecutorFactory},
EthEvmFactory, FromRecoveredTx, FromTxWithEncoded,
};
use alloy_primitives::{Bytes, U256};
use alloy_rpc_types_engine::ExecutionData;
use core::{convert::Infallible, fmt::Debug};
use reth_chainspec::{ChainSpec, EthChainSpec, MAINNET};
use reth_chainspec::{ChainSpec, EthChainSpec, EthereumHardforks, MAINNET};
use reth_ethereum_primitives::{Block, EthPrimitives, TransactionSigned};
use reth_evm::{
eth::NextEvmEnvAttributes, precompiles::PrecompilesMap, ConfigureEvm, EvmEnv, EvmFactory,
NextBlockEnvAttributes, TransactionEnv,
eth::NextEvmEnvAttributes, precompiles::PrecompilesMap, ConfigureEngineEvm, ConfigureEvm,
EvmEnv, EvmEnvFor, EvmFactory, ExecutableTxIterator, ExecutionCtxFor, NextBlockEnvAttributes,
TransactionEnv,
};
use reth_primitives_traits::{SealedBlock, SealedHeader};
use revm::{context::BlockEnv, primitives::hardfork::SpecId};
#[cfg(feature = "std")]
use reth_evm::{ConfigureEngineEvm, ExecutableTxIterator};
#[allow(unused_imports)]
use {
alloy_eips::Decodable2718,
alloy_primitives::{Bytes, U256},
alloy_rpc_types_engine::ExecutionData,
reth_chainspec::EthereumHardforks,
reth_evm::{EvmEnvFor, ExecutionCtxFor},
reth_primitives_traits::{constants::MAX_TX_GAS_LIMIT_OSAKA, SignedTransaction, TxTy},
reth_storage_errors::any::AnyError,
revm::context::CfgEnv,
revm::context_interface::block::BlobExcessGasAndPrice,
use reth_primitives_traits::{
constants::MAX_TX_GAS_LIMIT_OSAKA, SealedBlock, SealedHeader, SignedTransaction, TxTy,
};
use reth_storage_errors::any::AnyError;
use revm::{
context::{BlockEnv, CfgEnv},
context_interface::block::BlobExcessGasAndPrice,
primitives::hardfork::SpecId,
};
pub use alloy_evm::EthEvm;
mod config;
use alloy_evm::eth::spec::EthExecutorSpec;
@@ -121,6 +116,12 @@ impl<ChainSpec, EvmFactory> EthEvmConfig<ChainSpec, EvmFactory> {
pub const fn chain_spec(&self) -> &Arc<ChainSpec> {
self.executor_factory.spec()
}
/// Sets the extra data for the block assembler.
pub fn with_extra_data(mut self, extra_data: Bytes) -> Self {
self.block_assembler.extra_data = extra_data;
self
}
}
impl<ChainSpec, EvmF> ConfigureEvm for EthEvmConfig<ChainSpec, EvmF>
@@ -192,7 +193,6 @@ where
parent_beacon_block_root: block.header().parent_beacon_block_root,
ommers: &block.body().ommers,
withdrawals: block.body().withdrawals.as_ref().map(Cow::Borrowed),
extra_data: block.header().extra_data.clone(),
})
}
@@ -206,12 +206,10 @@ where
parent_beacon_block_root: attributes.parent_beacon_block_root,
ommers: &[],
withdrawals: attributes.withdrawals.map(Cow::Owned),
extra_data: attributes.extra_data,
})
}
}
#[cfg(feature = "std")]
impl<ChainSpec, EvmF> ConfigureEngineEvm<ExecutionData> for EthEvmConfig<ChainSpec, EvmF>
where
ChainSpec: EthExecutorSpec + EthChainSpec<Header = Header> + Hardforks + 'static,
@@ -284,7 +282,6 @@ where
parent_beacon_block_root: payload.sidecar.parent_beacon_block_root(),
ommers: &[],
withdrawals: payload.payload.withdrawals().map(|w| Cow::Owned(w.clone().into())),
extra_data: payload.payload.as_v1().extra_data.clone(),
})
}
@@ -292,7 +289,7 @@ where
&self,
payload: &ExecutionData,
) -> Result<impl ExecutableTxIterator<Self>, Self::Error> {
let txs = payload.payload.transactions().clone();
let txs = payload.payload.transactions().clone().into_iter();
let convert = |tx: Bytes| {
let tx =
TxTy::<Self::Primitives>::decode_2718_exact(tx.as_ref()).map_err(AnyError::new)?;

View File

@@ -2,7 +2,7 @@ use crate::EthEvmConfig;
use alloc::{boxed::Box, sync::Arc, vec, vec::Vec};
use alloy_consensus::Header;
use alloy_eips::eip7685::Requests;
use alloy_evm::precompiles::PrecompilesMap;
use alloy_evm::{block::StateDB, precompiles::PrecompilesMap};
use alloy_primitives::Bytes;
use alloy_rpc_types_engine::ExecutionData;
use parking_lot::Mutex;
@@ -19,7 +19,6 @@ use reth_execution_types::{BlockExecutionResult, ExecutionOutcome};
use reth_primitives_traits::{BlockTy, SealedBlock, SealedHeader};
use revm::{
context::result::{ExecutionResult, Output, ResultAndState, SuccessReason},
database::State,
Inspector,
};
@@ -58,12 +57,12 @@ impl BlockExecutorFactory for MockEvmConfig {
fn create_executor<'a, DB, I>(
&'a self,
evm: EthEvm<&'a mut State<DB>, I, PrecompilesMap>,
evm: EthEvm<DB, I, PrecompilesMap>,
_ctx: Self::ExecutionCtx<'a>,
) -> impl BlockExecutorFor<'a, Self, DB, I>
where
DB: Database + 'a,
I: Inspector<<Self::EvmFactory as EvmFactory>::Context<&'a mut State<DB>>> + 'a,
DB: StateDB + Database + 'a,
I: Inspector<<Self::EvmFactory as EvmFactory>::Context<DB>> + 'a,
{
MockExecutor { result: self.exec_results.lock().pop().unwrap(), evm, hook: None }
}
@@ -71,17 +70,17 @@ impl BlockExecutorFactory for MockEvmConfig {
/// Mock executor that returns a fixed execution result.
#[derive(derive_more::Debug)]
pub struct MockExecutor<'a, DB: Database, I> {
pub struct MockExecutor<DB: Database, I> {
result: ExecutionOutcome,
evm: EthEvm<&'a mut State<DB>, I, PrecompilesMap>,
evm: EthEvm<DB, I, PrecompilesMap>,
#[debug(skip)]
hook: Option<Box<dyn reth_evm::OnStateHook>>,
}
impl<'a, DB: Database, I: Inspector<EthEvmContext<&'a mut State<DB>>>> BlockExecutor
for MockExecutor<'a, DB, I>
impl<DB: StateDB + Database, I: Inspector<EthEvmContext<DB>>> BlockExecutor
for MockExecutor<DB, I>
{
type Evm = EthEvm<&'a mut State<DB>, I, PrecompilesMap>;
type Evm = EthEvm<DB, I, PrecompilesMap>;
type Transaction = TransactionSigned;
type Receipt = Receipt;
@@ -125,10 +124,11 @@ impl<'a, DB: Database, I: Inspector<EthEvmContext<&'a mut State<DB>>>> BlockExec
reqs
}),
gas_used: 0,
block_access_list: None,
blob_gas_used: 0,
};
evm.db_mut().bundle_state = bundle;
*evm.db_mut().bundle_state_mut() = bundle;
Ok((evm, result))
}

View File

@@ -38,6 +38,7 @@ fn create_database_with_beacon_root_contract() -> CacheDB<EmptyDB> {
code_hash: keccak256(BEACON_ROOTS_CODE.clone()),
nonce: 1,
code: Some(Bytecode::new_raw(BEACON_ROOTS_CODE.clone())),
storage_id: None,
};
db.insert_account_info(BEACON_ROOTS_ADDRESS, beacon_root_contract_account);
@@ -53,6 +54,7 @@ fn create_database_with_withdrawal_requests_contract() -> CacheDB<EmptyDB> {
balance: U256::ZERO,
code_hash: keccak256(WITHDRAWAL_REQUEST_PREDEPLOY_CODE.clone()),
code: Some(Bytecode::new_raw(WITHDRAWAL_REQUEST_PREDEPLOY_CODE.clone())),
storage_id: None,
};
db.insert_account_info(
@@ -86,7 +88,12 @@ fn eip_4788_non_genesis_call() {
.execute_one(&RecoveredBlock::new_unhashed(
Block {
header: header.clone(),
body: BlockBody { transactions: vec![], ommers: vec![], withdrawals: None },
body: BlockBody {
transactions: vec![],
ommers: vec![],
withdrawals: None,
block_access_list: None,
},
},
vec![],
))
@@ -105,7 +112,12 @@ fn eip_4788_non_genesis_call() {
.execute_one(&RecoveredBlock::new_unhashed(
Block {
header: header.clone(),
body: BlockBody { transactions: vec![], ommers: vec![], withdrawals: None },
body: BlockBody {
transactions: vec![],
ommers: vec![],
withdrawals: None,
block_access_list: None,
},
},
vec![],
))
@@ -165,7 +177,12 @@ fn eip_4788_no_code_cancun() {
.execute_one(&RecoveredBlock::new_unhashed(
Block {
header,
body: BlockBody { transactions: vec![], ommers: vec![], withdrawals: None },
body: BlockBody {
transactions: vec![],
ommers: vec![],
withdrawals: None,
block_access_list: None,
},
},
vec![],
))
@@ -207,7 +224,12 @@ fn eip_4788_empty_account_call() {
.execute_one(&RecoveredBlock::new_unhashed(
Block {
header,
body: BlockBody { transactions: vec![], ommers: vec![], withdrawals: None },
body: BlockBody {
transactions: vec![],
ommers: vec![],
withdrawals: None,
block_access_list: None,
},
},
vec![],
))
@@ -339,6 +361,7 @@ fn create_database_with_block_hashes(latest_block: u64) -> CacheDB<EmptyDB> {
code_hash: keccak256(HISTORY_STORAGE_CODE.clone()),
code: Some(Bytecode::new_raw(HISTORY_STORAGE_CODE.clone())),
nonce: 1,
storage_id: None,
};
db.insert_account_info(HISTORY_STORAGE_ADDRESS, blockhashes_contract_account);
@@ -796,6 +819,7 @@ fn test_balance_increment_not_duplicated() {
transactions: vec![],
ommers: vec![],
withdrawals: Some(vec![withdrawal].into()),
block_access_list: None,
},
},
vec![],

View File

@@ -24,7 +24,7 @@ reth-provider.workspace = true
reth-transaction-pool.workspace = true
reth-network.workspace = true
reth-evm.workspace = true
reth-evm-ethereum = { workspace = true, features = ["std"] }
reth-evm-ethereum.workspace = true
reth-rpc.workspace = true
reth-rpc-api.workspace = true
reth-rpc-eth-api.workspace = true
@@ -35,7 +35,7 @@ reth-chainspec.workspace = true
reth-revm = { workspace = true, features = ["std"] }
reth-rpc-eth-types.workspace = true
reth-engine-local.workspace = true
reth-engine-primitives = { workspace = true, features = ["std"] }
reth-engine-primitives.workspace = true
reth-payload-primitives.workspace = true
# ethereum
@@ -61,8 +61,6 @@ reth-node-core.workspace = true
reth-e2e-test-utils.workspace = true
reth-tasks.workspace = true
reth-testing-utils.workspace = true
tempfile.workspace = true
jsonrpsee-core.workspace = true
alloy-primitives.workspace = true
alloy-provider.workspace = true
@@ -88,9 +86,6 @@ asm-keccak = [
"reth-node-core/asm-keccak",
"revm/asm-keccak",
]
keccak-cache-global = [
"alloy-primitives/keccak-cache-global",
]
js-tracer = [
"reth-node-builder/js-tracer",
"reth-rpc/js-tracer",

View File

@@ -32,15 +32,15 @@ use reth_node_builder::{
EngineValidatorBuilder, EthApiBuilder, EthApiCtx, Identity, PayloadValidatorBuilder,
RethRpcAddOns, RpcAddOns, RpcHandle,
},
BuilderContext, DebugNode, Node, NodeAdapter,
BuilderContext, DebugNode, Node, NodeAdapter, PayloadBuilderConfig,
};
use reth_payload_primitives::PayloadTypes;
use reth_provider::{providers::ProviderFactoryBuilder, EthStorage};
use reth_rpc::{
eth::core::{EthApiFor, EthRpcConverterFor},
TestingApi, ValidationApi,
ValidationApi,
};
use reth_rpc_api::servers::{BlockSubmissionValidationApiServer, TestingApiServer};
use reth_rpc_api::servers::BlockSubmissionValidationApiServer;
use reth_rpc_builder::{config::RethRpcServerConfig, middleware::RethRpcMiddleware};
use reth_rpc_eth_api::{
helpers::{
@@ -118,14 +118,13 @@ impl EthereumNode {
/// use reth_chainspec::ChainSpecBuilder;
/// use reth_db::open_db_read_only;
/// use reth_node_ethereum::EthereumNode;
/// use reth_provider::providers::{RocksDBProvider, StaticFileProvider};
/// use reth_provider::providers::StaticFileProvider;
/// use std::sync::Arc;
///
/// let factory = EthereumNode::provider_factory_builder()
/// .db(Arc::new(open_db_read_only("db", Default::default()).unwrap()))
/// .chainspec(ChainSpecBuilder::mainnet().build().into())
/// .static_file(StaticFileProvider::read_only("db/static_files", false).unwrap())
/// .rocksdb_provider(RocksDBProvider::builder("db/rocksdb").build().unwrap())
/// .build_provider_factory();
/// ```
pub fn provider_factory_builder() -> ProviderFactoryBuilder<Self> {
@@ -314,17 +313,6 @@ where
.modules
.merge_if_module_configured(RethRpcModule::Eth, eth_config.into_rpc())?;
// testing_buildBlockV1: only wire when the hidden testing module is explicitly
// requested on any transport. Default stays disabled to honor security guidance.
let testing_api = TestingApi::new(
container.registry.eth_api().clone(),
container.registry.evm_config().clone(),
)
.into_rpc();
container
.modules
.merge_if_module_configured(RethRpcModule::Testing, testing_api)?;
Ok(())
})
.await
@@ -438,7 +426,9 @@ where
type EVM = EthEvmConfig<Types::ChainSpec>;
async fn build_evm(self, ctx: &BuilderContext<Node>) -> eyre::Result<Self::EVM> {
Ok(EthEvmConfig::new(ctx.chain_spec()))
let evm_config = EthEvmConfig::new(ctx.chain_spec())
.with_extra_data(ctx.payload_builder_config().extra_data_bytes());
Ok(evm_config)
}
}

View File

@@ -54,8 +54,7 @@ where
evm_config,
EthereumBuilderConfig::new()
.with_gas_limit(gas_limit)
.with_max_blobs_per_block(conf.max_blobs_per_block())
.with_extra_data(conf.extra_data_bytes()),
.with_max_blobs_per_block(conf.max_blobs_per_block()),
))
}
}

View File

@@ -2,6 +2,5 @@
mod builder;
mod exex;
mod testing;
const fn main() {}

View File

@@ -1,85 +0,0 @@
//! E2E tests for the testing RPC namespace.
use alloy_primitives::{Address, B256};
use alloy_rpc_types_engine::ExecutionPayloadEnvelopeV4;
use jsonrpsee_core::client::ClientT;
use reth_db::test_utils::create_test_rw_db;
use reth_ethereum_engine_primitives::EthPayloadAttributes;
use reth_node_builder::{NodeBuilder, NodeConfig};
use reth_node_core::{
args::DatadirArgs,
dirs::{DataDirPath, MaybePlatformPath},
};
use reth_node_ethereum::{node::EthereumAddOns, EthereumNode};
use reth_rpc_api::TestingBuildBlockRequestV1;
use reth_rpc_server_types::{RethRpcModule, RpcModuleSelection};
use reth_tasks::TaskManager;
use std::str::FromStr;
use tempfile::tempdir;
use tokio::sync::oneshot;
#[tokio::test(flavor = "multi_thread")]
async fn testing_rpc_build_block_works() -> eyre::Result<()> {
let tasks = TaskManager::current();
let mut rpc_args = reth_node_core::args::RpcServerArgs::default().with_http();
rpc_args.http_api = Some(RpcModuleSelection::from_iter([RethRpcModule::Testing]));
let tempdir = tempdir().expect("temp datadir");
let datadir_args = DatadirArgs {
datadir: MaybePlatformPath::<DataDirPath>::from_str(tempdir.path().to_str().unwrap())
.expect("valid datadir"),
static_files_path: Some(tempdir.path().join("static")),
rocksdb_path: Some(tempdir.path().join("rocksdb")),
};
let config = NodeConfig::test().with_datadir_args(datadir_args).with_rpc(rpc_args);
let db = create_test_rw_db();
let (tx, rx): (
oneshot::Sender<eyre::Result<ExecutionPayloadEnvelopeV4>>,
oneshot::Receiver<eyre::Result<ExecutionPayloadEnvelopeV4>>,
) = oneshot::channel();
let builder = NodeBuilder::new(config)
.with_database(db)
.with_launch_context(tasks.executor())
.with_types::<EthereumNode>()
.with_components(EthereumNode::components())
.with_add_ons(EthereumAddOns::default())
.on_rpc_started(move |ctx, handles| {
let Some(client) = handles.rpc.http_client() else { return Ok(()) };
let chain = ctx.config().chain.clone();
let parent_block_hash = chain.genesis_hash();
let payload_attributes = EthPayloadAttributes {
timestamp: chain.genesis().timestamp + 1,
prev_randao: B256::ZERO,
suggested_fee_recipient: Address::ZERO,
withdrawals: None,
parent_beacon_block_root: None,
};
let request = TestingBuildBlockRequestV1 {
parent_block_hash,
payload_attributes,
transactions: vec![],
extra_data: None,
};
tokio::spawn(async move {
let res: eyre::Result<ExecutionPayloadEnvelopeV4> =
client.request("testing_buildBlockV1", [request]).await.map_err(Into::into);
let _ = tx.send(res);
});
Ok(())
});
// Launch the node with the default engine launcher.
let launcher = builder.engine_api_launcher();
let _node = builder.launch_with(launcher).await?;
// Wait for the testing RPC call to return.
let res = rx.await.expect("testing_buildBlockV1 response");
assert!(res.is_ok(), "testing_buildBlockV1 failed: {:?}", res.err());
Ok(())
}

View File

@@ -24,7 +24,7 @@ reth-payload-builder-primitives.workspace = true
reth-payload-primitives.workspace = true
reth-basic-payload-builder.workspace = true
reth-evm.workspace = true
reth-evm-ethereum = { workspace = true, features = ["std"] }
reth-evm-ethereum.workspace = true
reth-errors.workspace = true
reth-chainspec.workspace = true
reth-payload-validator.workspace = true

View File

@@ -1,5 +1,4 @@
use alloy_eips::eip1559::ETHEREUM_BLOCK_GAS_LIMIT_30M;
use alloy_primitives::Bytes;
use reth_primitives_traits::constants::GAS_LIMIT_BOUND_DIVISOR;
/// Settings for the Ethereum builder.
@@ -14,8 +13,6 @@ pub struct EthereumBuilderConfig {
///
/// If `None`, defaults to the protocol maximum.
pub max_blobs_per_block: Option<u64>,
/// Extra data for built blocks.
pub extra_data: Bytes,
}
impl Default for EthereumBuilderConfig {
@@ -31,7 +28,6 @@ impl EthereumBuilderConfig {
desired_gas_limit: ETHEREUM_BLOCK_GAS_LIMIT_30M,
await_payload_on_missing: true,
max_blobs_per_block: None,
extra_data: Bytes::new(),
}
}
@@ -53,12 +49,6 @@ impl EthereumBuilderConfig {
self.max_blobs_per_block = max_blobs_per_block;
self
}
/// Set the extra data for built blocks.
pub fn with_extra_data(mut self, extra_data: Bytes) -> Self {
self.extra_data = extra_data;
self
}
}
impl EthereumBuilderConfig {

View File

@@ -154,9 +154,13 @@ where
let state_provider = client.state_by_block_hash(parent_header.hash())?;
let state = StateProviderDatabase::new(&state_provider);
let mut db =
State::builder().with_database(cached_reads.as_db_mut(state)).with_bundle_update().build();
let mut db = State::builder()
.with_database(cached_reads.as_db_mut(state))
.with_bundle_update()
.with_bal_builder()
.build();
db.bal_state.bal_index = 0;
db.bal_state.bal_builder = Some(revm::state::bal::Bal::new());
let mut builder = evm_config
.builder_for_next_block(
&mut db,
@@ -168,7 +172,6 @@ where
gas_limit: builder_config.gas_limit(parent_header.gas_limit),
parent_beacon_block_root: attributes.parent_beacon_block_root(),
withdrawals: Some(attributes.withdrawals().clone()),
extra_data: builder_config.extra_data,
},
)
.map_err(PayloadBuilderError::other)?;

View File

@@ -3,7 +3,7 @@
use alloy_consensus::Block;
use alloy_rpc_types_engine::{ExecutionData, PayloadError};
use reth_chainspec::EthereumHardforks;
use reth_payload_validator::{cancun, prague, shanghai};
use reth_payload_validator::{amsterdam, cancun, prague, shanghai};
use reth_primitives_traits::{Block as _, SealedBlock, SignedTransaction};
use std::sync::Arc;
@@ -103,5 +103,10 @@ where
chain_spec.is_prague_active_at_timestamp(sealed_block.timestamp),
)?;
amsterdam::ensure_well_formed_fields(
sealed_block.body(),
chain_spec.is_amsterdam_active_at_timestamp(sealed_block.timestamp),
)?;
Ok(sealed_block)
}

View File

@@ -79,9 +79,7 @@ arbitrary = [
"alloy-rpc-types-engine?/arbitrary",
"reth-codecs?/arbitrary",
]
keccak-cache-global = [
"reth-node-ethereum?/keccak-cache-global",
]
test-utils = [
"reth-chainspec/test-utils",
"reth-consensus?/test-utils",

View File

@@ -32,7 +32,6 @@ auto_impl.workspace = true
derive_more.workspace = true
futures-util.workspace = true
metrics = { workspace = true, optional = true }
rayon = { workspace = true, optional = true }
[dev-dependencies]
reth-ethereum-primitives.workspace = true
@@ -41,7 +40,6 @@ reth-ethereum-forks.workspace = true
[features]
default = ["std"]
std = [
"dep:rayon",
"reth-primitives-traits/std",
"alloy-eips/std",
"alloy-primitives/std",

View File

@@ -1,5 +1,4 @@
use crate::{execute::ExecutableTxFor, ConfigureEvm, EvmEnvFor, ExecutionCtxFor};
use rayon::prelude::*;
/// [`ConfigureEvm`] extension providing methods for executing payloads.
pub trait ConfigureEngineEvm<ExecutionData>: ConfigureEvm {
@@ -22,7 +21,7 @@ pub trait ConfigureEngineEvm<ExecutionData>: ConfigureEvm {
/// A helper trait representing a pair of a "raw" transactions iterator and a closure that can be
/// used to convert them to an executable transaction. This tuple is used in the engine to
/// parallelize heavy work like decoding or recovery.
pub trait ExecutableTxTuple: Into<(Self::IntoIter, Self::Convert)> + Send + 'static {
pub trait ExecutableTxTuple: Into<(Self::Iter, Self::Convert)> + Send + 'static {
/// Raw transaction that can be converted to an [`ExecutableTxTuple::Tx`]
///
/// This can be any type that can be converted to an [`ExecutableTxTuple::Tx`]. For example,
@@ -33,10 +32,8 @@ pub trait ExecutableTxTuple: Into<(Self::IntoIter, Self::Convert)> + Send + 'sta
/// Errors that may occur while recovering or decoding transactions.
type Error: core::error::Error + Send + Sync + 'static;
/// Iterator over [`ExecutableTxTuple::Tx`].
type IntoIter: IntoParallelIterator<Item = Self::RawTx, Iter: IndexedParallelIterator>
+ Send
+ 'static;
/// Iterator over [`ExecutableTxTuple::Tx`]
type Iter: Iterator<Item = Self::RawTx> + Send + 'static;
/// Closure that can be used to convert a [`ExecutableTxTuple::RawTx`] to a
/// [`ExecutableTxTuple::Tx`]. This might involve heavy work like decoding or recovery
/// and will be parallelized in the engine.
@@ -48,14 +45,14 @@ where
RawTx: Send + Sync + 'static,
Tx: Clone + Send + Sync + 'static,
Err: core::error::Error + Send + Sync + 'static,
I: IntoParallelIterator<Item = RawTx, Iter: IndexedParallelIterator> + Send + 'static,
I: Iterator<Item = RawTx> + Send + 'static,
F: Fn(RawTx) -> Result<Tx, Err> + Send + Sync + 'static,
{
type RawTx = RawTx;
type Tx = Tx;
type Error = Err;
type IntoIter = I;
type Iter = I;
type Convert = F;
}

View File

@@ -1,12 +1,12 @@
//! Traits for execution.
use crate::{ConfigureEvm, Database, OnStateHook, TxEnvFor};
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec};
use alloy_consensus::{BlockHeader, Header};
use alloy_eips::eip2718::WithEncoded;
pub use alloy_evm::block::{BlockExecutor, BlockExecutorFactory};
use alloy_evm::{
block::{CommitChanges, ExecutableTx},
block::{CommitChanges, ExecutableTx, StateDB},
Evm, EvmEnv, EvmFactory, RecoveredTx, ToTxEnv,
};
use alloy_primitives::{Address, B256};
@@ -214,7 +214,7 @@ pub struct BlockAssemblerInput<'a, 'b, F: BlockExecutorFactory, H = Header> {
/// Output of block execution.
pub output: &'b BlockExecutionResult<F::Receipt>,
/// [`BundleState`] after the block execution.
pub bundle_state: &'a BundleState,
pub bundle_state: Cow<'a, BundleState>,
/// Provider with access to state.
#[debug(skip)]
pub state_provider: &'b dyn StateProvider,
@@ -234,7 +234,7 @@ impl<'a, 'b, F: BlockExecutorFactory, H> BlockAssemblerInput<'a, 'b, F, H> {
parent: &'a SealedHeader<H>,
transactions: Vec<F::Transaction>,
output: &'b BlockExecutionResult<F::Receipt>,
bundle_state: &'a BundleState,
bundle_state: impl Into<Cow<'a, BundleState>>,
state_provider: &'b dyn StateProvider,
state_root: B256,
) -> Self {
@@ -244,7 +244,7 @@ impl<'a, 'b, F: BlockExecutorFactory, H> BlockAssemblerInput<'a, 'b, F, H> {
parent,
transactions,
output,
bundle_state,
bundle_state: bundle_state.into(),
state_provider,
state_root,
}
@@ -461,8 +461,7 @@ where
}
}
impl<'a, F, DB, Executor, Builder, N> BlockBuilder
for BasicBlockBuilder<'a, F, Executor, Builder, N>
impl<'a, F, Executor, Builder, N> BlockBuilder for BasicBlockBuilder<'a, F, Executor, Builder, N>
where
F: BlockExecutorFactory<Transaction = N::SignedTx, Receipt = N::Receipt>,
Executor: BlockExecutor<
@@ -470,12 +469,11 @@ where
Spec = <F::EvmFactory as EvmFactory>::Spec,
HaltReason = <F::EvmFactory as EvmFactory>::HaltReason,
BlockEnv = <F::EvmFactory as EvmFactory>::BlockEnv,
DB = &'a mut State<DB>,
DB: StateDB + 'a,
>,
Transaction = N::SignedTx,
Receipt = N::Receipt,
>,
DB: Database + 'a,
Builder: BlockAssembler<F, Block = N::Block>,
N: NodePrimitives,
{
@@ -508,13 +506,13 @@ where
state: impl StateProvider,
) -> Result<BlockBuilderOutcome<N>, BlockExecutionError> {
let (evm, result) = self.executor.finish()?;
let (db, evm_env) = evm.finish();
let (mut db, evm_env) = evm.finish();
// merge all transitions into bundle state
db.merge_transitions(BundleRetention::Reverts);
// calculate the state root
let hashed_state = state.hashed_post_state(&db.bundle_state);
let hashed_state = state.hashed_post_state(db.bundle_state());
let (state_root, trie_updates) = state
.state_root_with_updates(hashed_state.clone())
.map_err(BlockExecutionError::other)?;
@@ -528,7 +526,7 @@ where
parent: self.parent,
transactions,
output: &result,
bundle_state: &db.bundle_state,
bundle_state: Cow::Owned(db.take_bundle()),
state_provider: &state,
state_root,
})?;
@@ -564,8 +562,14 @@ pub struct BasicBlockExecutor<F, DB> {
impl<F, DB: Database> BasicBlockExecutor<F, DB> {
/// Creates a new `BasicBlockExecutor` with the given strategy.
pub fn new(strategy_factory: F, db: DB) -> Self {
let db =
State::builder().with_database(db).with_bundle_update().without_state_clear().build();
let mut db = State::builder()
.with_database(db)
.with_bundle_update()
.with_bal_builder()
.without_state_clear()
.build();
db.bal_state.bal_index = 0;
db.bal_state.bal_builder = Some(revm::state::bal::Bal::new());
Self { strategy_factory, db }
}
}
@@ -741,6 +745,7 @@ mod tests {
nonce,
code_hash: KECCAK_EMPTY,
code: None,
storage_id: None,
};
state.insert_account(addr, account_info);
state
@@ -777,8 +782,13 @@ mod tests {
let mut state = setup_state_with_account(addr1, 100, 1);
let account2 =
AccountInfo { balance: U256::from(200), nonce: 1, code_hash: KECCAK_EMPTY, code: None };
let account2 = AccountInfo {
balance: U256::from(200),
nonce: 1,
code_hash: KECCAK_EMPTY,
code: None,
storage_id: None,
};
state.insert_account(addr2, account2);
let mut increments = HashMap::default();
@@ -799,8 +809,13 @@ mod tests {
let mut state = setup_state_with_account(addr1, 100, 1);
let account2 =
AccountInfo { balance: U256::from(200), nonce: 1, code_hash: KECCAK_EMPTY, code: None };
let account2 = AccountInfo {
balance: U256::from(200),
nonce: 1,
code_hash: KECCAK_EMPTY,
code: None,
storage_id: None,
};
state.insert_account(addr2, account2);
let mut increments = HashMap::default();

View File

@@ -18,6 +18,7 @@
extern crate alloc;
use crate::execute::{BasicBlockBuilder, Executor};
use ::revm::context::TxEnv;
use alloc::vec::Vec;
use alloy_eips::{
eip2718::{EIP2930_TX_TYPE_ID, LEGACY_TX_TYPE_ID},
@@ -25,17 +26,17 @@ use alloy_eips::{
eip4895::Withdrawals,
};
use alloy_evm::{
block::{BlockExecutorFactory, BlockExecutorFor},
block::{BlockExecutorFactory, BlockExecutorFor, StateDB},
precompiles::PrecompilesMap,
};
use alloy_primitives::{Address, Bytes, B256};
use alloy_primitives::{Address, B256};
use core::{error::Error, fmt::Debug};
use execute::{BasicBlockExecutor, BlockAssembler, BlockBuilder};
use reth_execution_errors::BlockExecutionError;
use reth_primitives_traits::{
BlockTy, HeaderTy, NodePrimitives, ReceiptTy, SealedBlock, SealedHeader, TxTy,
};
use revm::{context::TxEnv, database::State};
use revm::DatabaseCommit;
pub mod either;
/// EVM environment configuration.
@@ -44,10 +45,8 @@ pub mod execute;
mod aliases;
pub use aliases::*;
#[cfg(feature = "std")]
mod engine;
#[cfg(feature = "std")]
pub use engine::{ConfigureEngineEvm, ExecutableTxIterator, ExecutableTxTuple};
pub use engine::{ConfigureEngineEvm, ExecutableTxIterator};
#[cfg(feature = "metrics")]
pub mod metrics;
@@ -314,20 +313,20 @@ pub trait ConfigureEvm: Clone + Debug + Send + Sync + Unpin {
/// Creates a strategy with given EVM and execution context.
fn create_executor<'a, DB, I>(
&'a self,
evm: EvmFor<Self, &'a mut State<DB>, I>,
evm: EvmFor<Self, DB, I>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockExecutorFor<'a, Self::BlockExecutorFactory, DB, I>
where
DB: Database,
I: InspectorFor<Self, &'a mut State<DB>> + 'a,
DB: StateDB + DatabaseCommit + Database + 'a,
I: InspectorFor<Self, DB> + 'a,
{
self.block_executor_factory().create_executor(evm, ctx)
}
/// Creates a strategy for execution of a given block.
fn executor_for_block<'a, DB: Database>(
fn executor_for_block<'a, DB: StateDB + DatabaseCommit + Database + 'a>(
&'a self,
db: &'a mut State<DB>,
db: DB,
block: &'a SealedBlock<<Self::Primitives as NodePrimitives>::Block>,
) -> Result<impl BlockExecutorFor<'a, Self::BlockExecutorFactory, DB>, Self::Error> {
let evm = self.evm_for_block(db, block.header())?;
@@ -352,7 +351,7 @@ pub trait ConfigureEvm: Clone + Debug + Send + Sync + Unpin {
/// ```
fn create_block_builder<'a, DB, I>(
&'a self,
evm: EvmFor<Self, &'a mut State<DB>, I>,
evm: EvmFor<Self, DB, I>,
parent: &'a SealedHeader<HeaderTy<Self::Primitives>>,
ctx: <Self::BlockExecutorFactory as BlockExecutorFactory>::ExecutionCtx<'a>,
) -> impl BlockBuilder<
@@ -360,8 +359,8 @@ pub trait ConfigureEvm: Clone + Debug + Send + Sync + Unpin {
Executor: BlockExecutorFor<'a, Self::BlockExecutorFactory, DB, I>,
>
where
DB: Database,
I: InspectorFor<Self, &'a mut State<DB>> + 'a,
DB: StateDB + DatabaseCommit + Database + 'a,
I: InspectorFor<Self, DB> + 'a,
{
BasicBlockBuilder {
executor: self.create_executor(evm, ctx.clone()),
@@ -401,9 +400,9 @@ pub trait ConfigureEvm: Clone + Debug + Send + Sync + Unpin {
/// // Complete block building
/// let outcome = builder.finish(state_provider)?;
/// ```
fn builder_for_next_block<'a, DB: Database>(
fn builder_for_next_block<'a, DB: StateDB + DatabaseCommit + Database + 'a>(
&'a self,
db: &'a mut State<DB>,
db: DB,
parent: &'a SealedHeader<<Self::Primitives as NodePrimitives>::BlockHeader>,
attributes: Self::NextBlockEnvCtx,
) -> Result<
@@ -503,8 +502,6 @@ pub struct NextBlockEnvAttributes {
pub parent_beacon_block_root: Option<B256>,
/// Withdrawals
pub withdrawals: Option<Withdrawals>,
/// Optional extra data.
pub extra_data: Bytes,
}
/// Abstraction over transaction environment.

View File

@@ -929,10 +929,20 @@ mod tests {
let address3 = Address::random();
// Set up account info with some changes
let account_info1 =
AccountInfo { nonce: 1, balance: U256::from(100), code_hash: B256::ZERO, code: None };
let account_info2 =
AccountInfo { nonce: 2, balance: U256::from(200), code_hash: B256::ZERO, code: None };
let account_info1 = AccountInfo {
nonce: 1,
balance: U256::from(100),
code_hash: B256::ZERO,
code: None,
storage_id: None,
};
let account_info2 = AccountInfo {
nonce: 2,
balance: U256::from(200),
code_hash: B256::ZERO,
code: None,
storage_id: None,
};
// Set up the bundle state with these accounts
let mut bundle_state = BundleState::default();

View File

@@ -185,22 +185,22 @@ mod tests {
// wal with 1 block and tx
// <https://github.com/paradigmxyz/reth/issues/15012>
#[test]
fn decode_notification_wal() {
let wal = include_bytes!("../../test-data/28.wal");
let notification: reth_exex_types::serde_bincode_compat::ExExNotification<
'_,
reth_ethereum_primitives::EthPrimitives,
> = rmp_serde::decode::from_slice(wal.as_slice()).unwrap();
let notification: ExExNotification = notification.into();
match notification {
ExExNotification::ChainCommitted { new } => {
assert_eq!(new.blocks().len(), 1);
assert_eq!(new.tip().transaction_count(), 1);
}
_ => panic!("unexpected notification"),
}
}
// #[test]
// fn decode_notification_wal() {
// let wal = include_bytes!("../../test-data/28.wal");
// let notification: reth_exex_types::serde_bincode_compat::ExExNotification<
// '_,
// reth_ethereum_primitives::EthPrimitives,
// > = rmp_serde::decode::from_slice(wal.as_slice()).unwrap();
// let notification: ExExNotification = notification.into();
// match notification {
// ExExNotification::ChainCommitted { new } => {
// assert_eq!(new.blocks().len(), 1);
// assert_eq!(new.tip().transaction_count(), 1);
// }
// _ => panic!("unexpected notification"),
// }
// }
#[test]
fn test_roundtrip() -> eyre::Result<()> {

View File

@@ -20,9 +20,7 @@ use futures_util::FutureExt;
use reth_chainspec::{ChainSpec, MAINNET};
use reth_consensus::test_utils::TestConsensus;
use reth_db::{
test_utils::{
create_test_rocksdb_dir, create_test_rw_db, create_test_static_files_dir, TempDatabase,
},
test_utils::{create_test_rw_db, create_test_static_files_dir, TempDatabase},
DatabaseEnv,
};
use reth_db_common::init::init_genesis;
@@ -52,7 +50,7 @@ use reth_node_ethereum::{
use reth_payload_builder::noop::NoopPayloadBuilderService;
use reth_primitives_traits::{Block as _, RecoveredBlock};
use reth_provider::{
providers::{BlockchainProvider, RocksDBProvider, StaticFileProvider},
providers::{BlockchainProvider, StaticFileProvider},
BlockReader, EthStorage, ProviderFactory,
};
use reth_tasks::TaskManager;
@@ -241,13 +239,11 @@ pub async fn test_exex_context_with_chain_spec(
let consensus = Arc::new(TestConsensus::default());
let (static_dir, _) = create_test_static_files_dir();
let (rocksdb_dir, _) = create_test_rocksdb_dir();
let db = create_test_rw_db();
let provider_factory = ProviderFactory::<NodeTypesWithDBAdapter<TestNode, _>>::new(
db,
chain_spec.clone(),
StaticFileProvider::read_write(static_dir.keep()).expect("static file provider"),
RocksDBProvider::builder(rocksdb_dir.keep()).build().unwrap(),
)?;
let genesis_hash = init_genesis(&provider_factory)?;

View File

@@ -24,7 +24,7 @@ pub struct Discv4Config {
/// The number of allowed consecutive failures for `FindNode` requests. Default: 5.
pub max_find_node_failures: u8,
/// The interval to use when checking for expired nodes that need to be re-pinged. Default:
/// 10 seconds.
/// 10min.
pub ping_interval: Duration,
/// The duration of we consider a ping timed out.
pub ping_expiration: Duration,
@@ -93,7 +93,7 @@ impl Discv4Config {
/// Returns the corresponding [`ResolveNatInterval`], if a [`NatResolver`] and an interval was
/// configured
pub fn resolve_external_ip_interval(&self) -> Option<ResolveNatInterval> {
let resolver = self.external_ip_resolver.clone()?;
let resolver = self.external_ip_resolver?;
let interval = self.resolve_external_ip_interval?;
Some(ResolveNatInterval::interval_at(resolver, tokio::time::Instant::now(), interval))
}
@@ -275,7 +275,10 @@ impl Discv4ConfigBuilder {
}
/// Configures if and how the external IP of the node should be resolved.
pub fn external_ip_resolver(&mut self, external_ip_resolver: Option<NatResolver>) -> &mut Self {
pub const fn external_ip_resolver(
&mut self,
external_ip_resolver: Option<NatResolver>,
) -> &mut Self {
self.config.external_ip_resolver = external_ip_resolver;
self
}

Some files were not shown because too many files have changed in this diff Show More