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

refactor: trim and document assumptions for GetQuorum, Get*MN* and friends #6132

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

kwvg
Copy link
Collaborator

@kwvg kwvg commented Jul 19, 2024

Additional Information

This pull request aims to document assumptions when handling CDeterministicMNCPtr and CQuorumCPtr entities, which can be nullptr. In some instances, mishandling or missing validation logic can result in an assertion failure or a null pointer dereference (in both circumstances, the client will crash).

While in other cases, assumptions are made based on prior code that affirms that the returned value will be valid. For the former, bail-out logic has been introduced and for the latter, assertions and code comments have been added.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests (note: N/A)
  • I have made corresponding changes to the documentation (note: N/A)
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@kwvg kwvg added this to the 21.1 milestone Jul 19, 2024
@kwvg kwvg requested a review from UdjinM6 July 19, 2024 17:22
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

Generally seems good to me; please apply clang-format :)

@kwvg kwvg force-pushed the rvwasmp branch 2 times, most recently from 9fa05b8 to d382c05 Compare July 26, 2024 10:10
@UdjinM6 UdjinM6 modified the milestones: 21.1, 21.2 Aug 8, 2024
@PastaPastaPasta
Copy link
Member

Any reason why this has stalled? maybe revive this?

Copy link

This pull request has conflicts, please rebase.

@kwvg kwvg modified the milestones: 21.2, 22 Oct 9, 2024
@MrDefacto
Copy link

Tested on the mainnet for over two months with no issues so far.

@PastaPastaPasta
Copy link
Member

@kwvg what is the status here?

@kwvg kwvg marked this pull request as ready for review November 13, 2024 15:41
@kwvg kwvg requested review from knst, UdjinM6 and PastaPastaPasta and removed request for UdjinM6 November 13, 2024 15:41
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

utACK e51a95a

UdjinM6
UdjinM6 previously approved these changes Nov 13, 2024
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK e51a95a

knst
knst previously approved these changes Nov 14, 2024
Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

LGTM e51a95a

consider nits

src/evo/assetlocktx.cpp Outdated Show resolved Hide resolved
src/evo/assetlocktx.cpp Outdated Show resolved Hide resolved
src/rpc/quorums.cpp Outdated Show resolved Hide resolved
src/rpc/quorums.cpp Outdated Show resolved Hide resolved
kwvg added 2 commits November 14, 2024 10:07
Some portions of the codebase make implicit assumptions that `GetQuorum`
will not return a `nullptr` by not performing checking for it or make
explicit assumptions by `assert`ing not-`nullptr`.

Let's document explicit assumptions, document implicit assumptions and
soften some hard assumptions where softening is possible.
Copy link
Collaborator

@knst knst left a comment

Choose a reason for hiding this comment

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

utACK a014cf3

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

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

utACK a014cf3

@PastaPastaPasta PastaPastaPasta merged commit c44ae90 into dashpay:develop Nov 14, 2024
42 of 43 checks passed
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.

5 participants