Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsign committed Oct 25, 2024
1 parent 606e682 commit 4afce0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
if root := statedb.IntermediateRoot(v.config.IsEIP158(header.Number)); header.Root != root {
return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error())
}

if blockEw := block.ExecutionWitness(); blockEw != nil && v.bc.Config().IsVerkle(header.Number, header.Time) {
if blockEw := block.ExecutionWitness(); blockEw != nil {
parent := v.bc.GetHeaderByNumber(header.Number.Uint64() - 1)
if parent == nil {
return fmt.Errorf("nil parent header for block %d", header.Number)
Expand Down
4 changes: 2 additions & 2 deletions tests/block_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type btBlock struct {
ExpectException string
Rlp string
UncleHeaders []*btHeader
ExecutionWitness types.ExecutionWitness `json:"witness"`
ExecutionWitness *types.ExecutionWitness `json:"witness"`
}

//go:generate go run github.com/fjl/gencodec -type btHeader -field-override btHeaderMarshaling -out gen_btheader.go
Expand Down Expand Up @@ -333,6 +333,6 @@ func (bb *btBlock) decode() (*types.Block, error) {
if err := rlp.DecodeBytes(data, &b); err != nil {
return nil, err
}
b.SetExecutionWitness(&bb.ExecutionWitness)
b.SetExecutionWitness(bb.ExecutionWitness)
return &b, nil
}

0 comments on commit 4afce0a

Please sign in to comment.