Skip to content

Commit

Permalink
Merge pull request #233 from testinprod-io/feature/mininny/fix-holoce…
Browse files Browse the repository at this point in the history
…ne-payload-reference

Fix nil pointer dereference for holocene payload building
  • Loading branch information
mininny authored Nov 20, 2024
2 parents 43c4db0 + d0d4a28 commit 2788286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install dependencies
run: |
choco upgrade mingw -y --no-progress --version 13.2.0
choco install cmake -y --no-progress --version 3.27.8
choco install cmake -y --no-progress --version 3.31.0
- name: test-integration
run: .\wmake.ps1 test-integration
5 changes: 4 additions & 1 deletion eth/stagedsync/stage_mining_create_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ func SpawnMiningCreateBlockStage(s *StageState, tx kv.RwTx, cfg MiningCreateBloc
ibs := state.New(stateReader)

if cfg.chainConfig.IsHolocene(header.Time) {
if cfg.blockBuilderParameters == nil {
return fmt.Errorf("expected eip1559 params, got none")
}
if err := misc.ValidateHolocene1559Params(cfg.blockBuilderParameters.EIP1559Params); err != nil {
return err
}
Expand All @@ -230,7 +233,7 @@ func SpawnMiningCreateBlockStage(s *StageState, tx kv.RwTx, cfg MiningCreateBloc
e = cfg.chainConfig.ElasticityMultiplier(params.ElasticityMultiplier)
}
header.Extra = misc.EncodeHoloceneExtraData(uint32(d), uint32(e))
} else if cfg.blockBuilderParameters.EIP1559Params != nil {
} else if cfg.blockBuilderParameters != nil && cfg.blockBuilderParameters.EIP1559Params != nil {
return fmt.Errorf("got eip1559 params, expected none")
}

Expand Down

0 comments on commit 2788286

Please sign in to comment.