Skip to content

Conversation

@knst
Copy link
Collaborator

@knst knst commented Sep 27, 2024

Issue being fixed or feature implemented

It reduces circular dependencies and simplify code.

What was done?

Removed circular dependency over PeerManager for llmq::QuorumBlockProcessor, llmq::CEhfSignals, llmq::ChainLocks, and several extra useful refactorings: see commits.

How Has This Been Tested?

Run test/lint/lint-circular-dependencies.sh

Breaking Changes

N/A

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
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone

@knst knst added this to the 22 milestone Sep 27, 2024
@knst knst marked this pull request as draft September 27, 2024 07:00
@knst knst force-pushed the fix-circular-net-processing-p3 branch 2 times, most recently from b3fc5f6 to 5e489bc Compare September 30, 2024 07:16
@knst knst marked this pull request as ready for review September 30, 2024 14:44
Comment on lines 615 to 616
auto inv_opt = quorumBlockProcessor.AddMineableCommitment(fqc);
if (inv_opt.has_value()) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: could combine

// skip deployments that do not use dip0023 or that have already been mined
if (!deployment.useEHF || ehfSignals.find(deployment.bit) != ehfSignals.end()) continue;

MNHFTxPayload mnhfPayload;
Copy link
Member

Choose a reason for hiding this comment

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

595c4cd this commit shouldn't be included here? If it's a fix? I'm confused by it

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 LGTM, don't love 5e489bc feels like it makes struct MessageProcessingResult too complicated

@github-actions
Copy link

github-actions bot commented Oct 1, 2024

This pull request has conflicts, please rebase.

@knst knst force-pushed the fix-circular-net-processing-p3 branch from 5e489bc to 5739e77 Compare October 3, 2024 09:32
@knst knst force-pushed the fix-circular-net-processing-p3 branch from 5739e77 to 32683b3 Compare October 3, 2024 09:38
@knst
Copy link
Collaborator Author

knst commented Oct 3, 2024

@knst knst force-pushed the fix-circular-net-processing-p3 branch from 5e489bc to 5739e77

1st force-push to resolve conflict

@knst knst force-pushed the fix-circular-net-processing-p3 branch from 5739e77 to 32683b3

2nd force-push to address comments

@UdjinM6
Copy link

UdjinM6 commented Oct 3, 2024

build fails

@knst knst force-pushed the fix-circular-net-processing-p3 branch from 32683b3 to ebff21f Compare October 3, 2024 11:33
@knst knst force-pushed the fix-circular-net-processing-p3 branch from ebff21f to d0f1778 Compare October 3, 2024 12:34
UdjinM6
UdjinM6 previously approved these changes Oct 3, 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 d0f1778

@knst knst requested a review from PastaPastaPasta October 3, 2024 18:03
}

void CChainLocksHandler::HandleNewRecoveredSig(const llmq::CRecoveredSig& recoveredSig)
MessageProcessingResult CChainLocksHandler::HandleNewRecoveredSig(const llmq::CRecoveredSig& recoveredSig)
Copy link
Member

Choose a reason for hiding this comment

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

I'm confused, this method doesn't doesn't return any error values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

HandleNewRecoveredSig is override of interface method

[[nodiscard]] virtual MessageProcessingResult HandleNewRecoveredSig(const CRecoveredSig& recoveredSig) = 0;

which belongs to CRecoveredSigsListener.
Some classes which implements CRecoveredSigsListener has errors to return, some - doesn't. See other commits, for example: https://github.com/dashpay/dash/pull/6292/files/#diff-f7c0d20797337d77a9cfbf40c4f627ec68ed5a12e2f1193fa91c32cf285d9e34R526 - returns MisbehavingError when ProcessNewChainlock or https://github.com/dashpay/dash/pull/6292/files/#diff-93616b1f609ab7dc32d07bcdd3de3611d59bb285cbd6dba5a3bc5b4c70e6c867R131 - return TX

}

void CEHFSignalsHandler::HandleNewRecoveredSig(const CRecoveredSig& recoveredSig)
MessageProcessingResult CEHFSignalsHandler::HandleNewRecoveredSig(const CRecoveredSig& recoveredSig)
Copy link
Member

Choose a reason for hiding this comment

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

same?

src/protocol.h Outdated
Comment on lines 587 to 588
std::optional<CInv> m_inventory;
std::optional<CInv> m_to_erase;
Copy link
Member

Choose a reason for hiding this comment

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

confused what the difference is between these? maybe document this API a bit?

@knst knst force-pushed the fix-circular-net-processing-p3 branch from 9cf789d to c77216e Compare October 4, 2024 19:24
@knst knst requested a review from PastaPastaPasta October 4, 2024 19:30
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 c77216e

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 c77216e

@PastaPastaPasta PastaPastaPasta merged commit 74e54b8 into dashpay:develop Oct 4, 2024
16 of 35 checks passed
@knst knst deleted the fix-circular-net-processing-p3 branch October 5, 2024 04:18
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.

3 participants