Skip to content

Commit

Permalink
Remove deletion of zero address
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Nov 17, 2024
1 parent 6ce9d46 commit 12052ae
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions services/ingestion/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

pebbleDB "github.com/cockroachdb/pebble"
"github.com/onflow/flow-go-sdk"
gethCommon "github.com/onflow/go-ethereum/common"
gethTypes "github.com/onflow/go-ethereum/core/types"
"github.com/rs/zerolog"

Expand All @@ -18,8 +17,6 @@ import (
"github.com/onflow/flow-evm-gateway/storage"
"github.com/onflow/flow-evm-gateway/storage/pebble"

evmState "github.com/onflow/flow-go/fvm/evm/emulator/state"
evmStorage "github.com/onflow/flow-go/fvm/evm/offchain/storage"
"github.com/onflow/flow-go/fvm/evm/offchain/sync"
)

Expand Down Expand Up @@ -207,27 +204,6 @@ func (e *Engine) processEvents(events *models.CadenceEvents) error {
// Step 1.2: Replay all block transactions
// If `ReplayBlock` returns any error, we abort the EVM events processing
blockEvents := events.BlockEventPayload()
if events.Block().Height == 8008603 && e.replayerConfig.ChainID == flowGo.Testnet {
// prepare storage
st, err := e.registerStore.GetSnapshotAt(events.Block().Height)
if err != nil {
return err
}
// create storage
state := evmStorage.NewEphemeralStorage(evmStorage.NewReadOnlyStorage(st))

//delete 0 address to fix gasUsage issue on testnet
base, err := evmState.NewBaseView(state, e.replayerConfig.RootAddr)
if err != nil {
return err
}
if err := base.DeleteAccount(gethCommon.Address{}); err != nil {
return err
}
if err := base.Commit(); err != nil {
return err
}
}
res, err := replayer.ReplayBlock(events.TxEventPayloads(), blockEvents)
if err != nil {
return fmt.Errorf("failed to replay block on height: %d, with: %w", events.Block().Height, err)
Expand Down

0 comments on commit 12052ae

Please sign in to comment.