erigon-pulse/cmd/state/commands/check_change_sets.go
Andrew Ashikhmin aeed1657c7
Issue #340: Re-execute all historical transaction in read-only mode and check ChangeSets (#388)
* Clean up code duplication between IntraBlockState's FinalizeTx & CommitBlock

* checkChangeSets command

* linter

* First attempt at checking account changes

* Reuse runBlock in CheckChangeSets

* linter

* linter

* Optionally include no-changes in the ChangeSets

* linter

* Detect storage changes for account change sets

* Fix post-merge compilation errors

* Use database format compatible with !debug.IsThinHistory()

* PrintChangedAccounts in ChangeSetWriter

* Avoid out-of-bounds access

* Storage changes

* hack FirstContractIncarnation

* Call ChangeSetWriter only once per block
2020-03-11 16:54:09 +01:00

21 lines
543 B
Go

package commands
import (
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
"github.com/spf13/cobra"
)
func init() {
withBlock(checkChangeSetsCmd)
withChaindata(checkChangeSetsCmd)
rootCmd.AddCommand(checkChangeSetsCmd)
}
var checkChangeSetsCmd = &cobra.Command{
Use: "checkChangeSets",
Short: "Re-executes historical transactions in read-only mode and checks that their outputs match the database ChangeSets",
RunE: func(cmd *cobra.Command, args []string) error {
return stateless.CheckChangeSets(block, chaindata)
},
}