Skip to content

Commit

Permalink
EIP1559 (#31)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
n0cte committed Dec 11, 2020
1 parent 5784a0e commit 74a6ff9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
return err
}
// All basic checks passed, verify cascading fields
return c.verifyCascadingFields(chain, header, parents, parent)
return c.verifyCascadingFields(chain, header, parents)
}

// verifyCascadingFields verifies all the header fields that are not standalone,
Expand Down
4 changes: 2 additions & 2 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ func New(stack *node.Node, config *Config) (*Ethereum, error) {

eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), eth, nil}
gpoParams := config.GPO
if gpoParams.DefaultGasPrice == nil {
gpoParams.DefaultGasPrice = config.Miner.GasPrice
if gpoParams.Default == nil {
gpoParams.Default = config.Miner.GasPrice
}
if gpoParams.DefaultFeeCap == nil {
gpoParams.DefaultFeeCap = config.Miner.GasPrice
Expand Down
6 changes: 4 additions & 2 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ type Oracle struct {
cacheLock sync.RWMutex
fetchLock sync.Mutex

checkBlocks int
percentile int
checkBlocks, maxEmpty, maxBlocks int
percentile int
}

// NewOracle returns a new gasprice oracle which can recommend suitable
Expand Down Expand Up @@ -104,6 +104,8 @@ func NewOracle(backend OracleBackend, params Config) *Oracle {
lastPremium: params.DefaultGasPremium,
lastCap: params.DefaultFeeCap,
maxPrice: maxPrice,
maxEmpty: blocks / 2,
maxBlocks: blocks * 5,
checkBlocks: blocks,
percentile: percent,
}
Expand Down
4 changes: 2 additions & 2 deletions les/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ func New(stack *node.Node, config *eth.Config) (*LightEthereum, error) {

leth.ApiBackend = &LesApiBackend{stack.Config().ExtRPCEnabled(), leth, nil}
gpoParams := config.GPO
if gpoParams.DefaultGasPrice == nil {
gpoParams.DefaultGasPrice = config.Miner.GasPrice
if gpoParams.Default == nil {
gpoParams.Default = config.Miner.GasPrice
}
if gpoParams.DefaultFeeCap == nil {
gpoParams.DefaultFeeCap = config.Miner.GasPrice
Expand Down
3 changes: 2 additions & 1 deletion signer/core/gnosis_safe.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ func (tx *GnosisSafeTx) ToTypedData() TypedData {
// ArgsForValidation returns a SendTxArgs struct, which can be used for the
// common validations, e.g. look up 4byte destinations
func (tx *GnosisSafeTx) ArgsForValidation() *SendTxArgs {
gasPrice := hexutil.Big(tx.GasPrice)
args := &SendTxArgs{
From: tx.Safe,
To: &tx.To,
Gas: hexutil.Uint64(tx.SafeTxGas.Uint64()),
GasPrice: hexutil.Big(tx.GasPrice),
GasPrice: &gasPrice,
Value: hexutil.Big(tx.Value),
Nonce: hexutil.Uint64(tx.Nonce.Uint64()),
Data: tx.Data,
Expand Down

0 comments on commit 74a6ff9

Please sign in to comment.