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

feat: specify share version in MsgWirePayForBlob #1028

Merged
merged 9 commits into from
Nov 22, 2022

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Nov 17, 2022

Closes #936
Opens #1041

@rootulp rootulp self-assigned this Nov 17, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2022

Codecov Report

Merging #1028 (ce73010) into main (801a0d4) will increase coverage by 0.09%.
The diff coverage is 66.07%.

@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
+ Coverage   50.88%   50.97%   +0.09%     
==========================================
  Files          71       71              
  Lines        4398     4400       +2     
==========================================
+ Hits         2238     2243       +5     
+ Misses       1936     1932       -4     
- Partials      224      225       +1     
Impacted Files Coverage Δ
pkg/shares/utils.go 52.00% <0.00%> (+3.85%) ⬆️
x/blob/payforblob.go 0.00% <0.00%> (ø)
pkg/shares/share_splitting.go 63.80% <40.00%> (-2.21%) ⬇️
pkg/shares/split_sparse_shares.go 68.26% <73.33%> (-1.74%) ⬇️
app/estimate_square_size.go 81.69% <100.00%> (ø)
app/test_util.go 73.98% <100.00%> (+0.21%) ⬆️
pkg/shares/split_compact_shares.go 82.16% <100.00%> (ø)
testutil/testnode/node_interaction_api.go 63.15% <100.00%> (+0.32%) ⬆️
x/blob/types/payforblob.go 70.83% <100.00%> (+3.46%) ⬆️
x/blob/types/wirepayforblob.go 63.25% <100.00%> (-0.23%) ⬇️
... and 2 more

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

@rootulp rootulp marked this pull request as ready for review November 18, 2022 21:10
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.

thanks for adding this

[comment][no change]
tbh it feels weird that we're adding the option to add specify a share version, but we only support a single share version. I know we still have to add it, but it feels like a potential source of confusion in the future given that only a few people know what it is.

[comment][no change]
For example, I'm not yet convinced user facing functions, such as celestia-node or our cli, should expose it in their API yet. Perhaps only as an optional flag, but maybe not as a required arg

go.sum Show resolved Hide resolved
x/blob/types/payforblob.go Show resolved Hide resolved
testutil/blob/testutil.go Show resolved Hide resolved
@rootulp
Copy link
Collaborator Author

rootulp commented Nov 21, 2022

For example, I'm not yet convinced user facing functions, such as celestia-node or our cli, should expose it in their API yet.

FWIW I don't think it needs to be exposed when there only exists one supported share version but I do think it needs to be exposed at the time of introducing another share version format.

Perhaps only as an optional flag, but maybe not as a required arg

Agreed completely. #1041 intends on making it optional with a sane default (e.g. 0)

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.

lets fix the linter, and then we can merge this. apologies for the late re-review.

this will also change with the upcoming refactor of removing the wirePFB, as we'll have to add it somewhere else (either directly in the PFB, or the BlobTX)

@rootulp
Copy link
Collaborator Author

rootulp commented Nov 22, 2022

as we'll have to add it somewhere else (either directly in the PFB, or the BlobTX)

Agreed. This PR adds share_version to MsgPayForBlob too https://github.com/celestiaorg/celestia-app/pull/1028/files#diff-7ea270de437078b570a910b6909fa9e04b23a253369f18dd1d52faec967eda7aR50 so I expect the removal of MsgWirePayForBlob to not cause too many issues with this PR.

@rootulp
Copy link
Collaborator Author

rootulp commented Nov 22, 2022

apologies for the late re-review

Absolutely no worries, I think I just fixed all issues so this is ready for re-review

@rootulp rootulp changed the title feat: specify share version in MsgWirePayForBlob feat: specify share version in MsgWirePayForBlob Nov 22, 2022
@rootulp rootulp enabled auto-merge (squash) November 22, 2022 01:00
@rootulp
Copy link
Collaborator Author

rootulp commented Nov 22, 2022

Hold off on merging, while working on an unrelated change I discovered https://github.com/rootulp/celestia-app/blob/26d800681fa9b3ae90ae9b9ad6600dc5e0d5247d/pkg/shares/utils.go#L44-L64 which doesn't account for the newly added share version field

Update: resolved by ce73010

@evan-forbes evan-forbes added C: Celestia app consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules labels Nov 22, 2022
@evan-forbes evan-forbes added this to the Q4 2022 milestone Nov 22, 2022
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.

nice!!

@rootulp rootulp merged commit d32f687 into celestiaorg:main Nov 22, 2022
rootulp added a commit that referenced this pull request Nov 25, 2022
Follow up to #1028 where
I didn't propagate the new struct field `ShareVersion` to all instances
of `coretypes.Blob`.

Unfortunately Go isn't exhaustive on specifying struct fields so I
wasn't made aware of this miss until working on an unrelated change.
Open to ideas on how to have higher confidence all instances have been
addressed. [The non_exhaustive
attribute](https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute)
makes me think Rust structs are exhaustive by default.
cmwaters pushed a commit to celestiaorg/go-square that referenced this pull request Dec 14, 2023
Follow up to celestiaorg/celestia-app#1028 where
I didn't propagate the new struct field `ShareVersion` to all instances
of `coretypes.Blob`.

Unfortunately Go isn't exhaustive on specifying struct fields so I
wasn't made aware of this miss until working on an unrelated change.
Open to ideas on how to have higher confidence all instances have been
addressed. [The non_exhaustive
attribute](https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute)
makes me think Rust structs are exhaustive by default.
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this pull request Aug 1, 2024
Follow up to celestiaorg/celestia-app#1028 where
I didn't propagate the new struct field `ShareVersion` to all instances
of `coretypes.Blob`.

Unfortunately Go isn't exhaustive on specifying struct fields so I
wasn't made aware of this miss until working on an unrelated change.
Open to ideas on how to have higher confidence all instances have been
addressed. [The non_exhaustive
attribute](https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute)
makes me think Rust structs are exhaustive by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus breaking modifies block validity rules in a way that will break consensus unless all nodes update their rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify share version in MsgWirePayForBlob
3 participants