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

Validate all relevant square sizes are committed to in MsgWirePayForData #666

Merged
merged 16 commits into from
Aug 31, 2022

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Aug 26, 2022

Closes #620 (after #654 merges)

@rootulp rootulp self-assigned this Aug 26, 2022
x/payment/types/payfordata_test.go Outdated Show resolved Hide resolved
x/payment/types/wirepayfordata.go Outdated Show resolved Hide resolved
x/payment/types/wirepayfordata.go Outdated Show resolved Hide resolved
@rootulp

This comment was marked as resolved.

@rootulp
Copy link
Collaborator Author

rootulp commented Aug 29, 2022

Sorry for prematurely moving this from draft to ready for review. Tests passed locally but CI is failing on TestIntegrationTestSuite which presumably doesn't run locally. Will fix and tag reviewers when this PR is ready.

UPDATE: ready for review. The integ test failure was a known flake: #574

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

left a few comments 🙂

this code is really important because it makes arranging the square way easier when the block proposer knows that all the txs in their mempool are signed over all the relevant square sizes.

app/test/prepare_proposal_test.go Outdated Show resolved Hide resolved
x/payment/types/payfordata_test.go Outdated Show resolved Hide resolved
x/payment/types/wirepayfordata.go Show resolved Hide resolved
x/payment/types/wirepayfordata.go Show resolved Hide resolved
x/payment/types/wirepayfordata.go Outdated Show resolved Hide resolved
x/payment/types/wirepayfordata.go Outdated Show resolved Hide resolved
@rootulp rootulp mentioned this pull request Aug 31, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #666 (e6c18ca) into main (13076a6) will increase coverage by 0.47%.
The diff coverage is 73.52%.

@@            Coverage Diff             @@
##             main     #666      +/-   ##
==========================================
+ Coverage   36.06%   36.54%   +0.47%     
==========================================
  Files          24       24              
  Lines        2623     2657      +34     
==========================================
+ Hits          946      971      +25     
- Misses       1594     1600       +6     
- Partials       83       86       +3     
Impacted Files Coverage Δ
pkg/shares/parse_message_shares.go 88.60% <ø> (ø)
x/payment/types/wirepayfordata.go 66.35% <73.52%> (+1.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@evan-forbes evan-forbes added apphash breaking consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules labels Aug 31, 2022
@evan-forbes
Copy link
Member

just to note that this is consensus breaking

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

approving due to #677

@rootulp rootulp merged commit a661ecc into celestiaorg:main Aug 31, 2022
@rootulp rootulp deleted the rp/check-sign-over-all-squares branch August 31, 2022 16:26
@evan-forbes
Copy link
Member

evan-forbes commented Sep 1, 2022

I'm dumb, this is probably not consensus breaking. It will be nice when we have tests tho

@evan-forbes evan-forbes removed apphash breaking consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules labels Sep 1, 2022
@rootulp
Copy link
Collaborator Author

rootulp commented Sep 1, 2022

I think this is consensus breaking b/c prior to this change, validators would've accepted PFDs that didn't sign over all commits. After this change, those PFDs are considered invalid.

Consensus tests would be very nice. +1 to #313

@evan-forbes
Copy link
Member

After this change, those PFDs are considered invalid

We didn't actually change anything for the ValidateBasic method of PFD, only the wire message, correct?

@rootulp
Copy link
Collaborator Author

rootulp commented Sep 1, 2022

Correct only the wire message, sorry for the lack of precision. Why does that have implications on consensus breaking vs non consensus breaking?

@evan-forbes
Copy link
Member

Then that should only affect the mempool, as even if a WireMsg makes it in the block, then all nodes should treat that the same, which is to subtract the minimum amount of gas.

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.

Require MsgWirePayForData and MsgPayForData txs to sign over all relevant square sizes to be considered valid
3 participants