[IBC] Add nil check on proof for membership and non-membership proof creation#877
Merged
Olshansk merged 1 commit intopokt-network:mainfrom Jul 5, 2023
Merged
Conversation
…hipProof functions
Olshansk
approved these changes
Jul 5, 2023
Collaborator
Olshansk
left a comment
There was a problem hiding this comment.
@innocent-saeed36 Could you please provide the exact ChatGPT prompt you used for this?
@h5law This looks good to me but want a 👍 from you as well
h5law
approved these changes
Jul 5, 2023
Contributor
h5law
left a comment
There was a problem hiding this comment.
Currently the SMT will only return nil for the proof when the err is non-nil. However, if this logic ever changes its good to have this extra check.
LGTM let's merge it in!
bryanchriswhite
added a commit
that referenced
this pull request
Jul 7, 2023
* pokt/main: [Utility] Update E2E feature path template doc (#870) [IBC] Add nil check on proof for membership and non-membership proof creation (#877) Added git diff state to devlog10 Devlog 10 (#872) [Documentation] Add IBC Module introduction as an example (#853) [Persistence][Bug] Fix Actor Schema Assignment for ValidatorActor in GetActor (#857) QOL: add bash completion for p1 to localnet client (#865)
bryanchriswhite
added a commit
that referenced
this pull request
Jul 7, 2023
* feat/integrate-bg-router: fix: goimports fix: unstaked actor bootstrapping FSM transition chore: add error log test: improve background router validation test docs: fix mistake in peer discovery section [Utility] Update E2E feature path template doc (#870) [IBC] Add nil check on proof for membership and non-membership proof creation (#877) Added git diff state to devlog10 Devlog 10 (#872) [Documentation] Add IBC Module introduction as an example (#853) [Persistence][Bug] Fix Actor Schema Assignment for ValidatorActor in GetActor (#857) QOL: add bash completion for p1 to localnet client (#865)
bryanchriswhite
added a commit
that referenced
this pull request
Jul 11, 2023
* pokt/main: [P2P] Integrate background router (#732) Update main README.md [Bug] Fix CI linter errors (#885) [Tooling] Block `IN_THIS_*` comments from passing CI (#889) [Utility] Update E2E feature path template doc (#870) [IBC] Add nil check on proof for membership and non-membership proof creation (#877) Added git diff state to devlog10 Devlog 10 (#872)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
In
proofs_ics23.go, thecreateMembershipProofandcreateNonMembershipProoffunctions calltree.Prove(key)and then pass theproofto theconvertSMPToExistenceProoforconvertSMPToExclusionProoffunctions without checking ifproofisnil. This could lead to a panic due to a nil pointer dereference iftree.Prove(key)returns anilproof.Solution:
This PR adds a check to verify if
proofisnilbefore passing it to theconvertSMPToExistenceProoforconvertSMPToExclusionProoffunctions. Ifproofisnil, an error is returned.Changes:
Added nil check on
proofincreateMembershipProofandcreateNonMembershipProoffunctions inproofs_ics23.go.