Skip to content

Commit

Permalink
nits, update comments (#617)
Browse files Browse the repository at this point in the history
* nits, update comments

* pr comment
  • Loading branch information
darioush authored Aug 2, 2024
1 parent ca29dfd commit 4a6a8c6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
14 changes: 7 additions & 7 deletions params/avalanche_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ import (
const (
// MinGasPrice is the number of nAVAX required per gas unit for a
// transaction to be valid, measured in wei
LaunchMinGasPrice int64 = 470_000_000_000
ApricotPhase1MinGasPrice int64 = 225_000_000_000
LaunchMinGasPrice int64 = 470 * GWei
ApricotPhase1MinGasPrice int64 = 225 * GWei

AvalancheAtomicTxFee = units.MilliAvax

ApricotPhase1GasLimit uint64 = 8_000_000
CortinaGasLimit uint64 = 15_000_000

ApricotPhase3MinBaseFee int64 = 75_000_000_000
ApricotPhase3MaxBaseFee int64 = 225_000_000_000
ApricotPhase3InitialBaseFee int64 = 225_000_000_000
ApricotPhase3MinBaseFee int64 = 75 * GWei
ApricotPhase3MaxBaseFee int64 = 225 * GWei
ApricotPhase3InitialBaseFee int64 = 225 * GWei
ApricotPhase3TargetGas uint64 = 10_000_000
ApricotPhase4MinBaseFee int64 = 25_000_000_000
ApricotPhase4MaxBaseFee int64 = 1_000_000_000_000
ApricotPhase4MinBaseFee int64 = 25 * GWei
ApricotPhase4MaxBaseFee int64 = 1_000 * GWei
ApricotPhase4BaseFeeChangeDenominator uint64 = 12
ApricotPhase5TargetGas uint64 = 15_000_000
ApricotPhase5BaseFeeChangeDenominator uint64 = 36
Expand Down
6 changes: 4 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,10 @@ type ChainConfig struct {
// and Avalanche Warp Messaging. (nil = no fork, 0 = already activated)
// Note: EIP-4895 is excluded since withdrawals are not relevant to the Avalanche C-Chain or Subnets running the EVM.
DurangoBlockTimestamp *uint64 `json:"durangoBlockTimestamp,omitempty"`
// EUpgrade on the Avalanche network. (nil = no fork, 0 = already activated)
// It activates Cancun and reduces the min base fee.
// EUpgrade activates Cancun from Ethereum (https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md#included-eips)
// and reduces the min base fee. (nil = no fork, 0 = already activated)
// Note: EIP-4844 BlobTxs are not enabled in the mempool and blocks are not
// allowed to contain them. For details see https://github.com/avalanche-foundation/ACPs/pull/131
EUpgradeTime *uint64 `json:"eUpgradeTime,omitempty"`

// Cancun activates the Cancun upgrade from Ethereum. (nil = no fork, 0 = already activated)
Expand Down
9 changes: 7 additions & 2 deletions params/config_extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,13 @@ func getUpgradeTime(networkID uint32, upgradeTimes map[uint32]time.Time) *uint64
return utils.NewUint64(0)
}

// SetEVMUpgrades sets the mapped upgrades (Avalanche > EVM upgrades) for the chain config.
func (c *ChainConfig) SetEVMUpgrades() {
// SetEthUpgrades enables Etheruem network upgrades using the same time as
// the Avalanche network upgrade that enables them.
//
// TODO: Prior to Cancun, Avalanche upgrades are referenced inline in the
// code in place of their Ethereum counterparts. The original Ethereum names
// should be restored for maintainability.
func (c *ChainConfig) SetEthUpgrades() {
if c.EUpgradeTime != nil {
c.CancunTime = utils.NewUint64(*c.EUpgradeTime)
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func (vm *VM) Initialize(

vm.chainID = g.Config.ChainID

g.Config.SetEVMUpgrades()
g.Config.SetEthUpgrades()

vm.ethConfig = ethconfig.NewDefaultConfig()
vm.ethConfig.Genesis = g
Expand Down
2 changes: 1 addition & 1 deletion plugin/evm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4113,7 +4113,7 @@ func TestNoBlobsAllowed(t *testing.T) {
Gas: params.TxGas,
To: testEthAddrs[0],
BlobFeeCap: uint256.NewInt(1),
BlobHashes: []common.Hash{{1}},
BlobHashes: []common.Hash{{1}}, // This blob is expected to cause verification to fail
Value: new(uint256.Int),
}), signer, testKeys[0].ToECDSA())
require.NoError(err)
Expand Down

0 comments on commit 4a6a8c6

Please sign in to comment.