cerc-io / go-ethereum

Read-only mirror of https://git.vdb.to/cerc-io/go-ethereum (Statediffing-fork of the official Go implementation of the Ethereum protocol)
https://git.vdb.to/cerc-io/go-ethereum
GNU Lesser General Public License v3.0
13 stars 4 forks source link

367: Check if the statediff is already in progress or completed. #392

Closed telackey closed 1 year ago

telackey commented 1 year ago

Related to https://github.com/cerc-io/go-ethereum/issues/367.

Add two checks:

1) Only allow a single statediff of a block hash+number at a time.

2) Do not state diff if that block hash+number already exists in the DB.

INFO [06-01|05:26:11.063] Not writing, statediff in progress.      number=605 hash=0x336e7cb623164e70dca3dc01c3dabf1a5e8af25f7c26db0e00eedc3e9c8c959d
INFO [06-01|05:26:11.083] Not writing, statediff already done.     number=600 hash=0x13399d30c79e8d32d00d6cb4ceb545a0467a61c58474986b6b74651d903a12ff