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

Write preimages and EVM state into erigon table #378

Draft
wants to merge 58 commits into
base: develop
Choose a base branch
from

Conversation

cyberbono3
Copy link
Collaborator

This PR is part of my ongoing work of erigon integration. I would appreciate if you can review it and give a feedback. This setup works on my private server. It introduces following functionality:

  1. Write mainnet preimages into erigon kv.Sender table ./build/opera preimages write.
INFO [10-18|13:42:05.582] Opening Database                         module=mdbx label=txpool path=/root/.opera/erigon/txpool
INFO [10-18|13:42:05.584] Reading preimages                        from file=/root/preimages/preimages.gz
INFO [10-18|13:42:05.584] Writing preimages to buf 
INFO [10-18|13:45:50.318] Reading preimages and writing preimages to buf completed elapsed=3m44.733s
INFO [10-18|13:45:50.318] Buffer length                            is=143,168,825
INFO [10-18|13:45:50.318] Sorting data in buffer started... 
INFO [10-18|13:51:43.455] Sorting data in buf completed            elapsed=5m53.136s
INFO [10-18|13:51:43.455] Iterate over sorted non duplicated buf key-value pairs and write them into=TxSender
INFO [10-18|13:52:29.753] Writing data into table from sorted buffer completed Number of records written=143,168,825 elapsed=46.297s
INFO [10-18|13:52:37.581] Writing preimages is complete            elapsed=10m31.999s
  1. Take mainnnet snapshot, loop over EVM accounts and write them into kv.PlainState table ./build/opera erigon write
INFO [10-18|13:56:18.435] Writing of EVM accounts into Erigon database started 
INFO [10-18|13:56:18.435] Opening Database                         module=mdbx label=txpool path=/root/.opera/erigon/txpool
INFO [10-18|13:56:18.435] Maximum peer count                       total=50
INFO [10-18|13:56:18.436] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [10-18|13:56:19.946] Getting EvmDb 
INFO [10-18|13:56:19.946] Getting FinalizedStateRoot 
INFO [10-18|13:56:19.946] Getting LastBlock 
INFO [10-18|13:56:19.946] Generate Erigon Plain State... 
INFO [10-18|13:56:19.947] Snapshot traversal started               root=0xfa2ea1380a1c3d1cc4c661b360cb00244351792c6ddc794e2f1bdd32811c01de
INFO [10-18|13:58:37.242] Snapshot traversal is complete           accounts=2,368,652 elapsed=2m17.295s missingContractCode=0
INFO [10-18|13:58:37.242] Valid                                    Contract accounts: =183,325 Storage records=151,099,089 Valid non contract accounts=2,110,884 invalid accounts1=0 invalid accounts2=74443
INFO [10-18|13:58:37.242] Buffer length                            is=153,467,741
INFO [10-18|13:58:37.242] Sorting data in buffer started... 
INFO [10-18|14:05:15.289] Sorting data is complete                 elapsed=6m38.046s
INFO [10-18|14:05:15.289] Iterate over sorted non duplicated buf key-value pairs and write them into=PlainState
INFO [10-18|14:06:37.484] Writing data into table from sorted buffer completed Number of records written=153,467,741 elapsed=1m22.195s
INFO [10-18|14:06:45.202] Writing data into erigon PlainState is complete elapsed=1m29.913s
INFO [10-18|14:06:45.202] Generation of Erigon Plain State is complete elapsed=10m26.767s

@quan8 quan8 changed the base branch from master to develop October 18, 2022 19:44
@cyberbono3 cyberbono3 force-pushed the feature/match-erigon-preimages branch from 3d390f2 to 3d3311c Compare October 21, 2022 10:25
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

Successfully merging this pull request may close these issues.

None yet

1 participant