Skip to content

Commit

Permalink
consistently use uint64 for eip-1559 params
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Bayardo committed Oct 18, 2024
1 parent 933707a commit cf4ff64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions consensus/misc/eip1559/eip1559.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func DecodeHolocene1559Params(params types.BlockNonce) (uint64, uint64) {
return uint64(elasticity), uint64(denominator)
}

func EncodeHolocene1559Params(elasticity, denom uint32) types.BlockNonce {
func EncodeHolocene1559Params(elasticity, denom uint64) types.BlockNonce {
var nonce types.BlockNonce
binary.BigEndian.PutUint32(nonce[4:], elasticity)
binary.BigEndian.PutUint32(nonce[:4], denom)
binary.BigEndian.PutUint32(nonce[4:], uint32(elasticity))
binary.BigEndian.PutUint32(nonce[:4], uint32(denom))
return nonce
}

Expand Down
2 changes: 1 addition & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (miner *Miner) prepareWork(genParams *generateParams, witness bool) (*envir
if header.Nonce == types.BlockNonce([8]byte{}) {
elasticity := miner.chainConfig.ElasticityMultiplier()
denominator := miner.chainConfig.BaseFeeChangeDenominator(header.Time)
header.Nonce = eip1559.EncodeHolocene1559Params(uint32(elasticity), uint32(denominator))
header.Nonce = eip1559.EncodeHolocene1559Params(elasticity, denominator)
}
} else if genParams.eip1559Params != nil {
return nil, errors.New("got eip1559 params, expected none")
Expand Down

0 comments on commit cf4ff64

Please sign in to comment.