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

L2 node becomes unresponsive after build a fake batch and submitting it to the contract #2740

Open
zjg555543 opened this issue Nov 2, 2023 · 0 comments

Comments

@zjg555543
Copy link

Question

How to fix this case when trust sequencor commit a dirty data into contract?

Steps

  1. Trust sequencor submitted a fraudulent batch (dirty data) to the contract.
  2. The L2 block is hang, and the sync module is unable to validate the fraudulent batch. However, the sequencer can still generate batches, but it cannot submit them to L1.

Code Example:

You can find the code changes related to this issue in the following pull request:
Link to Pull Request

Error Log:

2023-11-02T10:40:54.542Z	WARN	synchronizer/synchronizer.go:670	Different field StateRoot. Virtual: 0xb4aadfa877dd324b7ed923654181297e7996138e493c8657f78f42b487229156, Trusted: 0xab4c0d0cb7f9fd652f9b834b7f5f210e4e53f92697b6f9fc5c910e02a6e343a2
	{"pid": 1, "version": "v0.2.6-RC3-23-gbda7ff8e"}
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
	/src/synchronizer/synchronizer.go:670
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
	/src/synchronizer/synchronizer.go:950
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
	/src/synchronizer/synchronizer.go:494
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocks
	/src/synchronizer/synchronizer.go:334
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
	/src/synchronizer/synchronizer.go:271
main.runSynchronizer
	/src/cmd/run.go:310
2023-11-02T10:40:54.542Z	WARN	synchronizer/synchronizer.go:674	Different field BatchL2Data. Virtual: 0102030405, Trusted: eb0a843b9aca0082520894cd3b766ccdd6ae721141f452c550ca635964ce71865af3107a4000808203e980802f4cd402aa3fd983ba9cf6fb344e7cb4e33b6146df62c5dfef74145af382f56d0a01f5cbb16979e816916f0569415690cf028ad7b1bd3d136f7a329a12c48a751cffeb0b843b9aca0082520894cd3b766ccdd6ae721141f452c550ca635964ce71865af3107a4000808203e980800388356728342de0ce227e86dff5ee310a4ebbf69a712e332a7d41c355ea21097f111527f60b68a75fc5fe525c3e366f4559845da5e9aaa122e07395e94786111bff
	{"pid": 1, "version": "v0.2.6-RC3-23-gbda7ff8e"}
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
	/src/synchronizer/synchronizer.go:674
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
	/src/synchronizer/synchronizer.go:950
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
	/src/synchronizer/synchronizer.go:494
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocks
	/src/synchronizer/synchronizer.go:334
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
	/src/synchronizer/synchronizer.go:271
main.runSynchronizer
	/src/cmd/run.go:310
2023-11-02T10:40:54.542Z	WARN	synchronizer/synchronizer.go:682	Different field Timestamp. Virtual: 1698921627, Trusted: 1698921637
	{"pid": 1, "version": "v0.2.6-RC3-23-gbda7ff8e"}
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
	/src/synchronizer/synchronizer.go:682
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
	/src/synchronizer/synchronizer.go:950
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
	/src/synchronizer/synchronizer.go:494
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocks
	/src/synchronizer/synchronizer.go:334
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
	/src/synchronizer/synchronizer.go:271
main.runSynchronizer
	/src/cmd/run.go:310
2023-11-02T10:40:54.542Z	WARN	synchronizer/synchronizer.go:692	Missmatch in trusted state detected for Batch Number: 3. Reasons: Different field StateRoot. Virtual: 0xb4aadfa877dd324b7ed923654181297e7996138e493c8657f78f42b487229156, Trusted: 0xab4c0d0cb7f9fd652f9b834b7f5f210e4e53f92697b6f9fc5c910e02a6e343a2
Different field BatchL2Data. Virtual: 0102030405, Trusted: eb0a843b9aca0082520894cd3b766ccdd6ae721141f452c550ca635964ce71865af3107a4000808203e980802f4cd402aa3fd983ba9cf6fb344e7cb4e33b6146df62c5dfef74145af382f56d0a01f5cbb16979e816916f0569415690cf028ad7b1bd3d136f7a329a12c48a751cffeb0b843b9aca0082520894cd3b766ccdd6ae721141f452c550ca635964ce71865af3107a4000808203e980800388356728342de0ce227e86dff5ee310a4ebbf69a712e332a7d41c355ea21097f111527f60b68a75fc5fe525c3e366f4559845da5e9aaa122e07395e94786111bff
Different field Timestamp. Virtual: 1698921627, Trusted: 1698921637
	{"pid": 1, "version": "v0.2.6-RC3-23-gbda7ff8e"}
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
	/src/synchronizer/synchronizer.go:692
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
	/src/synchronizer/synchronizer.go:950
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
	/src/synchronizer/synchronizer.go:494
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocks
	/src/synchronizer/synchronizer.go:334
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
	/src/synchronizer/synchronizer.go:271
main.runSynchronizer
	/src/cmd/run.go:310
2023-11-02T10:40:54.542Z	ERROR	nileventstorage/nileventstorage.go:30	Event: &{Id:{neg:false abs:[]} ReceivedAt:2023-11-02 10:40:54.5425338 +0000 UTC m=+52.751336666 IPAddress: Source:node Component:synchronizer Level:crit EventID:SYNCHRONIZER HALT Description:Synchronizer halted due to error: TRUSTED REORG DETECTED! Batch: 3 Data:[] Json:<nil>} %!s(MISSING)	{"pid": 1, "version": "v0.2.6-RC3-23-gbda7ff8e"}
github.com/0xPolygonHermez/zkevm-node/event/nileventstorage.LogEvent
	/src/event/nileventstorage/nileventstorage.go:30
github.com/0xPolygonHermez/zkevm-node/event/pgeventstorage.(*PostgresEventStorage).LogEvent
	/src/event/pgeventstorage/pgeventstorage.go:45
github.com/0xPolygonHermez/zkevm-node/event.(*EventLog).LogEvent
	/src/event/eventlog.go:28
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).halt
	/src/synchronizer/synchronizer.go:1694
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).checkTrustedState
	/src/synchronizer/synchronizer.go:694
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processSequenceBatches
	/src/synchronizer/synchronizer.go:950
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).processBlockRange
	/src/synchronizer/synchronizer.go:494
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).syncBlocks
	/src/synchronizer/synchronizer.go:334
github.com/0xPolygonHermez/zkevm-node/synchronizer.(*ClientSynchronizer).Sync
	/src/synchronizer/synchronizer.go:271
main.runSynchronizer
	/src/cmd/run.go:310

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

No branches or pull requests

2 participants