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

Update LimitDefault and LimitMax type from uint32 to uint64 #12307

Merged
merged 15 commits into from
Mar 6, 2024

Conversation

amit-momin
Copy link
Contributor

Updated LimitDefault and LimitMax config type from uint32 to uint64 to support higher fee limits for transactions. Geth accept uint64 Gas values for transactions so this aligns our types.

Copy link
Contributor

github-actions bot commented Mar 5, 2024

I see that you haven't updated any README files. Would it make sense to do so?

@amit-momin amit-momin marked this pull request as ready for review March 6, 2024 18:04
@amit-momin amit-momin requested review from a team as code owners March 6, 2024 18:04

if result > math.MaxUint32 {
if result.GreaterThan(decimal.NewFromBigInt(big.NewInt(0).SetUint64(math.MaxUint64), 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason that result > math.MaxUint64 doesnt work here?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i see the IntPart() was removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right and I can't compare to IntPart() since that returns int64

@@ -561,7 +561,7 @@ func (b *Txm[CHAIN_ID, HEAD, ADDR, TX_HASH, BLOCK_HASH, R, SEQ, FEE]) SendNative
ToAddress: to,
EncodedPayload: []byte{},
Value: value,
FeeLimit: gasLimit,
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to change the function signature to expect a uint64 instead of uint32 here?
My thoughts are that we might have some callers that use LimitDefault.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the only place using this method uses LimitTransfer for the gas limit which is uint32. I have an open question if I should be updating it's type or not. If the answer is yes, I'll be updating this for sure. If it's no, I can still update the signature and add the cast upstream.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do other repos use this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good question. Not sure actually. This also reminds me that CCIP has its own repo where LimitDefault would still be uint32.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need not worry how other repos use Core's code.
They likely merge latest Core into their own repo regularly, and take in all changes on their schedule.

@@ -188,9 +188,9 @@ func NewFromJobSpec(
gasLimit := fcfg.LimitDefault()
fmLimit := fcfg.LimitJobType().FM()
if jobSpec.GasLimit.Valid {
gasLimit = jobSpec.GasLimit.Uint32
gasLimit = uint64(jobSpec.GasLimit.Uint32)
Copy link
Contributor

Choose a reason for hiding this comment

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

would the jobSpec.GasLimit ever need to be uint64 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Potentially but I left as many types as I could in services as uint32 so it would be up to the product team if they'd like to up it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we are good, as this jobs pipeline code is deprecated, and we are trying to get rid of this

Copy link
Contributor

@poopoothegorilla poopoothegorilla left a comment

Choose a reason for hiding this comment

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

wow this is alot of work nice job Amit... I think the PR looks good. We shall see in the future what other values might make sense to have as uint64 instead of uint32, but i think this is a good start. Not sure how the other repos will need to coordinate these changes

@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue Mar 6, 2024
Merged via the queue into develop with commit 2869a7b Mar 6, 2024
97 checks passed
@prashantkumar1982 prashantkumar1982 deleted the fix/limit-default-type branch March 6, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants