diff --git a/cmd/util/cmd/re-execute-block/cmd.go b/cmd/util/cmd/re-execute-block/cmd.go index c92ffc7fc26..3f65ec4951d 100644 --- a/cmd/util/cmd/re-execute-block/cmd.go +++ b/cmd/util/cmd/re-execute-block/cmd.go @@ -82,10 +82,11 @@ func init() { _ = Cmd.MarkPersistentFlagRequired("nodeid") Cmd.Flags().IntVar(&flagFrom, "from", 0, "from segment") + _ = Cmd.MarkPersistentFlagRequired("from") } func run(*cobra.Command, []string) { - err := runWithFlags(flagDatadir, flagExecutionStateDir, flagChunkDataPackDir, flagBootstrapDir, flagExecutionDataDir, flagNodeID, uint64(flagFrom)) + err := runWithFlags(flagDatadir, flagChunkDataPackDir, flagExecutionStateDir, flagBootstrapDir, flagExecutionDataDir, flagNodeID, uint64(flagFrom)) if err != nil { log.Fatal().Err(err).Msg("could not run with flags") } @@ -100,6 +101,15 @@ func runWithFlags( nodeID string, height uint64, ) error { + log.Info(). + Str("datadir", datadir). + Str("chunkDataPackDir", chunkDataPackDir). + Str("trieDir", trieDir). + Str("bootstrapDir", bootstrapDir). + Str("executionDataDir", executionDataDir). + Str("nodeID", nodeID). + Uint64("height", height). + Msg("re-execute block") db := common.InitStorage(flagDatadir) defer db.Close() @@ -231,10 +241,15 @@ func ExecuteBlock( return err } - _, err = executeBlock(execState, computationManager, context.Background(), block) + log.Info().Msgf("executing block %v", block.Block.Header.ID()) + + result, err := executeBlock(execState, computationManager, context.Background(), block) if err != nil { return err } + + log.Info().Msgf("block %v executed, result ID: %v", block.Block.Header.ID(), result.ID()) + return nil } diff --git a/fvm/evm/handler/handler.go b/fvm/evm/handler/handler.go index f2943b9243b..e52cc8514da 100644 --- a/fvm/evm/handler/handler.go +++ b/fvm/evm/handler/handler.go @@ -7,6 +7,7 @@ import ( "github.com/onflow/cadence/common" gethCommon "github.com/onflow/go-ethereum/common" gethTypes "github.com/onflow/go-ethereum/core/types" + "github.com/rs/zerolog/log" "go.opentelemetry.io/otel/attribute" "github.com/onflow/flow-go/fvm/environment" @@ -399,6 +400,13 @@ func (h *ContractHandler) run(rlpEncodedTx []byte) (*types.Result, error) { return nil, types.ErrUnexpectedEmptyResult } + log.Info(). + Str("tx_hash", res.TxHash.String()). + Uint64("gas_consumed", res.GasConsumed). + Uint64("cumulative_gas_used", res.CumulativeGasUsed). + Uint64("gas_refund", res.GasRefund). + Msg("executed transaction") + // step 6 - meter gas anyway (even for invalid or failed states) err = h.meterGasUsage(res) if err != nil {