mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-01 00:31:21 +00:00
ed1819ec58
* OpcodeTracer * Cleanup, rename to opcode_tracer * Bring back check_change_sets, remove repeated vars * Cleanup, gofmt * Linter, cleanup * Rename "segments" to "basic blocks", "bblocks" * gofmt * Lintci madness
31 lines
896 B
Go
31 lines
896 B
Go
package commands
|
|
|
|
import (
|
|
"github.com/ledgerwatch/turbo-geth/cmd/state/stateless"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
numBlocks uint64
|
|
saveOpcodes bool
|
|
saveBBlocks bool
|
|
)
|
|
|
|
func init() {
|
|
withBlock(opcodeTracer)
|
|
withChaindata(opcodeTracer)
|
|
opcodeTracer.Flags().Uint64Var(&numBlocks, "numBlocks", 1, "number of blocks to run the operation on")
|
|
opcodeTracer.Flags().BoolVar(&saveOpcodes, "saveOpcodes", false, "set to save the opcodes")
|
|
opcodeTracer.Flags().BoolVar(&saveBBlocks, "saveBBlocks", false, "set to save the basic blocks")
|
|
|
|
rootCmd.AddCommand(opcodeTracer)
|
|
}
|
|
|
|
var opcodeTracer = &cobra.Command{
|
|
Use: "opcodeTracer",
|
|
Short: "Re-executes historical transactions in read-only mode and traces them at the opcode level",
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
return stateless.OpcodeTracer(genesis, block, chaindata, numBlocks, saveOpcodes, saveBBlocks)
|
|
},
|
|
}
|