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

feat: cdk-erigon node #2

Closed
wants to merge 2 commits into from
Closed

feat: cdk-erigon node #2

wants to merge 2 commits into from

Conversation

leovct
Copy link
Member

@leovct leovct commented Mar 13, 2024

Introduction

  • Add a new package to spin up a cdk-erigon node.
  • Deploy a default cdk-erigon node in the cdk package.

TODOs

INFO[03-13|18:10:46.826] logging to file system                   log dir=/root/.local/share/erigon/logs file prefix=erigon log level=info json=false
INFO[03-13|18:10:46.835] Build info                               git_branch=feat/start-node-against-local-l1-chain git_tag=untagged git_commit=1297a98a3adc7d71d79243b2f3c406e7f6bdcfa7
INFO[03-13|18:10:46.835] Poseidon hashing                         Accelerated=true
INFO[03-13|18:10:46.835] Starting Erigon on                       devnet=hermez-dev
INFO[03-13|18:10:46.836] Maximum peer count                       ETH=0 total=0
INFO[03-13|18:10:46.836] starting HTTP APIs                       APIs=eth,debug,net,trace,web3,erigon,zkevm
INFO[03-13|18:10:46.836] torrent verbosity                        level=WRN
INFO[03-13|18:10:48.947] Set global gas cap                       cap=50000000
INFO[03-13|18:10:48.956] [Downloader] Runnning with               ipv6-enabled=true ipv4-enabled=true download.rate=16mb upload.rate=4mb
INFO[03-13|18:10:48.957] Opening Database                         label=chaindata path=/var/lib/cdk-erigon/chaindata
INFO[03-13|18:10:48.967] Initialised chain configuration          config="{ChainID: 999999, Homestead: 0, DAO: 0, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: 18446744073709551615, Arrow Glacier: 9999999999999999999999999999999999999999999999999, Gray Glacier: 9999999999999999999999999999999999999999999999999, Terminal Total Difficulty: 58750000000000000000000, Merge Netsplit: <nil>, Shanghai: 18446744073709551615, Cancun: 18446744073709551615, Prague: 18446744073709551615, Engine: ethash}" genesis=0x433043a1b0948d109cd92a6b7e0e5a3f011c761d70eebe3135ec8f7a39815a65
INFO[03-13|18:10:48.968] Effective                                prune_flags= snapshot_flags= history.v3=false
INFO[03-13|18:10:48.976] Initialising Ethereum protocol           network=999999
INFO[03-13|18:10:48.977] Disk storage enabled for ethash DAGs     dir=/var/lib/cdk-erigon/ethash-dags count=2
INFO[03-13|18:10:48.982] Starting private RPC server              on=127.0.0.1:9090
INFO[03-13|18:10:48.983] new subscription to logs established 
INFO[03-13|18:10:48.983] Starting datastream client... 
INFO[03-13|18:10:49.005] Datastream client initialized... 
INFO[03-13|18:10:49.008] rpc filters: subscribing to Erigon events 
INFO[03-13|18:10:49.009] Reading JWT secret                       path=/var/lib/cdk-erigon/jwt.hex
INFO[03-13|18:10:49.009] new subscription to newHeaders established 
INFO[03-13|18:10:49.009] HTTP endpoint opened for Engine API      url=127.0.0.1:8551 ws=true ws.compression=true
INFO[03-13|18:10:49.009] HTTP endpoint opened                     url=[::]:8545 ws=false ws.compression=true grpc=false
INFO[03-13|18:10:49.013] Started P2P networking                   version=68 self=enode://918b15c2121bef970c6f5962545444a5715de3e505b9532c43f20705b2fe68434b2ed7578dccf7e42c230614bed4dedef0722a03e2bcf61fe4f07a9a40c11bad@127.0.0.1:0 name=erigon/v2.43.0-dev-1297a98a/linux-arm64/go1.19.13
INFO[03-13|18:10:49.015] Started P2P networking                   version=67 self=enode://918b15c2121bef970c6f5962545444a5715de3e505b9532c43f20705b2fe68434b2ed7578dccf7e42c230614bed4dedef0722a03e2bcf61fe4f07a9a40c11bad@127.0.0.1:0 name=erigon/v2.43.0-dev-1297a98a/linux-arm64/go1.19.13
INFO[03-13|18:10:49.019] [1/15 L1Syncer] Starting L1 sync stage 
INFO[03-13|18:10:49.021] Starting L1 syncer thread 
INFO[03-13|18:10:49.023] [1/15 L1Syncer] Saving L1 syncer progress latestCheckedBlock=373 newVerificationsCount=0 newSequencesCount=0
INFO[03-13|18:10:49.024] [1/15 L1Syncer] Finished L1 sync stage  
INFO[03-13|18:10:49.024] [2/15 Batches] Starting batches stage 
INFO[03-13|18:10:49.024] [2/15 Batches] Starting stream           startBlock=418
INFO[03-13|18:10:49.024] [2/15 Batches] Reading blocks from the datastream. 
INFO[03-13|18:10:49.024] [2/15 Batches] Started downloading L2Blocks routine 
INFO[03-13|18:10:49.538] [2/15 Batches] No new blocks in 501 miliseconds. Ending the stage. lastBlockHeight=982
INFO[03-13|18:10:49.538] [2/15 Batches] Total blocks read: 564 
INFO[03-13|18:10:49.538] [2/15 Batches] Finished writing blocks   blocksWritten=564 elapsed=513.232167ms
INFO[03-13|18:10:49.538] [2/15 Batches] Saving stage progress     lastBlockHeight=982
INFO[03-13|18:10:49.542] [2/15 Batches] Finished Batches stage 
INFO[03-13|18:10:49.542] [3/15 BlockHashes] Etl transform started 
INFO[03-13|18:10:49.543] [3/15 BlockHashes] Etl transform ended 
INFO[03-13|18:10:49.543] [4/15 Senders] Started                   from=418 to=982
INFO[03-13|18:10:49.544] [4/15 Senders] Finished 
INFO[03-13|18:10:49.545] [5/15 Execution] Blocks execution        from=418 to=982
INFO[03-13|18:10:50.010] [5/15 Execution] Commiting DB transaction... block=982
INFO[03-13|18:10:50.014] [5/15 Execution] Completed on            block=982
INFO[03-13|18:10:50.014] [6/15 CumulativeIndex] Started 
INFO[03-13|18:10:50.017] [6/15 CumulativeIndex] Finished 
INFO[03-13|18:10:50.017] [7/15 HashState] Started 
INFO[03-13|18:10:50.017] [7/15 HashState] Promoting plain state   from=418 to=982
INFO[03-13|18:10:50.017] [7/15 HashState] Incremental promotion   from=418 to=982 codes=true csbucket=AccountChangeSet
INFO[03-13|18:10:50.017] [7/15 HashState] Incremental promotion   from=418 to=982 codes=false csbucket=AccountChangeSet
INFO[03-13|18:10:50.018] [7/15 HashState] Incremental promotion   from=418 to=982 codes=false csbucket=StorageChangeSet
INFO[03-13|18:10:50.022] [7/15 HashState] Finished 
INFO[03-13|18:10:50.022] [8/15 IntermediateHashes] Generating intermediate hashes from=0 to=982
INFO[03-13|18:10:50.022] [8/15 IntermediateHashes] Regeneration trie hashes started 
INFO[03-13|18:10:50.023] [8/15 IntermediateHashes] Collecting account data... 
INFO[03-13|18:10:50.080] [8/15 IntermediateHashes] Collecting account data finished in 57.555667ms 
INFO[03-13|18:10:50.080] [8/15 IntermediateHashes] Building temp binary tree started 
INFO[03-13|18:10:50.080] [8/15 IntermediateHashes] Total values to insert: 1030 
INFO[03-13|18:10:50.080] [8/15 IntermediateHashes] Sorting keys... 
INFO[03-13|18:10:50.081] [8/15 IntermediateHashes] Keys sorted in 321.666µs 
INFO[03-13|18:10:50.160] [8/15 IntermediateHashes] Finished the temp tree build in 79.434583ms, hashing and saving the result... 
INFO[03-13|18:10:50.160] [8/15 IntermediateHashes] Regeneration ended 
INFO[03-13|18:10:50.160] [8/15 IntermediateHashes] Trie root      hash=0x88a5f1972c7cc73aca32f26030d55bb0c8d0aa2ea0666de0891377c819ff8a44
EROR[03-13|18:10:50.160] wrong root                               blockNumber=982 expected root=0xec08b0f39e85beeb702d0714ed172545e476a7962fe39f9f38d501b72443170d actual root=0x88a5f1972c7cc73aca32f26030d55bb0c8d0aa2ea0666de0891377c819ff8a44
INFO[03-13|18:10:50.161] Checking root with RPC... 
panic: state root mismatch (checking state and RPC): wrong trie root at 982: 88a5f1972c7cc73aca32f26030d55bb0c8d0aa2ea0666de0891377c819ff8a44, expected (from header): ec08b0f39e85beeb702d0714ed172545e476a7962fe39f9f38d501b72443170d, from rpc: ec08b0f39e85beeb702d0714ed172545e476a7962fe39f9f38d501b72443170d, 0x88a5f1972c7cc73aca32f26030d55bb0c8d0aa2ea0666de0891377c819ff8a44

goroutine 134 [running]:
github.com/ledgerwatch/erigon/zk/stages.SpawnZkIntermediateHashesStage(0x4004c48780, {0x2bc9348?, 0x4000054038?}, {0x0, 0x0}, {{0x2be3330, 0x400053af70}, 0x1, 0x0, {0x400161b290, ...}, ...}, ...)
	github.com/ledgerwatch/erigon/zk/stages/stage_interhashes.go:164 +0x1178
github.com/ledgerwatch/erigon/zk/stages.DefaultZkStages.func22(0xf0?, 0xfe?, 0x241ff59?, {0x2ba6520?, 0x400017fef0?}, {0x0?, 0x0?}, 0x70?)
	github.com/ledgerwatch/erigon/zk/stages/stages.go:361 +0x70
github.com/ledgerwatch/erigon/eth/stagedsync.(*Sync).runStage(0x400017fef0, 0x400099f5e0, {0x2be3330?, 0x400053af70}, {0x0?, 0x0}, 0xa0?, 0x31?, 0x4?)
	github.com/ledgerwatch/erigon/eth/stagedsync/sync.go:358 +0xec
github.com/ledgerwatch/erigon/eth/stagedsync.(*Sync).Run(0x400017fef0, {0x2be3330, 0x400053af70}, {0x0, 0x0}, 0x0?, 0x0?)
	github.com/ledgerwatch/erigon/eth/stagedsync/sync.go:260 +0x214
github.com/ledgerwatch/erigon/turbo/stages.StageLoopStep({0x2bc9310?, 0x4002578400}, 0x4000079e48?, {0x2be3330, 0x400053af70}, 0x400017fef0, 0x4000b07580, 0x1, 0x40009e4890)
	github.com/ledgerwatch/erigon/turbo/stages/stageloop.go:169 +0x334
github.com/ledgerwatch/erigon/turbo/stages.StageLoop({0x2bc9310, 0x4002578400}, 0x0?, {0x2be3330?, 0x400053af70}, 0x2bc9310?, 0x40009eab40, 0x300000000000000?, 0xec8b30?, 0x40001ecdc0?, ...)
	github.com/ledgerwatch/erigon/turbo/stages/stageloop.go:95 +0xd8
created by github.com/ledgerwatch/erigon/eth.(*Ethereum).Start
	github.com/ledgerwatch/erigon/eth/backend.go:1244 +0x1e4
root@272a1ed440e8:/# ^C
root@272a1ed440e8:/# ^C
root@272a1ed440e8:/# 
exit
```

Copy link

sonarcloud bot commented Mar 21, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

@jhkimqd jhkimqd self-requested a review April 1, 2024 03:58
@jhkimqd jhkimqd assigned jhkimqd and unassigned jhkimqd Apr 1, 2024
@leovct
Copy link
Member Author

leovct commented Apr 6, 2024

Closing this PR as we now have a work-around (which is a bit complicated so we are waiting for some changes from the cdk-erigon team).

@leovct leovct closed this Apr 6, 2024
@leovct leovct deleted the feat/cdk-erigon-node branch April 6, 2024 18:09
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.

2 participants