core, eth, internal, les: RPC methods and fields for EIP 1559 (#22964)
* internal/ethapi: add baseFee to RPCMarshalHeader * internal/ethapi: add FeeCap, Tip and correct GasPrice to EIP-1559 RPCTransaction results * core,eth,les,internal: add support for tip estimation in gas price oracle * internal/ethapi,eth/gasprice: don't suggest tip larger than fee cap * core/types,internal: use correct eip1559 terminology for json marshalling * eth, internal/ethapi: fix rebase problems * internal/ethapi: fix rpc name of basefee * internal/ethapi: address review concerns * core, eth, internal, les: simplify gasprice oracle (#25) * core, eth, internal, les: simplify gasprice oracle * eth/gasprice: fix typo * internal/ethapi: minor tweak in tx args * internal/ethapi: calculate basefee for pending block * internal/ethapi: fix panic * internal/ethapi, eth/tracers: simplify txargs ToMessage * internal/ethapi: remove unused param * core, eth, internal: fix regressions wrt effective gas price in the evm * eth/gasprice: drop weird debug println * internal/jsre/deps: hack in 1559 gas conversions into embedded web3 * internal/jsre/deps: hack basFee to decimal conversion * internal/ethapi: init feecap and tipcap for legacy txs too * eth, graphql, internal, les: fix gas price suggestion on all combos * internal/jsre/deps: handle decimal tipcap and feecap * eth, internal: minor review fixes * graphql, internal: export max fee cap RPC endpoint * internal/ethapi: fix crash in transaction_args * internal/ethapi: minor refactor to make the code safer Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com> Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com> Co-authored-by: gary rong <garyrong0905@gmail.com> Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
committed by
GitHub
parent
2dee31930c
commit
5cff9754d7
@ -252,7 +252,6 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
|
||||
} else {
|
||||
time = parent.Time() + 10 // block time is fixed at 10 seconds
|
||||
}
|
||||
|
||||
header := &types.Header{
|
||||
Root: state.IntermediateRoot(chain.Config().IsEIP158(parent.Number())),
|
||||
ParentHash: parent.Hash(),
|
||||
@ -267,11 +266,14 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.S
|
||||
Number: new(big.Int).Add(parent.Number(), common.Big1),
|
||||
Time: time,
|
||||
}
|
||||
|
||||
if chain.Config().IsLondon(parent.Number()) {
|
||||
if chain.Config().IsLondon(header.Number) {
|
||||
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header())
|
||||
parentGasLimit := parent.GasLimit()
|
||||
if !chain.Config().IsLondon(parent.Number()) {
|
||||
parentGasLimit = parent.GasLimit() * params.ElasticityMultiplier
|
||||
}
|
||||
header.GasLimit = CalcGasLimit1559(parentGasLimit, parentGasLimit)
|
||||
}
|
||||
|
||||
return header
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user