Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common: Execute on Breaking Release Notes #1685

Closed
wants to merge 13 commits into from
182 changes: 158 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions packages/block/src/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class BlockHeader {

if (this._common.isActivatedEIP(1559)) {
if (baseFeePerGas === undefined) {
const londonHfBlock = this._common.hardforkBlockBN(Hardfork.London)
const londonHfBlock = this._common.hardforkBlock(Hardfork.London)
const isInitialEIP1559Block = londonHfBlock && number.eq(londonHfBlock)
if (isInitialEIP1559Block) {
baseFeePerGas = new BN(this._common.param('gasConfig', 'initialBaseFee'))
Expand Down Expand Up @@ -384,7 +384,7 @@ export class BlockHeader {

if (nonce.length !== 8) {
// Hack to check for Kovan due to non-standard nonce length (65 bytes)
if (this._common.networkIdBN().eqn(42)) {
if (this._common.networkId().eqn(42)) {
if (nonce.length !== 65) {
const msg = this._errorMsg(
`nonce must be 65 bytes on kovan, received ${nonce.length} bytes`
Expand Down Expand Up @@ -566,7 +566,7 @@ export class BlockHeader {
let parentGasLimit = parentBlockHeader.gasLimit
// EIP-1559: assume double the parent gas limit on fork block
// to adopt to the new gas target centered logic
const londonHardforkBlock = this._common.hardforkBlockBN(Hardfork.London)
const londonHardforkBlock = this._common.hardforkBlock(Hardfork.London)
if (londonHardforkBlock && this.number.eq(londonHardforkBlock)) {
const elasticity = new BN(this._common.param('gasConfig', 'elasticityMultiplier'))
parentGasLimit = parentGasLimit.mul(elasticity)
Expand Down Expand Up @@ -716,7 +716,7 @@ export class BlockHeader {
const msg = this._errorMsg('EIP1559 block has no base fee field')
throw new Error(msg)
}
const londonHfBlock = this._common.hardforkBlockBN(Hardfork.London)
const londonHfBlock = this._common.hardforkBlock(Hardfork.London)
const isInitialEIP1559Block = londonHfBlock && this.number.eq(londonHfBlock)
if (isInitialEIP1559Block) {
const initialBaseFee = new BN(this._common.param('gasConfig', 'initialBaseFee'))
Expand Down Expand Up @@ -1012,7 +1012,7 @@ export class BlockHeader {
if (!this._common.hardforkIsActiveOnChain(Hardfork.Dao)) {
return
}
const DAOActivationBlock = this._common.hardforkBlockBN(Hardfork.Dao)
const DAOActivationBlock = this._common.hardforkBlock(Hardfork.Dao)
if (!DAOActivationBlock || DAOActivationBlock.isZero() || this.number.lt(DAOActivationBlock)) {
return
}
Expand Down
Loading