2021-04-16 22:29:22 +03:00
|
|
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
|
2023-02-06 18:37:58 +03:00
|
|
|
package engine
|
2021-04-16 22:29:22 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
"math/big"
|
2021-04-16 22:29:22 +03:00
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
2023-01-25 17:32:25 +03:00
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
2021-04-16 22:29:22 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ = (*executableDataMarshaling)(nil)
|
|
|
|
|
|
|
|
// MarshalJSON marshals as JSON.
|
2023-01-25 17:32:25 +03:00
|
|
|
func (e ExecutableData) MarshalJSON() ([]byte, error) {
|
|
|
|
type ExecutableData struct {
|
2024-08-29 15:50:27 +03:00
|
|
|
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
|
|
|
|
FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"`
|
|
|
|
StateRoot common.Hash `json:"stateRoot" gencodec:"required"`
|
|
|
|
ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"`
|
|
|
|
LogsBloom hexutil.Bytes `json:"logsBloom" gencodec:"required"`
|
|
|
|
Random common.Hash `json:"prevRandao" gencodec:"required"`
|
|
|
|
Number hexutil.Uint64 `json:"blockNumber" gencodec:"required"`
|
|
|
|
GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
|
|
|
|
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
|
|
|
|
Timestamp hexutil.Uint64 `json:"timestamp" gencodec:"required"`
|
|
|
|
ExtraData hexutil.Bytes `json:"extraData" gencodec:"required"`
|
|
|
|
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"`
|
|
|
|
BlockHash common.Hash `json:"blockHash" gencodec:"required"`
|
|
|
|
Transactions []hexutil.Bytes `json:"transactions" gencodec:"required"`
|
|
|
|
Withdrawals []*types.Withdrawal `json:"withdrawals"`
|
|
|
|
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
|
|
|
|
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
|
|
|
|
ExecutionWitness *types.ExecutionWitness `json:"executionWitness,omitempty"`
|
2023-01-25 17:32:25 +03:00
|
|
|
}
|
|
|
|
var enc ExecutableData
|
2021-04-16 22:29:22 +03:00
|
|
|
enc.ParentHash = e.ParentHash
|
2021-12-17 17:38:58 +03:00
|
|
|
enc.FeeRecipient = e.FeeRecipient
|
2021-04-16 22:29:22 +03:00
|
|
|
enc.StateRoot = e.StateRoot
|
2021-12-17 17:38:58 +03:00
|
|
|
enc.ReceiptsRoot = e.ReceiptsRoot
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
enc.LogsBloom = e.LogsBloom
|
|
|
|
enc.Random = e.Random
|
2021-04-16 22:29:22 +03:00
|
|
|
enc.Number = hexutil.Uint64(e.Number)
|
|
|
|
enc.GasLimit = hexutil.Uint64(e.GasLimit)
|
|
|
|
enc.GasUsed = hexutil.Uint64(e.GasUsed)
|
|
|
|
enc.Timestamp = hexutil.Uint64(e.Timestamp)
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
enc.ExtraData = e.ExtraData
|
|
|
|
enc.BaseFeePerGas = (*hexutil.Big)(e.BaseFeePerGas)
|
2021-12-03 18:26:28 +03:00
|
|
|
enc.BlockHash = e.BlockHash
|
2021-04-16 22:29:22 +03:00
|
|
|
if e.Transactions != nil {
|
|
|
|
enc.Transactions = make([]hexutil.Bytes, len(e.Transactions))
|
|
|
|
for k, v := range e.Transactions {
|
|
|
|
enc.Transactions[k] = v
|
|
|
|
}
|
|
|
|
}
|
2023-01-25 17:32:25 +03:00
|
|
|
enc.Withdrawals = e.Withdrawals
|
2023-07-27 16:53:28 +03:00
|
|
|
enc.BlobGasUsed = (*hexutil.Uint64)(e.BlobGasUsed)
|
|
|
|
enc.ExcessBlobGas = (*hexutil.Uint64)(e.ExcessBlobGas)
|
2024-08-29 15:50:27 +03:00
|
|
|
enc.ExecutionWitness = e.ExecutionWitness
|
2021-04-16 22:29:22 +03:00
|
|
|
return json.Marshal(&enc)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON unmarshals from JSON.
|
2023-01-25 17:32:25 +03:00
|
|
|
func (e *ExecutableData) UnmarshalJSON(input []byte) error {
|
|
|
|
type ExecutableData struct {
|
2024-08-29 15:50:27 +03:00
|
|
|
ParentHash *common.Hash `json:"parentHash" gencodec:"required"`
|
|
|
|
FeeRecipient *common.Address `json:"feeRecipient" gencodec:"required"`
|
|
|
|
StateRoot *common.Hash `json:"stateRoot" gencodec:"required"`
|
|
|
|
ReceiptsRoot *common.Hash `json:"receiptsRoot" gencodec:"required"`
|
|
|
|
LogsBloom *hexutil.Bytes `json:"logsBloom" gencodec:"required"`
|
|
|
|
Random *common.Hash `json:"prevRandao" gencodec:"required"`
|
|
|
|
Number *hexutil.Uint64 `json:"blockNumber" gencodec:"required"`
|
|
|
|
GasLimit *hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
|
|
|
|
GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
|
|
|
|
Timestamp *hexutil.Uint64 `json:"timestamp" gencodec:"required"`
|
|
|
|
ExtraData *hexutil.Bytes `json:"extraData" gencodec:"required"`
|
|
|
|
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"`
|
|
|
|
BlockHash *common.Hash `json:"blockHash" gencodec:"required"`
|
|
|
|
Transactions []hexutil.Bytes `json:"transactions" gencodec:"required"`
|
|
|
|
Withdrawals []*types.Withdrawal `json:"withdrawals"`
|
|
|
|
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
|
|
|
|
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
|
|
|
|
ExecutionWitness *types.ExecutionWitness `json:"executionWitness,omitempty"`
|
2023-01-25 17:32:25 +03:00
|
|
|
}
|
|
|
|
var dec ExecutableData
|
2021-04-16 22:29:22 +03:00
|
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if dec.ParentHash == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'parentHash' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.ParentHash = *dec.ParentHash
|
2021-12-17 17:38:58 +03:00
|
|
|
if dec.FeeRecipient == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'feeRecipient' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
2021-12-17 17:38:58 +03:00
|
|
|
e.FeeRecipient = *dec.FeeRecipient
|
2021-04-16 22:29:22 +03:00
|
|
|
if dec.StateRoot == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'stateRoot' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.StateRoot = *dec.StateRoot
|
2021-12-17 17:38:58 +03:00
|
|
|
if dec.ReceiptsRoot == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'receiptsRoot' for ExecutableData")
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
}
|
2021-12-17 17:38:58 +03:00
|
|
|
e.ReceiptsRoot = *dec.ReceiptsRoot
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
if dec.LogsBloom == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'logsBloom' for ExecutableData")
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
}
|
|
|
|
e.LogsBloom = *dec.LogsBloom
|
|
|
|
if dec.Random == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'prevRandao' for ExecutableData")
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
}
|
|
|
|
e.Random = *dec.Random
|
2021-04-16 22:29:22 +03:00
|
|
|
if dec.Number == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'blockNumber' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.Number = uint64(*dec.Number)
|
|
|
|
if dec.GasLimit == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'gasLimit' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.GasLimit = uint64(*dec.GasLimit)
|
|
|
|
if dec.GasUsed == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'gasUsed' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.GasUsed = uint64(*dec.GasUsed)
|
|
|
|
if dec.Timestamp == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'timestamp' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.Timestamp = uint64(*dec.Timestamp)
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
if dec.ExtraData == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'extraData' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
e.ExtraData = *dec.ExtraData
|
|
|
|
if dec.BaseFeePerGas == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'baseFeePerGas' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
all: core rework for the merge transition (#23761)
* all: work for eth1/2 transtition
* consensus/beacon, eth: change beacon difficulty to 0
* eth: updates
* all: add terminalBlockDifficulty config, fix rebasing issues
* eth: implemented merge interop spec
* internal/ethapi: update to v1.0.0.alpha.2
This commit updates the code to the new spec, moving payloadId into
it's own object. It also fixes an issue with finalizing an empty blockhash.
It also properly sets the basefee
* all: sync polishes, other fixes + refactors
* core, eth: correct semantics for LeavePoW, EnterPoS
* core: fixed rebasing artifacts
* core: light: performance improvements
* core: use keyed field (f)
* core: eth: fix compilation issues + tests
* eth/catalyst: dbetter error codes
* all: move Merger to consensus/, remove reliance on it in bc
* all: renamed EnterPoS and LeavePoW to ReachTDD and FinalizePoS
* core: make mergelogs a function
* core: use InsertChain instead of InsertBlock
* les: drop merger from lightchain object
* consensus: add merger
* core: recoverAncestors in catalyst mode
* core: fix nitpick
* all: removed merger from beacon, use TTD, nitpicks
* consensus: eth: add docstring, removed unnecessary code duplication
* consensus/beacon: better comment
* all: easy to fix nitpicks by karalabe
* consensus/beacon: verify known headers to be sure
* core: comments
* core: eth: don't drop peers who advertise blocks, nitpicks
* core: never add beacon blocks to the future queue
* core: fixed nitpicks
* consensus/beacon: simplify IsTTDReached check
* consensus/beacon: correct IsTTDReached check
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2021-11-26 14:23:02 +03:00
|
|
|
e.BaseFeePerGas = (*big.Int)(dec.BaseFeePerGas)
|
2021-12-03 18:26:28 +03:00
|
|
|
if dec.BlockHash == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'blockHash' for ExecutableData")
|
2021-12-03 18:26:28 +03:00
|
|
|
}
|
|
|
|
e.BlockHash = *dec.BlockHash
|
2021-04-16 22:29:22 +03:00
|
|
|
if dec.Transactions == nil {
|
2023-01-25 17:32:25 +03:00
|
|
|
return errors.New("missing required field 'transactions' for ExecutableData")
|
2021-04-16 22:29:22 +03:00
|
|
|
}
|
|
|
|
e.Transactions = make([][]byte, len(dec.Transactions))
|
|
|
|
for k, v := range dec.Transactions {
|
|
|
|
e.Transactions[k] = v
|
|
|
|
}
|
2023-01-25 17:32:25 +03:00
|
|
|
if dec.Withdrawals != nil {
|
|
|
|
e.Withdrawals = dec.Withdrawals
|
|
|
|
}
|
2023-07-27 16:53:28 +03:00
|
|
|
if dec.BlobGasUsed != nil {
|
|
|
|
e.BlobGasUsed = (*uint64)(dec.BlobGasUsed)
|
2023-07-18 10:44:16 +03:00
|
|
|
}
|
2023-07-27 16:53:28 +03:00
|
|
|
if dec.ExcessBlobGas != nil {
|
|
|
|
e.ExcessBlobGas = (*uint64)(dec.ExcessBlobGas)
|
2023-07-18 10:44:16 +03:00
|
|
|
}
|
2024-08-29 15:50:27 +03:00
|
|
|
if dec.ExecutionWitness != nil {
|
|
|
|
e.ExecutionWitness = dec.ExecutionWitness
|
|
|
|
}
|
2021-04-16 22:29:22 +03:00
|
|
|
return nil
|
|
|
|
}
|