forked from cerc-io/laconicd-deprecated
feat(ante, evm): set priority for eth transactions (#1214)
* Set priority for eth transactions Set the tx priority to the lowest priority in the messages. fix unit tests code cleanup and spec update spec fix go lint add priority integration test add python linter job add access list tx type fix gas limit remove ledger tag, so no need to replace hid dependency fix earlier check ibc-go v5.0.0-beta1 * fix pruned node integration test * Update x/feemarket/spec/09_antehandlers.md Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
co-authored by
Federico Kunze Küllmer
parent
53f160cbb0
commit
e1560849dd
@@ -232,6 +232,11 @@ func (tx AccessListTx) Cost() *big.Int {
|
||||
return cost(tx.Fee(), tx.GetValue())
|
||||
}
|
||||
|
||||
// EffectiveGasPrice is the same as GasPrice for AccessListTx
|
||||
func (tx AccessListTx) EffectiveGasPrice(baseFee *big.Int) *big.Int {
|
||||
return tx.GetGasPrice()
|
||||
}
|
||||
|
||||
// EffectiveFee is the same as Fee for AccessListTx
|
||||
func (tx AccessListTx) EffectiveFee(baseFee *big.Int) *big.Int {
|
||||
return tx.Fee()
|
||||
|
||||
@@ -265,14 +265,14 @@ func (tx DynamicFeeTx) Cost() *big.Int {
|
||||
return cost(tx.Fee(), tx.GetValue())
|
||||
}
|
||||
|
||||
// GetEffectiveGasPrice returns the effective gas price
|
||||
func (tx *DynamicFeeTx) GetEffectiveGasPrice(baseFee *big.Int) *big.Int {
|
||||
// EffectiveGasPrice returns the effective gas price
|
||||
func (tx *DynamicFeeTx) EffectiveGasPrice(baseFee *big.Int) *big.Int {
|
||||
return math.BigMin(new(big.Int).Add(tx.GasTipCap.BigInt(), baseFee), tx.GasFeeCap.BigInt())
|
||||
}
|
||||
|
||||
// EffectiveFee returns effective_gasprice * gaslimit.
|
||||
func (tx DynamicFeeTx) EffectiveFee(baseFee *big.Int) *big.Int {
|
||||
return fee(tx.GetEffectiveGasPrice(baseFee), tx.GasLimit)
|
||||
return fee(tx.EffectiveGasPrice(baseFee), tx.GasLimit)
|
||||
}
|
||||
|
||||
// EffectiveCost returns amount + effective_gasprice * gaslimit.
|
||||
|
||||
@@ -201,6 +201,11 @@ func (tx LegacyTx) Cost() *big.Int {
|
||||
return cost(tx.Fee(), tx.GetValue())
|
||||
}
|
||||
|
||||
// EffectiveGasPrice is the same as GasPrice for LegacyTx
|
||||
func (tx LegacyTx) EffectiveGasPrice(baseFee *big.Int) *big.Int {
|
||||
return tx.GetGasPrice()
|
||||
}
|
||||
|
||||
// EffectiveFee is the same as Fee for LegacyTx
|
||||
func (tx LegacyTx) EffectiveFee(baseFee *big.Int) *big.Int {
|
||||
return tx.Fee()
|
||||
|
||||
@@ -41,7 +41,8 @@ type TxData interface {
|
||||
Fee() *big.Int
|
||||
Cost() *big.Int
|
||||
|
||||
// effective fee according to current base fee
|
||||
// effective gasPrice/fee/cost according to current base fee
|
||||
EffectiveGasPrice(baseFee *big.Int) *big.Int
|
||||
EffectiveFee(baseFee *big.Int) *big.Int
|
||||
EffectiveCost(baseFee *big.Int) *big.Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user