Skip to content

Commit 74a6ff9

Browse files
committed
EIP1559 (#31)
* change transaction options, gasPremium to maxMinerBribePerGas * update fields for eth api * Update cost calculation for transaction * Change gasPremium to maxMinerBribePerGas * update baseFee calculation * fix gasprice calculation for StateTransition * fix fields for RPCTransaction * fix CalcBaseFee * fix transaction fields for test * add additional func computeBaseFee * fix baseFee values for TestCalcBaseFee * Fix transaction cost calculation * add infomation about eip version * use camelCase-style for json tags * remove eip info from "version"-command * update VesionMeta Co-authored-by: Ilnur Galiev <[email protected]>
1 parent 5784a0e commit 74a6ff9

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

consensus/clique/clique.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
311311
return err
312312
}
313313
// All basic checks passed, verify cascading fields
314-
return c.verifyCascadingFields(chain, header, parents, parent)
314+
return c.verifyCascadingFields(chain, header, parents)
315315
}
316316

317317
// verifyCascadingFields verifies all the header fields that are not standalone,

eth/backend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ func New(stack *node.Node, config *Config) (*Ethereum, error) {
206206

207207
eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), eth, nil}
208208
gpoParams := config.GPO
209-
if gpoParams.DefaultGasPrice == nil {
210-
gpoParams.DefaultGasPrice = config.Miner.GasPrice
209+
if gpoParams.Default == nil {
210+
gpoParams.Default = config.Miner.GasPrice
211211
}
212212
if gpoParams.DefaultFeeCap == nil {
213213
gpoParams.DefaultFeeCap = config.Miner.GasPrice

eth/gasprice/gasprice.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ type Oracle struct {
7272
cacheLock sync.RWMutex
7373
fetchLock sync.Mutex
7474

75-
checkBlocks int
76-
percentile int
75+
checkBlocks, maxEmpty, maxBlocks int
76+
percentile int
7777
}
7878

7979
// NewOracle returns a new gasprice oracle which can recommend suitable
@@ -104,6 +104,8 @@ func NewOracle(backend OracleBackend, params Config) *Oracle {
104104
lastPremium: params.DefaultGasPremium,
105105
lastCap: params.DefaultFeeCap,
106106
maxPrice: maxPrice,
107+
maxEmpty: blocks / 2,
108+
maxBlocks: blocks * 5,
107109
checkBlocks: blocks,
108110
percentile: percent,
109111
}

les/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ func New(stack *node.Node, config *eth.Config) (*LightEthereum, error) {
161161

162162
leth.ApiBackend = &LesApiBackend{stack.Config().ExtRPCEnabled(), leth, nil}
163163
gpoParams := config.GPO
164-
if gpoParams.DefaultGasPrice == nil {
165-
gpoParams.DefaultGasPrice = config.Miner.GasPrice
164+
if gpoParams.Default == nil {
165+
gpoParams.Default = config.Miner.GasPrice
166166
}
167167
if gpoParams.DefaultFeeCap == nil {
168168
gpoParams.DefaultFeeCap = config.Miner.GasPrice

signer/core/gnosis_safe.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ func (tx *GnosisSafeTx) ToTypedData() TypedData {
7777
// ArgsForValidation returns a SendTxArgs struct, which can be used for the
7878
// common validations, e.g. look up 4byte destinations
7979
func (tx *GnosisSafeTx) ArgsForValidation() *SendTxArgs {
80+
gasPrice := hexutil.Big(tx.GasPrice)
8081
args := &SendTxArgs{
8182
From: tx.Safe,
8283
To: &tx.To,
8384
Gas: hexutil.Uint64(tx.SafeTxGas.Uint64()),
84-
GasPrice: hexutil.Big(tx.GasPrice),
85+
GasPrice: &gasPrice,
8586
Value: hexutil.Big(tx.Value),
8687
Nonce: hexutil.Uint64(tx.Nonce.Uint64()),
8788
Data: tx.Data,

0 commit comments

Comments
 (0)