Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pullupstream/v0.5.0 rc4 #52

Merged
merged 252 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 156 commits
Commits
Show all changes
252 commits
Select commit Hold shift + click to select a range
b5118a7
build(deps): bump golang.org/x/sync from 0.4.0 to 0.5.0 (#2755)
dependabot[bot] Nov 6, 2023
1acd0d1
build(deps): bump github.com/gorilla/websocket from 1.5.0 to 1.5.1 (#…
dependabot[bot] Nov 6, 2023
930cab8
build(deps): bump github.com/fatih/color from 1.15.0 to 1.16.0 (#2758)
dependabot[bot] Nov 7, 2023
be1818d
Cherry pick effective gas prices fixes (#2738, #2741) to develop bran…
agnusmor Nov 8, 2023
4e0e957
Fix e2e group 10 (forced batches) (#2750)
joanestebanr Nov 9, 2023
a79a7be
+ renamed config vars for L1 parallel sync (cherry-pick from #2768) (…
joanestebanr Nov 9, 2023
e8bbb62
build(deps): bump golang.org/x/net from 0.17.0 to 0.18.0 (#2770)
dependabot[bot] Nov 9, 2023
34d2274
Refactor State: Step 1 (#2773)
ToniRamirezM Nov 10, 2023
2c08b3c
Fix e2e group 8 (debug trace) (#2761)
joanestebanr Nov 10, 2023
59e43db
add queue to ws subscription filters (#2769) (#2779)
tclemos Nov 14, 2023
522c324
Update GER on closed batch without txs (#2793) (#2794)
ToniRamirezM Nov 15, 2023
ded0fb4
Fix data stream tool performance (#2785)
ToniRamirezM Nov 16, 2023
26713cf
L1InfoTree implementation + tests (#2786)
ARR552 Nov 16, 2023
ece1053
etherman: read tx with blockHash and txIndex instead of txHash (#2722)
jsvisa Nov 20, 2023
b7e59ae
Fix tx size check (#2799) (#2804)
ToniRamirezM Nov 20, 2023
5fcffeb
Added L2GasPriceSuggesterFactor config parameter to simulate estimate…
agnusmor Nov 20, 2023
6b5b378
Fix typos (#2803)
omahs Nov 21, 2023
6c12fb7
Refactor incaberry L1 event executors to another files to avoid modif…
joanestebanr Nov 22, 2023
837a78a
compute merkleproof (#2820)
ARR552 Nov 23, 2023
84ac067
Cherry-pick #2658: feature: storing LER in state.batch on successful …
agnusmor Nov 23, 2023
4bd8c1f
Fix timestamp stored in exit_root table (#2811)
ARR552 Nov 23, 2023
a91d833
build(deps): bump github.com/0xPolygonHermez/zkevm-data-streamer (#2824)
dependabot[bot] Nov 23, 2023
a4212eb
#2669 LxLy bridge support (#2694)
ARR552 Nov 23, 2023
d7630ce
new tracers (#2663)
tclemos Nov 23, 2023
511b41f
add response headers to all http responses (#2829) (#2830)
tclemos Nov 24, 2023
f755f8f
fork-etrog: synchronizer: update L1InfoTree (#2818)
joanestebanr Nov 24, 2023
ad201b9
synchronized refactor: move l1_parallel to a folder (#2836)
joanestebanr Nov 27, 2023
7a03d12
fix e2e group 5 (#2838)
joanestebanr Nov 27, 2023
ea91ca9
etrog Integration with executor (#2827)
ToniRamirezM Nov 27, 2023
2bc173d
etrog: L1InfoTreeIndex is 32bits (#2844)
joanestebanr Nov 28, 2023
10655ee
build(deps): bump github.com/go-git/go-git/v5 from 5.10.0 to 5.10.1 (…
dependabot[bot] Nov 28, 2023
86f8088
build(deps): bump golang.org/x/crypto from 0.15.0 to 0.16.0 (#2851)
dependabot[bot] Nov 28, 2023
6441e50
build(deps): bump github.com/holiman/uint256 from 1.2.3 to 1.2.4 (#2849)
dependabot[bot] Nov 28, 2023
7f97a4d
build(deps): bump golang.org/x/net from 0.18.0 to 0.19.0 (#2852)
dependabot[bot] Nov 28, 2023
ca772c6
expose SkipFirstChangeL2Block (#2853)
ToniRamirezM Nov 28, 2023
c26b077
build(deps): bump github.com/spf13/afero from 1.10.0 to 1.11.0 (#2859)
dependabot[bot] Nov 29, 2023
74bf209
fix camelCase to snake_function that fails in MAC (#2862)
joanestebanr Nov 29, 2023
ee6e2d8
compute wip batch during stream delta calculation (#2864)
ToniRamirezM Nov 29, 2023
6e77949
Compute and store l2 tx hash (#2855)
ToniRamirezM Nov 29, 2023
9b1d698
build(deps): bump github.com/0xPolygonHermez/zkevm-data-streamer (#2870)
dependabot[bot] Nov 30, 2023
63dc930
etrog: Decode/coding etrog batches (#2854)
joanestebanr Nov 30, 2023
0a82217
update executor proto (#2872)
ToniRamirezM Nov 30, 2023
3c9bdad
Feature/#2831 new smc etrog (#2837)
ARR552 Dec 1, 2023
1e79b4c
change state to control the new hash for ETROG blocks (#2845)
tclemos Dec 1, 2023
be543b2
improve OOC and OOG errors (#2774)
tclemos Dec 1, 2023
e145e31
cherry pick the latest WS improvements into develop (#2819)
tclemos Dec 1, 2023
ed1e943
Add StoreL2Block (ETROG) function to the state (#2875)
agnusmor Dec 4, 2023
5576e50
Sequencer Etrog refactor (#2878)
agnusmor Dec 4, 2023
9ce36bf
add im state root to data stream (#2893) (#2895)
ToniRamirezM Dec 12, 2023
20052a1
review Estimate Gas validations and Formulas (#2856) (#2897)
tclemos Dec 12, 2023
839b0f8
jRPC - Review Logs (#2883) (#2899)
tclemos Dec 12, 2023
f77d582
fix test (#2900)
ToniRamirezM Dec 12, 2023
1a229c6
wip: etrog: synchronize trusted batches (#2871)
joanestebanr Dec 13, 2023
16982cb
WIP
dpunish3r Dec 13, 2023
7f45760
fix ProcessBatchV2 (#2905)
ToniRamirezM Dec 13, 2023
ecbaba6
update prover version v4.0.0-RC8 (#2908)
ARR552 Dec 13, 2023
48b17be
WIP
dpunish3r Dec 13, 2023
b5dd453
l1InfoRoot + fixes unsigned tx (#2911)
ARR552 Dec 14, 2023
7e67b6c
WIP
dpunish3r Dec 14, 2023
c9c72e1
etrog: batch timestamp is set when is virtualized (#2904)
joanestebanr Dec 14, 2023
1f34d16
state transtiion v2 test (#2912)
ToniRamirezM Dec 14, 2023
b1ffca5
fix forkID in ProcessRequest (#2915)
ToniRamirezM Dec 14, 2023
37804e4
Feature/2914 etrog use l1inforoot from event (#2918)
joanestebanr Dec 14, 2023
36f356e
fix update last L1InfoRoot (#2921)
agnusmor Dec 14, 2023
a2e6787
update/get batch used resources from the state (batch table) (#2916)
agnusmor Dec 14, 2023
5e1c431
Refactor state tests (#2920)
ToniRamirezM Dec 14, 2023
10c46e1
WIP
dpunish3r Dec 14, 2023
1ec7271
review Estimate Gas validations and Formulas (#2856) (#2876)
tclemos Dec 14, 2023
b1364bf
review usigned tx execution and make estimate gas compatible with all…
tclemos Dec 14, 2023
c6385c7
fix tx size when calculating egp and checking remaining batch resourc…
agnusmor Dec 15, 2023
a00c69d
etrog: support permissionless sync from scratch (#2923)
joanestebanr Dec 15, 2023
ae2e6e9
Bugs fixed
dpunish3r Dec 15, 2023
b013a3a
Fix/l1 info root (#2925)
ARR552 Dec 15, 2023
d2c781a
Improve display stats. Add README.
dpunish3r Dec 15, 2023
243b023
Feature/state tests refactor2 (#2928)
ToniRamirezM Dec 15, 2023
aa58c37
Config for testnet
dpunish3r Dec 15, 2023
e6b8a53
etrog: use WIP flag in the response of zkevm RPC for Closed field, a…
joanestebanr Dec 16, 2023
5e84f87
build(deps): bump github.com/google/uuid from 1.4.0 to 1.5.0 (#2902)
dependabot[bot] Dec 18, 2023
d41e468
build(deps): bump google.golang.org/grpc from 1.59.0 to 1.60.0 (#2894)
dependabot[bot] Dec 18, 2023
5886e75
build(deps): bump github.com/urfave/cli/v2 from 2.25.7 to 2.26.0 (#2874)
dependabot[bot] Dec 18, 2023
bd92b08
build(deps): bump github.com/go-git/go-git/v5 from 5.10.1 to 5.11.0 (…
dependabot[bot] Dec 18, 2023
f4885b3
build(deps): bump github.com/spf13/viper from 1.17.0 to 1.18.1 (#2889)
dependabot[bot] Dec 18, 2023
55fa8d9
fix TODOs. fix reprocessFullBatch. fix egp tx size (#2929)
agnusmor Dec 18, 2023
b56b91c
New state test vectors (#2933)
ToniRamirezM Dec 18, 2023
ec1daa5
Revert "build(deps): bump github.com/spf13/viper from 1.17.0 to 1.18.…
ToniRamirezM Dec 18, 2023
07dc252
Add stat gas price before EGP. Add l2 block timestamp
dpunish3r Dec 19, 2023
4d76030
Update smc + sync init tx (#2941)
ARR552 Dec 19, 2023
8c85f0e
extend block endpoints to provide the new l2 block information (#2936)
tclemos Dec 19, 2023
e74fd67
handle new executor errors (#2942)
ToniRamirezM Dec 19, 2023
fe40d21
Add stats tx fee. New config file
dpunish3r Dec 19, 2023
f341155
expose new V2 executor fields (#2944)
ToniRamirezM Dec 19, 2023
456a62c
Update aggregator for etrog (#2943)
ToniRamirezM Dec 19, 2023
d3943c0
fix genesis sequence (#2950)
ToniRamirezM Dec 20, 2023
5fd6929
Bug fix uint64 overflow. Add showalways option
dpunish3r Dec 20, 2023
dd35e31
Refactor forced batches (ETROG). Fix/Review executor requests (#2946)
agnusmor Dec 20, 2023
f44dd2d
Fix/none2e tests (#2955)
ToniRamirezM Dec 20, 2023
57d5b47
return last L1InfoRoot in function GetL1InfoTreeDataFromBatchL2Data (…
agnusmor Dec 20, 2023
14aefd9
reviews l2 block exit roots and exposes endpoint to get them by ger (…
tclemos Dec 20, 2023
91ceee5
Feature/#2948 v1tov2 (#2958)
ARR552 Dec 20, 2023
e9116f7
Remove conditions. Update config
dpunish3r Dec 20, 2023
4290837
etrog: synchornizer-permisionless: first version working of sync with…
joanestebanr Dec 21, 2023
64e5327
Fix UUID + prover rc16 (#2963)
ARR552 Dec 21, 2023
12c8750
remove accInputHash calculation. Fix batch GER (#2959)
agnusmor Dec 21, 2023
30e8948
use prover 4.0.0-RC16 for permissionless (#2964)
joanestebanr Dec 21, 2023
aaab58c
fix mockery (#2961)
ToniRamirezM Dec 21, 2023
29baf59
fix finalizer l1InfoTreeData (#2965)
ToniRamirezM Dec 21, 2023
4f79db7
aggregate forced batches (#2968)
ToniRamirezM Dec 21, 2023
4d8e5a7
Add show simulation only flag. Add show reprocessed info. Update README
dpunish3r Dec 21, 2023
ab29ad0
docs: refine the syntax and make it more clean and clear. (#2873)
threewebcode Dec 21, 2023
475bee8
Feature/etrog support no data on db exit root (#2973)
joanestebanr Dec 21, 2023
54a3ebd
new executor errors (#2972)
ToniRamirezM Dec 21, 2023
c310795
Fix/aggregator decoding (#2971)
ToniRamirezM Dec 21, 2023
42a711e
chore: remove unnecessary conversions (#2960)
estensen Dec 21, 2023
9fd3afe
fix aggregator index 0 (#2975)
ToniRamirezM Dec 21, 2023
f6196f2
Remove closing signal manager. Move dbManager config to Sequencer sec…
agnusmor Dec 21, 2023
78a0c5d
add block information to exit roots response (#2970)
tclemos Dec 21, 2023
76faed2
add support to tx l2 hash for RPC responses (#2945)
tclemos Dec 21, 2023
e28aaa2
fix smc (#2967)
ARR552 Dec 22, 2023
a46804f
Added nodes last synced batch number (#2590)
alexqrid Dec 22, 2023
a18262f
remove unused sequencer config parameters. Remove unnecessary empty l…
agnusmor Dec 22, 2023
0a577f7
Solve linter issues
dpunish3r Dec 22, 2023
1623211
Update datastream lib. Sequencer order batches to send to datastream
dpunish3r Dec 22, 2023
833a7d3
etrog: synchronizer permissionless: Check that permissionless are eno…
joanestebanr Dec 22, 2023
3755af9
Merge pull request #2988 from 0xPolygonHermez/cherry-pick/dslib-order…
dpunish3r Dec 22, 2023
f5e3304
fix log batch response when we got an error calling executor (#2990)
agnusmor Dec 22, 2023
188d3d7
adapt debug methods to run v1 and v2 executor requests (#2991)
tclemos Dec 22, 2023
2a78ffa
rename finalizer config parameters to be more consistent (#2996)
agnusmor Dec 27, 2023
bc2c8de
review logs to be more consistent. fix resource sustract in new wip b…
agnusmor Dec 28, 2023
11fcd73
Fix sequencer/executor metrics. Rename poolPackage/statePackage to po…
agnusmor Dec 30, 2023
05363e5
Fix/l2 block nonce (#3008)
tclemos Jan 2, 2024
35e208e
Data stream tool improvements (#3006)
ToniRamirezM Jan 2, 2024
2e584e7
fix (#2982)
ARR552 Jan 3, 2024
f6dad84
Optmize storage.StoreL2Block function. Fix tx index on receipt (#3009)
agnusmor Jan 3, 2024
f6b8366
Use %v instead %w to log errors. Fix HaltOnBatchNumber (#3012)
agnusmor Jan 3, 2024
9b3c2e0
e2e test fixes for groups 1, 2, 3, 4 and 7 (#3010)
tclemos Jan 3, 2024
2dde02e
fix sync permissionless partial process (#3017)
joanestebanr Jan 4, 2024
a535b1e
Fixes executor error handling (#3019)
ARR552 Jan 4, 2024
191f246
Fix process empty L2 block (#3021)
agnusmor Jan 4, 2024
82a8c2e
fix finalizer forced batches. fix storage.GetBatchByForcedBatchNum (#…
agnusmor Jan 4, 2024
c49ec70
Disable e2e forced batches tests, groups 9, 10 and 11 (#3025)
agnusmor Jan 4, 2024
5ee8bda
Fix delta stream etrog (#3022)
ToniRamirezM Jan 5, 2024
e95d482
Allow extra l2 information to be retrieved from standard endpoints co…
tclemos Jan 5, 2024
35fb766
Fix/sync l1 info tree data (#3033)
ARR552 Jan 5, 2024
e77ff9f
Cherry-pick #3000: Add zkevm_EstimateFee endpoint (#3035)
agnusmor Jan 7, 2024
532c5a7
fix synchronizer unittest and e2e group 6 (#3032)
joanestebanr Jan 8, 2024
1219930
fixes v1tov2 (#3039)
ARR552 Jan 8, 2024
b6ba613
chore: unslice slice expressions (#2976)
estensen Jan 8, 2024
f2bc119
chore: replace strings.SplitN(arg, sep, 2) with strings.Cut(arg, sep)…
estensen Jan 8, 2024
a79414b
chore: fix typos in Readme (#2980)
AdventureSeeker987 Jan 8, 2024
d19a5b3
Fix conflicts
arnaubennassar Jan 9, 2024
10fdcf9
Add new etrog fields to Data Stream and update tool (#3043)
ToniRamirezM Jan 9, 2024
e411c8c
WIP: pending smart contract fix to be able to compile
arnaubennassar Jan 9, 2024
dc8954d
Code compiles
arnaubennassar Jan 9, 2024
4641dfa
wip
dpunish3r Jan 10, 2024
ac5a221
Fix/aggregator etrog inforoot (#3048)
ARR552 Jan 10, 2024
6f2554c
Update L1 docker image
arnaubennassar Jan 10, 2024
5d9f5c4
fix (#3049)
ARR552 Jan 10, 2024
2cdfdbd
revert l2 block hash to ethereum standard (#3045)
tclemos Jan 10, 2024
5622d2e
Move DAC to separate package, code diff focused on etherman instead o…
arnaubennassar Jan 10, 2024
67b0f15
reduce code diff
arnaubennassar Jan 10, 2024
dd9299a
dacMan WIP
arnaubennassar Jan 10, 2024
fdfcb31
wip
dpunish3r Jan 10, 2024
46ee45a
wip
dpunish3r Jan 11, 2024
ed8f7a7
fix l1InfoRoot in sync, aggregator and state (#3052)
ARR552 Jan 11, 2024
45330a6
Add more unittest to synchronizer (#3040)
joanestebanr Jan 11, 2024
7de3f99
Modular DA
arnaubennassar Jan 11, 2024
bf6a510
Add default DA backend for the config file
arnaubennassar Jan 11, 2024
9d86a19
merge develop
dpunish3r Jan 11, 2024
f1fde83
Create DA backend logic
arnaubennassar Jan 11, 2024
8eefcd0
Create DA backend logic
arnaubennassar Jan 11, 2024
be20b57
A bit of cleaning
arnaubennassar Jan 11, 2024
92d608e
Doc gen
dpunish3r Jan 11, 2024
c8a3199
fix (#3055)
ARR552 Jan 11, 2024
cace712
fix error reading RawTxsData from DB for forced Batches (#3056)
joanestebanr Jan 11, 2024
0180aaf
Clean code
dpunish3r Jan 11, 2024
65fa196
Lint
arnaubennassar Jan 11, 2024
d4bc5f6
Only requires equence sender private key for the sequence sender
arnaubennassar Jan 11, 2024
04f53b8
Handle unkown type
dpunish3r Jan 11, 2024
20d5c44
Fix config test
arnaubennassar Jan 11, 2024
b8e5afe
WIP fixing UTs
arnaubennassar Jan 11, 2024
e9ca565
linter
dpunish3r Jan 12, 2024
b2705f7
Merge pull request #3054 from 0xPolygonHermez/feature/stream-batch-bo…
dpunish3r Jan 12, 2024
75a1489
Merge branch 'develop' into tool/egp
ToniRamirezM Jan 12, 2024
2c213cf
Merge pull request #2986 from 0xPolygonHermez/tool/egp
dpunish3r Jan 12, 2024
dac5335
fix timestamp (#3061)
ARR552 Jan 12, 2024
1205c7f
remove l1iforoot from stream (#3064)
ToniRamirezM Jan 12, 2024
4b0bcd3
fix unit tests (#3063)
ARR552 Jan 12, 2024
8c066ab
fix storing GER from L1 events (#3062)
joanestebanr Jan 12, 2024
3713e23
Fix Etherman UTs
arnaubennassar Jan 12, 2024
d57c19d
Fix Etherman UTs
arnaubennassar Jan 12, 2024
ccde139
remove unused code: ZeroL1InfoRoot cte (#3065)
joanestebanr Jan 15, 2024
2acd0ed
trusted sync: fix local_exit_root (#3067)
joanestebanr Jan 15, 2024
b90a885
WIP fixing UTs
arnaubennassar Jan 15, 2024
021a399
v1 to v2 working (#3069)
ARR552 Jan 15, 2024
fe3decc
added egp value for eth transfer. Fix zkevm_EstimateFee endpoint. Rem…
agnusmor Jan 15, 2024
e3de7a7
if a batch have no l2block it returns an zero l1inforoot (#3070)
joanestebanr Jan 15, 2024
27ce15f
add new executor errors (#3077)
ToniRamirezM Jan 15, 2024
b0edcf3
Add L1 block timestamp margin to send sequences (#3078)
agnusmor Jan 15, 2024
3e40964
fix finalize l2block when closing batch due to exhausted resource (#3…
agnusmor Jan 16, 2024
f42895b
reprocess trusted batch, use GER of leaf 0 of L1InfoRoot (#3086)
joanestebanr Jan 16, 2024
e57eecd
Update contracts and pass first E2E test
arnaubennassar Jan 16, 2024
8c526ae
fix default value for fromBlock when calling eth_getLogs (#3051)
tclemos Jan 16, 2024
9da3acf
Security - Add SHA Pin to Third Party Actions/Checkout Action (fixes …
joethechicken Jan 16, 2024
0a6240c
Get DA addr and name from L1
arnaubennassar Jan 16, 2024
9fc1143
for L1 sequence batch event if the batch only use leaf 0 set GER as 0…
joanestebanr Jan 17, 2024
fa59457
WIP
arnaubennassar Jan 17, 2024
13da817
Return zero GER when L1IntroTreeIndex is 0 (#3090)
agnusmor Jan 17, 2024
7c7a7d8
fix etrog stream generation (#3094)
ToniRamirezM Jan 17, 2024
bb93e04
Add code diff docs
arnaubennassar Jan 17, 2024
6d96e60
Fix linter
arnaubennassar Jan 17, 2024
40a9dc5
Updat config docs
arnaubennassar Jan 17, 2024
44a4eb5
Pass DAC test
arnaubennassar Jan 17, 2024
1690310
synchronizer: remove fatals (#3093)
joanestebanr Jan 18, 2024
f28d4f5
Feature/#3081 smc (#3097)
ARR552 Jan 18, 2024
bc72f05
etrog: Fix synchronizer OOC sequenced batch (#3095)
joanestebanr Jan 18, 2024
cfe5048
fix OOC errors (#3100)
ToniRamirezM Jan 18, 2024
8972932
remove l2 hash from eth_getTransactionReceipt (#3089)
tclemos Jan 18, 2024
3c7afae
Fix set l1InfoRootIndex on changeL2Block (#3099)
agnusmor Jan 18, 2024
5332980
fix stream (#3101)
ToniRamirezM Jan 18, 2024
5917449
build(deps): bump google.golang.org/protobuf from 1.31.0 to 1.32.0 (#…
dependabot[bot] Jan 18, 2024
eb78983
build(deps): bump github.com/rubenv/sql-migrate from 1.5.2 to 1.6.1 (…
dependabot[bot] Jan 18, 2024
0a11d35
Fix batch GER (#3104)
agnusmor Jan 19, 2024
de64ad2
force version of json-schema-for-humans to 0.47 (#3109)
joanestebanr Jan 19, 2024
25f4460
add new endpoint zkevm_getLatestGlobalExitRoot (#3103)
tclemos Jan 19, 2024
ebc24cf
Fix config test
arnaubennassar Jan 19, 2024
9d186be
Minor cleaning
arnaubennassar Jan 19, 2024
3810148
Fix merkle proof in aggregator. Fix finalize batch on sequencer (#3112)
agnusmor Jan 20, 2024
7a25b19
Fix new wipL2block on finalizeBatch function (#3113)
agnusmor Jan 21, 2024
5ef9d3a
fix l1InfoRoot (#3115)
ARR552 Jan 22, 2024
79d32bb
build(deps): bump google.golang.org/grpc from 1.60.0 to 1.60.1 (#2938)
dependabot[bot] Jan 22, 2024
1327d11
update prover image (#3114)
ToniRamirezM Jan 22, 2024
b69f85d
build(deps): bump github.com/prometheus/client_golang (#3105)
dependabot[bot] Jan 22, 2024
8e0b1f5
build(deps): bump golang.org/x/net from 0.19.0 to 0.20.0 (#3106)
dependabot[bot] Jan 22, 2024
05357ab
Feature/aggregator update etrog batch (#3117)
ARR552 Jan 22, 2024
a03bdeb
Add reuqests from PR
arnaubennassar Jan 22, 2024
76e3118
Add L2 block sequential process. Execute empty L2 block. Add tracking…
agnusmor Jan 22, 2024
1344f85
Fix conflicts
arnaubennassar Jan 23, 2024
a7ceb37
Upgrade contracts and fix compilation errors
arnaubennassar Jan 23, 2024
0cbd740
Update L1 docker image for testing
arnaubennassar Jan 23, 2024
65dd7ff
Fix UTs
arnaubennassar Jan 23, 2024
6f5a7a9
Update diff docs
arnaubennassar Jan 23, 2024
81e449c
Update config docs
arnaubennassar Jan 23, 2024
7c36fb3
WIP
arnaubennassar Jan 25, 2024
f85be4d
Fix linter
arnaubennassar Jan 25, 2024
6a6a6c7
Remove unnecessary GHA
arnaubennassar Jan 25, 2024
83a7967
Update diff html
arnaubennassar Jan 25, 2024
98f14f7
Fix linter
arnaubennassar Jan 25, 2024
097f930
Expand explanation of the code diff
arnaubennassar Jan 26, 2024
6208cca
minor config docs fixes
arnaubennassar Jan 26, 2024
916ec91
Merge pull request #61 from 0xPolygon/pullupstream/v0.5.0-RC23
arnaubennassar Feb 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ linters:
- gofmt
- goimports
- revive
- unconvert

linters-settings:
revive:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN cd /src/db && packr2
RUN cd /src && make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.18.0
FROM alpine:3.18.4
COPY --from=build /src/dist/zkevm-node /app/zkevm-node
COPY --from=build /src/config/environments/testnet/node.config.toml /app/example.config.toml
RUN apk update && apk add postgresql15-client
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For an in-depth understanding of the protocol’s specifications, please refer t

## Run a CDK Validium

> This repo is a fork of the [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node)
> This repo is a fork of the [zkevm-node](https://github.com/0xPolygonHermez/zkevm-node), more information and code diff explained [here](./docs/diff/diff.md)

### Development

Expand Down
107 changes: 94 additions & 13 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/0xPolygonHermez/zkevm-node/encoding"
ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types"
"github.com/0xPolygonHermez/zkevm-node/ethtxmanager"
"github.com/0xPolygonHermez/zkevm-node/l1infotree"
"github.com/0xPolygonHermez/zkevm-node/log"
"github.com/0xPolygonHermez/zkevm-node/state"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -268,7 +269,7 @@ func (a *Aggregator) sendFinalProof() {

// add batch verification to be monitored
sender := common.HexToAddress(a.cfg.SenderAddress)
to, data, err := a.Ethman.BuildTrustedVerifyBatchesTxData(proof.BatchNumber-1, proof.BatchNumberFinal, &inputs)
to, data, err := a.Ethman.BuildTrustedVerifyBatchesTxData(proof.BatchNumber-1, proof.BatchNumberFinal, &inputs, sender)
if err != nil {
log.Errorf("Error estimating batch verification to add to eth tx manager: %v", err)
a.handleFailureToAddVerifyBatchToBeMonitored(ctx, proof)
Expand Down Expand Up @@ -766,15 +767,15 @@ func (a *Aggregator) getAndLockBatchToProve(ctx context.Context, prover proverIn

log.Info("Checking profitability to aggregate batch")

// pass matic collateral as zero here, bcs in smart contract fee for aggregator is not defined yet
// pass pol collateral as zero here, bcs in smart contract fee for aggregator is not defined yet
isProfitable, err := a.ProfitabilityChecker.IsProfitable(ctx, big.NewInt(0))
if err != nil {
log.Errorf("Failed to check aggregator profitability, err: %v", err)
return nil, nil, err
}

if !isProfitable {
log.Infof("Batch is not profitable, matic collateral %d", big.NewInt(0))
log.Infof("Batch is not profitable, pol collateral %d", big.NewInt(0))
return nil, nil, err
}

Expand Down Expand Up @@ -977,18 +978,98 @@ func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state.
return nil, fmt.Errorf("failed to get previous batch, err: %v", err)
}

isForcedBatch := false
batchRawData := &state.BatchRawV2{}

if batchToVerify.BatchNumber == 1 || batchToVerify.ForcedBatchNum != nil {
isForcedBatch = true
} else {
batchRawData, err = state.DecodeBatchV2(batchToVerify.BatchL2Data)
if err != nil {
log.Errorf("Failed to decode batch data, err: %v", err)
return nil, err
}
}

l1InfoTreeData := map[uint32]*prover.L1Data{}
l1InfoRoot := common.Hash{}
forcedBlockhashL1 := common.Hash{}

if !isForcedBatch {
tree, err := l1infotree.NewL1InfoTree(32, [][32]byte{}) // nolint:gomnd
if err != nil {
return nil, err
}

for _, l2blockRaw := range batchRawData.Blocks {
_, contained := l1InfoTreeData[l2blockRaw.IndexL1InfoTree]
if !contained && l2blockRaw.IndexL1InfoTree != 0 {
if l2blockRaw.IndexL1InfoTree != 0 {
l1InfoTreeExitRootStorageEntry, err := a.State.GetL1InfoRootLeafByIndex(ctx, l2blockRaw.IndexL1InfoTree, nil)
if err != nil {
return nil, err
}

leaves, err := a.State.GetLeafsByL1InfoRoot(ctx, l1InfoTreeExitRootStorageEntry.L1InfoTreeRoot, nil)
if err != nil {
return nil, err
}

aLeaves := make([][32]byte, len(leaves))
for i, leaf := range leaves {
aLeaves[i] = l1infotree.HashLeafData(leaf.GlobalExitRoot.GlobalExitRoot, leaf.PreviousBlockHash, uint64(leaf.Timestamp.Unix()))
}

// Calculate smt proof
smtProof, _, err := tree.ComputeMerkleProof(l2blockRaw.IndexL1InfoTree, aLeaves)
if err != nil {
return nil, err
}

protoProof := make([][]byte, len(smtProof))
for i, proof := range smtProof {
protoProof[i] = proof[:]
}

l1InfoTreeData[l2blockRaw.IndexL1InfoTree] = &prover.L1Data{
GlobalExitRoot: l1InfoTreeExitRootStorageEntry.L1InfoTreeLeaf.GlobalExitRoot.GlobalExitRoot.Bytes(),
BlockhashL1: l1InfoTreeExitRootStorageEntry.L1InfoTreeLeaf.PreviousBlockHash.Bytes(),
MinTimestamp: uint32(l1InfoTreeExitRootStorageEntry.L1InfoTreeLeaf.GlobalExitRoot.Timestamp.Unix()),
SmtProof: protoProof,
}
}
}
}
} else {
// Initial batch must be handled differently
if batchToVerify.BatchNumber == 1 {
forcedBlockhashL1, err = a.State.GetVirtualBatchParentHash(ctx, batchToVerify.BatchNumber, nil)
if err != nil {
return nil, err
}
} else {
l1InfoRoot = batchToVerify.GlobalExitRoot
forcedBlockhashL1, err = a.State.GetForcedBatchParentHash(ctx, *batchToVerify.ForcedBatchNum, nil)
if err != nil {
return nil, err
}
}
}

inputProver := &prover.InputProver{
PublicInputs: &prover.PublicInputs{
OldStateRoot: previousBatch.StateRoot.Bytes(),
OldAccInputHash: previousBatch.AccInputHash.Bytes(),
OldBatchNum: previousBatch.BatchNumber,
ChainId: a.cfg.ChainID,
ForkId: a.cfg.ForkId,
BatchL2Data: batchToVerify.BatchL2Data,
GlobalExitRoot: batchToVerify.GlobalExitRoot.Bytes(),
EthTimestamp: uint64(batchToVerify.Timestamp.Unix()),
SequencerAddr: batchToVerify.Coinbase.String(),
AggregatorAddr: a.cfg.SenderAddress,
OldStateRoot: previousBatch.StateRoot.Bytes(),
OldAccInputHash: previousBatch.AccInputHash.Bytes(),
OldBatchNum: previousBatch.BatchNumber,
ChainId: a.cfg.ChainID,
ForkId: a.cfg.ForkId,
BatchL2Data: batchToVerify.BatchL2Data,
L1InfoRoot: l1InfoRoot.Bytes(),
TimestampLimit: uint64(batchToVerify.Timestamp.Unix()),
SequencerAddr: batchToVerify.Coinbase.String(),
AggregatorAddr: a.cfg.SenderAddress,
L1InfoTreeData: l1InfoTreeData,
ForcedBlockhashL1: forcedBlockhashL1.Bytes(),
},
Db: map[string]string{},
ContractsBytecode: map[string]string{},
Expand Down
8 changes: 4 additions & 4 deletions aggregator/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestSendFinalProof(t *testing.T) {
NewLocalExitRoot: finalBatch.LocalExitRoot.Bytes(),
NewStateRoot: finalBatch.StateRoot.Bytes(),
}
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs).Run(func(args mock.Arguments) {
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs, common.HexToAddress(cfg.SenderAddress)).Run(func(args mock.Arguments) {
assert.True(a.verifyingProof)
}).Return(nil, nil, errBanana).Once()
m.stateMock.On("UpdateGeneratedProof", mock.Anything, recursiveProof, nil).Run(func(args mock.Arguments) {
Expand All @@ -108,7 +108,7 @@ func TestSendFinalProof(t *testing.T) {
NewLocalExitRoot: finalBatch.LocalExitRoot.Bytes(),
NewStateRoot: finalBatch.StateRoot.Bytes(),
}
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs).Run(func(args mock.Arguments) {
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs, common.HexToAddress(cfg.SenderAddress)).Run(func(args mock.Arguments) {
assert.True(a.verifyingProof)
}).Return(nil, nil, errBanana).Once()
m.stateMock.On("UpdateGeneratedProof", mock.Anything, recursiveProof, nil).Run(func(args mock.Arguments) {
Expand All @@ -131,7 +131,7 @@ func TestSendFinalProof(t *testing.T) {
NewLocalExitRoot: finalBatch.LocalExitRoot.Bytes(),
NewStateRoot: finalBatch.StateRoot.Bytes(),
}
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs).Run(func(args mock.Arguments) {
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs, common.HexToAddress(cfg.SenderAddress)).Run(func(args mock.Arguments) {
assert.True(a.verifyingProof)
}).Return(&to, data, nil).Once()
monitoredTxID := buildMonitoredTxID(batchNum, batchNumFinal)
Expand All @@ -156,7 +156,7 @@ func TestSendFinalProof(t *testing.T) {
NewLocalExitRoot: finalBatch.LocalExitRoot.Bytes(),
NewStateRoot: finalBatch.StateRoot.Bytes(),
}
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs).Run(func(args mock.Arguments) {
m.etherman.On("BuildTrustedVerifyBatchesTxData", batchNum-1, batchNumFinal, &expectedInputs, common.HexToAddress(cfg.SenderAddress)).Run(func(args mock.Arguments) {
assert.True(a.verifyingProof)
}).Return(&to, data, nil).Once()
monitoredTxID := buildMonitoredTxID(batchNum, batchNumFinal)
Expand Down
6 changes: 5 additions & 1 deletion aggregator/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type ethTxManager interface {
// etherman contains the methods required to interact with ethereum
type etherman interface {
GetLatestVerifiedBatchNum() (uint64, error)
BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, inputs *ethmanTypes.FinalProofInputs) (to *common.Address, data []byte, err error)
BuildTrustedVerifyBatchesTxData(lastVerifiedBatch, newVerifiedBatch uint64, inputs *ethmanTypes.FinalProofInputs, beneficiary common.Address) (to *common.Address, data []byte, err error)
}

// aggregatorTxProfitabilityChecker interface for different profitability
Expand All @@ -62,4 +62,8 @@ type stateInterface interface {
DeleteUngeneratedProofs(ctx context.Context, dbTx pgx.Tx) error
CleanupGeneratedProofs(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error
CleanupLockedProofs(ctx context.Context, duration string, dbTx pgx.Tx) (int64, error)
GetL1InfoRootLeafByIndex(ctx context.Context, l1InfoTreeIndex uint32, dbTx pgx.Tx) (state.L1InfoTreeExitRootStorageEntry, error)
GetLeafsByL1InfoRoot(ctx context.Context, l1InfoRoot common.Hash, dbTx pgx.Tx) ([]state.L1InfoTreeExitRootStorageEntry, error)
GetVirtualBatchParentHash(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (common.Hash, error)
GetForcedBatchParentHash(ctx context.Context, forcedBatchNumber uint64, dbTx pgx.Tx) (common.Hash, error)
}
54 changes: 53 additions & 1 deletion aggregator/mocks/mock_dbtx.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading