Skip to content

Commit 7f709cc

Browse files
committed
Clean up
1 parent 94d4b40 commit 7f709cc

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

runner/network/mempool/fake_mempool.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type FakeMempool interface {
2525
// StaticWorkloadMempool is a fake mempool that simulates a workload of transactions with no gas
2626
// or dependency tracking.
2727
type StaticWorkloadMempool struct {
28-
chainID *big.Int
2928
// needs to be thread safe to share between workers (could be converted to channel)
3029
lock sync.Mutex
3130
log log.Logger
@@ -38,15 +37,14 @@ type StaticWorkloadMempool struct {
3837
// sequencer txs included in payload attributes
3938
currentBlockSequencerTxs [][]byte
4039

41-
chainId *big.Int
40+
chainID *big.Int
4241
}
4342

4443
func NewStaticWorkloadMempool(log log.Logger, chainID *big.Int) *StaticWorkloadMempool {
4544
return &StaticWorkloadMempool{
46-
chainID: chainID,
4745
log: log,
4846
addressNonce: make(map[common.Address]uint64),
49-
chainId: chainId,
47+
chainID: chainID,
5048
}
5149
}
5250

runner/payload/simulator/cmd/main.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ var flags = []cli.Flag{
2020
Usage: "RPC URL of the chain to fetch payloads from",
2121
Required: true,
2222
},
23-
&cli.StringFlag{
24-
Name: "block-range",
25-
Usage: "Block range to fetch payloads from",
26-
Required: false,
27-
},
28-
&cli.StringFlag{
29-
Name: "output",
30-
Usage: "Path to the output JSON file",
31-
Value: "stats.json",
32-
},
3323
&cli.IntFlag{
3424
Name: "sample-size",
3525
Usage: "Number of payloads to sample",
@@ -60,8 +50,6 @@ func main() {
6050
rpcURL := c.String("rpc-url")
6151
chainID := c.String("chain-id")
6252
genesisFilePath := c.String("genesis")
63-
// blockRange := c.String("block-range")
64-
// output := c.String("output")
6553
sampleSize := c.Int("sample-size")
6654

6755
var genesis *core.Genesis

runner/payload/simulator/cmd/stats.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ func executeBlock(log log.Logger, client *ethclient.Client, parent *types.Block,
349349
oracleKv := newPreimageOracle(db, codes, nodes)
350350
oracleDb := NewOracleBackedDB(db, oracleKv, eth.ChainIDFromBig(genesis.Config.ChainID))
351351

352+
// copied from geth:
352353
statedb, err := state.New(parent.Root(), state.NewDatabase(triedb.NewDatabase(rawdb.NewDatabase(oracleDb), nil), nil))
353354
if err != nil {
354355
return nil, nil, fmt.Errorf("failed to init state db around block %s (state %s): %w", parent.Hash().Hex(), parent.Root().Hex(), err)
@@ -373,12 +374,7 @@ func executeBlock(log log.Logger, client *ethclient.Client, parent *types.Block,
373374
root := crypto.Keccak256Hash([]byte("fake-beacon-block-root"), header.Number.Bytes())
374375
header.ParentBeaconRoot = &root
375376

376-
// Copied from op-program/client/l2/engineapi/block_processor.go
377-
// TODO(client-pod#826)
378-
// Unfortunately this is not part of any Geth environment setup,
379-
// we just have to apply it, like how the Geth block-builder worker does.
380377
context := core.NewEVMBlockContext(header, chainCtx, nil, genesis.Config, statedb)
381-
// NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility
382378
var precompileOverrides vm.PrecompileOverrides
383379

384380
vmenv := vm.NewEVM(context, statedb, genesis.Config, vm.Config{PrecompileOverrides: precompileOverrides, Tracer: blockTracer.Tracer()})

0 commit comments

Comments
 (0)