-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
types: fix json field name for execution witness parent state root #522
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
workflow_dispatch: | ||
|
||
env: | ||
FIXTURES_TAG: "[email protected]4" | ||
FIXTURES_TAG: "[email protected]8" | ||
|
||
jobs: | ||
setup: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,18 +133,18 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD | |
return fmt.Errorf("invalid merkle root (remote: %x local: %x) dberr: %w", header.Root, root, statedb.Error()) | ||
} | ||
if blockEw := block.ExecutionWitness(); blockEw != nil { | ||
parent := v.bc.GetHeaderByNumber(header.Number.Uint64() - 1) | ||
parent := v.bc.GetBlockByHash(header.ParentHash) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't rely on canonical chain until the node is synced, so in general this is a safer option for all use cases (syncing, tests, block creation). |
||
if parent == nil { | ||
return fmt.Errorf("nil parent header for block %d", header.Number) | ||
} | ||
stateDiff, proof, err := beacon.BuildVerkleProof(header, statedb, parent.Root) | ||
stateDiff, proof, err := beacon.BuildVerkleProof(header, statedb, parent.Root()) | ||
if err != nil { | ||
return fmt.Errorf("error building verkle proof: %w", err) | ||
} | ||
ew := types.ExecutionWitness{ | ||
StateDiff: stateDiff, | ||
VerkleProof: proof, | ||
ParentStateRoot: parent.Root, | ||
ParentStateRoot: parent.Root(), | ||
} | ||
if err := ew.Equal(blockEw); err != nil { | ||
return fmt.Errorf("invalid execution witness: %v", err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ func (n *BlockNonce) UnmarshalText(input []byte) error { | |
type ExecutionWitness struct { | ||
StateDiff verkle.StateDiff `json:"stateDiff"` | ||
VerkleProof *verkle.VerkleProof `json:"verkleProof"` | ||
ParentStateRoot common.Hash `json:"parentRoot"` | ||
ParentStateRoot common.Hash `json:"parentStateRoot"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As required by CL. |
||
} | ||
|
||
func (ew *ExecutionWitness) Copy() *ExecutionWitness { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New fixtures since the parent state root JSON field was renamed.
I'll run whenever the release is cut.