-
Notifications
You must be signed in to change notification settings - Fork 524
Consensus upgrade for ExtraProgramPages fix #2694
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
Consensus upgrade for ExtraProgramPages fix #2694
Conversation
data/basics/overflow.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a typo in the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
ledger/apply/application_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not following why br.TotalExtraAppPages==expTotalExtraPages-1. isn't it set to expTotalExtraPages on line 1116?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expTotalExtraPages is a poor name, it should be initTotalExtraPages
ledger/apply/application.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we got below zero here, then we have a bug elsewhere. I'm not sure what the best course of action here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kind of agree but 1) it should not never happen :) 2) I guess being error tolerate here is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What, if anything, do we do during the same calculation on schemas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing,
totalSchema = totalSchema.SubSchema(globalSchema)
record.TotalAppSchema = totalSchema
would set it to zeros
Codecov Report
@@ Coverage Diff @@
## master #2694 +/- ##
==========================================
- Coverage 47.07% 47.06% -0.01%
==========================================
Files 349 349
Lines 55858 55878 +20
==========================================
+ Hits 26294 26301 +7
- Misses 26617 26624 +7
- Partials 2947 2953 +6
Continue to review full report at Codecov.
|
760def1 to
b598a3d
Compare
b598a3d to
10dbce6
Compare
tsachiherman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes is this PR, as far as I can tell, are flawless.
However, I found an issue in the previous EnableExtraPagesOnAppUpdate implementation:
- updateApplication:
The code testslen(ac.ApprovalProgram) + len(ac.ClearStateProgram)againstint(1+params.ExtraProgramPages) * proto.MaxAppProgramLen, which is incorrect.
It should test each of the programs againstint(1+params.ExtraProgramPages) * proto.MaxAppProgramLenand test the sum of their length againstMaxAppTotalProgramLen
I believe program size calculation has been combined for approval and clear state. MaxAppProgramLen is increased to 2048 in v28. |
Correct - the total size was updated to be 2048. But the check in the updateApplication should align with the check in the WellFormed for new apps. I believe that it's not an issue as long as the MaxAppProgramLen == MaxAppTotalProgramLen, but it could be an issue if they differ. |
* Make sure there is no overflow on TotalExtraAppPages calculation + test * proto.MaxAppTotalProgramLen is used in updateApplication
10dbce6 to
42e260b
Compare
90bef2b to
696c34e
Compare
|
Thank you, changed to |
| func (client RestClient) PendingTransactionInformationV2(transactionID string) (response generatedV2.PendingTransactionResponse, err error) { | ||
| transactionID = stripTransaction(transactionID) | ||
| err = client.get(&response, fmt.Sprintf("/v2/transactions/pending/%s", transactionID), nil) | ||
| return | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be implemented with versionAffinity, but it doesn't have to be implemented with that on this PR.
…ate (#604) Consensus upgrade for ExtraProgramPages: algorand/go-algorand#2694 Added EnableExtraPagesOnAppUpdate to v29 update.
…ate (#604) Consensus upgrade for ExtraProgramPages: algorand/go-algorand#2694 Added EnableExtraPagesOnAppUpdate to v29 update.
Make sure there is no overflow on TotalExtraAppPages calculation + test
Summary
Test Plan
One new test for overflow check on subtract