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

bug: l2 block generation must be deterministic #100

Open
lispc opened this issue Jun 27, 2021 · 3 comments
Open

bug: l2 block generation must be deterministic #100

lispc opened this issue Jun 27, 2021 · 3 comments
Assignees

Comments

@lispc
Copy link
Member

lispc commented Jun 27, 2021

thread 'main' panicked at 'l2 block generation must be deterministic!', src/bin/main.rs:132:17

@lispc
Copy link
Member Author

lispc commented Jun 27, 2021

How to debug:

since we can persist GlobalState to sled db now, we can

(1) add a field PersistOption { dir: String, persist_every_n: usize }, if !dir.is_empty(), for every l2 block, if block_id % persist_every_n == 0, we dump the GlobalState to $dir/$block_id.db.
(2) set persist_every_n = 1, then run bash tests/global_state/test.sh and backup all the $dir/**.db
(3) rerun tests/global_state/test.sh.
(4) dump dbs in (2)(3) as txt json file, to check whether they are consistent. If not, great, we reproduced the bug. We can debug now...

@0xmountaintop
Copy link
Member

0xmountaintop commented Jun 28, 2021

will that be related to HashMap? I mean, for example, iterating maps in golang is non-deterministic....

@lightsing lightsing self-assigned this Jun 28, 2021
@lightsing
Copy link
Member

The dumps are consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants