Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

manual check for overflow #2

Closed
wants to merge 2 commits into from
Closed

Conversation

lukitsbrian
Copy link

No description provided.

@lukitsbrian lukitsbrian requested a review from rkollar March 6, 2024 17:26
// prevents overflow
if baseFee.BitLen() > 256 {
var maxInt math.Int
maxValue := new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Couldn't this computation be done only once and use that value here? Possibly make a copy to avoid changing it elsewhere.
  2. 256 should probably be math.MaxBitLen instead.

@rkollar
Copy link

rkollar commented Mar 6, 2024

The sagaos branch isn't used, it's probably some unfinished experiment with a newer cosmos-sdk. This needs to go against a branch based on 0.22.0 ethermint release.

Also there should be a task to also do it for the crypto.org fork, i.e. the 0.7 release and the main branch.

@lukitsbrian lukitsbrian changed the base branch from sagaos to main March 13, 2024 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants