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: data commitment for height support for yet to be committed heights #1389

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Feb 16, 2023

Overview

Closes #1388

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

@rach-id rach-id added the x/qgb label Feb 16, 2023
@rach-id rach-id self-assigned this Feb 16, 2023
@MSevey MSevey requested a review from a team February 16, 2023 12:45
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.

👍

return types.DataCommitment{}, err
}
if !found {
return types.DataCommitment{}, fmt.Errorf("couldn't find attestation with nonce %d", latestNonce-i)
Copy link
Member

Choose a reason for hiding this comment

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

[non-blocking]
do we have an specific error type for this? it feels general enough to warrant one

Copy link
Member Author

Choose a reason for hiding this comment

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

This we're creating errors on the fly throughout the whole package, I created an issue to handle the all #1390

x/qgb/keeper/keeper_data_commitment.go Outdated Show resolved Hide resolved
Co-authored-by: Evan Forbes <42654277+evan-forbes@users.noreply.github.com>
@MSevey MSevey requested a review from a team February 16, 2023 13:30
evan-forbes
evan-forbes previously approved these changes Feb 16, 2023
@rach-id rach-id merged commit b40a690 into celestiaorg:main Feb 16, 2023
@rach-id rach-id deleted the better_data_commitment_for_height branch February 16, 2023 15:00
// GetLastDataCommitment returns the last data commitment.
func (k Keeper) GetLastDataCommitment(ctx sdk.Context) (types.DataCommitment, error) {
latestNonce := k.GetLatestAttestationNonce(ctx)
for i := uint64(0); i < latestNonce; i++ {
Copy link
Collaborator

Choose a reason for hiding this comment

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

[no change needed] sorry for delayed review but this iteration may read easier with

	for i := latestNonce; i >= 0; i-- {

because the contents of this for loop care about iterating from the latest nonce down to 0. This proposal removes the need for subtraction in the body of the for loop

rootulp added a commit that referenced this pull request Feb 16, 2023
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.

QGB verify command better logging
3 participants