Skip to content

Commit

Permalink
core/types, internal/ethapi: fixes for prague RPC encoding (#30926)
Browse files Browse the repository at this point in the history
Fixing some issues I found while regenerating RPC tests for Prague:

- Authorization signature values were not encoded as hex
- `requestsRoot` in block should be `requestsHash`
- `authorizationList` should work for `eth_call`
  • Loading branch information
fjl authored Dec 17, 2024
1 parent 5b9a3ea commit 06dfb42
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ type Header struct {
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`

// RequestsHash was added by EIP-7685 and is ignored in legacy headers.
RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
}

// field type overrides for gencodec
Expand Down
16 changes: 8 additions & 8 deletions core/types/gen_authorization.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions core/types/gen_header_json.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/types/tx_setcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ type authorizationMarshaling struct {
ChainID hexutil.Uint64
Nonce hexutil.Uint64
V hexutil.Uint64
R hexutil.U256
S hexutil.U256
}

// SignAuth signs the provided authorization.
Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
result["parentBeaconBlockRoot"] = head.ParentBeaconRoot
}
if head.RequestsHash != nil {
result["requestsRoot"] = head.RequestsHash
result["requestsHash"] = head.RequestsHash
}
return result
}
Expand Down
1 change: 1 addition & 0 deletions internal/ethapi/transaction_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ func (args *TransactionArgs) ToMessage(baseFee *big.Int, skipNonceCheck, skipEoA
AccessList: accessList,
BlobGasFeeCap: (*big.Int)(args.BlobFeeCap),
BlobHashes: args.BlobHashes,
AuthList: args.AuthorizationList,
SkipNonceChecks: skipNonceCheck,
SkipFromEOACheck: skipEoACheck,
}
Expand Down

0 comments on commit 06dfb42

Please sign in to comment.