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

BatchL2Data not stored from broadcast #1851

Closed
arnaubennassar opened this issue Mar 17, 2023 · 1 comment · Fixed by #1840
Closed

BatchL2Data not stored from broadcast #1851

arnaubennassar opened this issue Mar 17, 2023 · 1 comment · Fixed by #1840
Assignees
Labels
bug Something isn't working synchronizer

Comments

@arnaubennassar
Copy link
Member

arnaubennassar commented Mar 17, 2023

While adding an E2E test for the broadcast (among other things) here #1850 I added a last check at the end: assert that there are no trusted reorgs.

There are trusted reorgs because the batch L2 data doesn't match. Looks like this field is not added into the DB when syncing trough the broadcast mechanism:

PERMISSIONLESS NODE:
state_db=# select batch_num, length(raw_txs_data), state_root from state.batch;
 batch_num | length |                             state_root                             
-----------+--------+--------------------------------------------------------------------
         0 |        | 0x3824eeb6f0c07faa3e6bf46d22b54089a20f93f4e288faca40b6e57b208dee93
         1 |        | 0x816ca1572953a5abac3c16bdeab019520625663fee0f028020580ac9b8e63118  <== MISSING
         2 |        | 
(3 rows)

state_db=# select block_num, state_root from state.l2block;
 block_num |                             state_root                             
-----------+--------------------------------------------------------------------
         0 | 0x3824eeb6f0c07faa3e6bf46d22b54089a20f93f4e288faca40b6e57b208dee93
         1 | 0x154d392b1b132b3c515764ebe57b7d2fdb1723e1019de815ad4aa63064b51c9b
         2 | 0x56688420f110d9759f2c90f82b794f380bf2bd22c9552a8056ae0ccedc535b3c
         3 | 0xf8bedd65771dc49c6e44fcd33f3e1bc9efb776973b68268332744cfebedc9e50
         4 | 0xed7e1219501e66cdd70ffdc6e4d233715907861630e0a59cb412f37f2e72a613
         5 | 0xa49f6b5eabb644e6ae46ba60c1093fd9195293f8513890629b47f3be1139283b
         6 | 0xc5705ef683ddcb6422ce734783c61d5e99b334c480eafa3a4dfe32150ab04814
         7 | 0xdfc48fa677acde0ab49501ff34b453aa257dcd8baa487316a419fff1a394bdcf
         8 | 0xe5f02d2b6b662e5646df125182673b81e445bbb1a41310f534c355be880a7c96
         9 | 0x384cd1452b6ba36f2d21e3e8a19a1a920f88d68ec1771b8122e5e56c235b183d
        10 | 0xa79fc3e0ceccd7c3468ed9dbb362092eaeb429194f6c61501026d904d736feb7
        11 | 0x94e7bdd95809cb41726713c28cfe34f69c8dc9f3d9ca94c4b46f3116f2c551de
        12 | 0x258f12ce31f517a3cbe9edb05d22b643a52e33ebe83a321024bfdfaf5b9b1941
        13 | 0x9cac900a3b6854dfdd7ac21af4cc010aaa8b7bdcf45855fb31acafb8caafacc1
        14 | 0x52973573954ad01cd134349ae6d66edf528006899368f2e994b180f2e95a81db
        15 | 0x0a930e0faf5255112b8e6a405cbacd9f25c988f2ac180730d64ad984e6e6001d
        16 | 0x013fc1a4fe22971314a03f3c1accd46a2968fcf97039f6f95963575d89633a49
        17 | 0x8319e146cf385b5775827d1db8fa53961a1d3a022d551ee10f39937250bb71b0
        18 | 0x2185dea086deee69d1a76083690028aba064751c26714fdaf605f28f749a3f88
        19 | 0x4c8f4d332aae427b2641b2d19de028542a046a6f521287b50f732f6f984a2c40
        20 | 0x816ca1572953a5abac3c16bdeab019520625663fee0f028020580ac9b8e63118
(21 rows)

TRUSTED NODE

select batch_num, length(raw_txs_data), state_root from state.batch;
 batch_num | length |                             state_root                             
-----------+--------+--------------------------------------------------------------------
         0 |        | 0x3824eeb6f0c07faa3e6bf46d22b54089a20f93f4e288faca40b6e57b208dee93
         1 |   2100 | 0x816ca1572953a5abac3c16bdeab019520625663fee0f028020580ac9b8e63118  <== NOT MISSING
         2 |        | 
(3 rows)

state_db=# select block_num, state_root from state.l2block;
 block_num |                             state_root                             
-----------+--------------------------------------------------------------------
         0 | 0x3824eeb6f0c07faa3e6bf46d22b54089a20f93f4e288faca40b6e57b208dee93
         1 | 0x154d392b1b132b3c515764ebe57b7d2fdb1723e1019de815ad4aa63064b51c9b
         2 | 0x56688420f110d9759f2c90f82b794f380bf2bd22c9552a8056ae0ccedc535b3c
         3 | 0xf8bedd65771dc49c6e44fcd33f3e1bc9efb776973b68268332744cfebedc9e50
         4 | 0xed7e1219501e66cdd70ffdc6e4d233715907861630e0a59cb412f37f2e72a613
         5 | 0xa49f6b5eabb644e6ae46ba60c1093fd9195293f8513890629b47f3be1139283b
         6 | 0xc5705ef683ddcb6422ce734783c61d5e99b334c480eafa3a4dfe32150ab04814
         7 | 0xdfc48fa677acde0ab49501ff34b453aa257dcd8baa487316a419fff1a394bdcf
         8 | 0xe5f02d2b6b662e5646df125182673b81e445bbb1a41310f534c355be880a7c96
         9 | 0x384cd1452b6ba36f2d21e3e8a19a1a920f88d68ec1771b8122e5e56c235b183d
        10 | 0xa79fc3e0ceccd7c3468ed9dbb362092eaeb429194f6c61501026d904d736feb7
        11 | 0x94e7bdd95809cb41726713c28cfe34f69c8dc9f3d9ca94c4b46f3116f2c551de
        12 | 0x258f12ce31f517a3cbe9edb05d22b643a52e33ebe83a321024bfdfaf5b9b1941
        13 | 0x9cac900a3b6854dfdd7ac21af4cc010aaa8b7bdcf45855fb31acafb8caafacc1
        14 | 0x52973573954ad01cd134349ae6d66edf528006899368f2e994b180f2e95a81db
        15 | 0x0a930e0faf5255112b8e6a405cbacd9f25c988f2ac180730d64ad984e6e6001d
        16 | 0x013fc1a4fe22971314a03f3c1accd46a2968fcf97039f6f95963575d89633a49
        17 | 0x8319e146cf385b5775827d1db8fa53961a1d3a022d551ee10f39937250bb71b0
        18 | 0x2185dea086deee69d1a76083690028aba064751c26714fdaf605f28f749a3f88
        19 | 0x4c8f4d332aae427b2641b2d19de028542a046a6f521287b50f732f6f984a2c40
        20 | 0x816ca1572953a5abac3c16bdeab019520625663fee0f028020580ac9b8e63118
(21 rows)

Note that the data is well synchronized, the txs match, even the state root. It's just the batch L2 data missing. And because of that, when the state gets virtualized, the synchronizer detects a missmatch and does the reorg

@arnaubennassar arnaubennassar added bug Something isn't working synchronizer labels Mar 17, 2023
@tclemos
Copy link
Contributor

tclemos commented Mar 17, 2023

It's being fixed by the PR that's going to close this issue #1839

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working synchronizer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants