Skip to content

feat!: chainlock optimized verification - #1621

Merged
QuantumExplorer merged 64 commits into
v1.0-devfrom
feat/chainlockOptimizedVerification
Jan 28, 2024
Merged

feat!: chainlock optimized verification#1621
QuantumExplorer merged 64 commits into
v1.0-devfrom
feat/chainlockOptimizedVerification

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Dec 6, 2023

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Chain Locks had a few issues in our system. When a proposer proposes a chain lock, all other nodes must verify this chain lock, but they must also be synced up to that chain lock height. This might not always be the case in rare circumstances.

We were also calling core on each verification. This is overkill, as we could cache the chain lock quorums and verify core chain locks in Platform instead as long as we had those quorum public keys.

What was done?

Chain locks now are verified in Platform.
In the race condition that Platform knows about a valid chain lock but core does not they are submitted to core.
In the rare case that Platform can not verify a chain lock they are verified through core.

How Has This Been Tested?

Strategy tests were created.

Breaking Changes

This introduces many breaking changes. Most notably that the state now contains information about chain lock quorums.

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 added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@ogabrielides ogabrielides left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some comments + questions

Comment thread packages/rs-drive-abci/src/config.rs Outdated
@QuantumExplorer
QuantumExplorer changed the base branch from v1.0-dev to master December 28, 2023 02:01
@QuantumExplorer
QuantumExplorer changed the base branch from master to v1.0-dev January 4, 2024 09:32
Comment thread packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs Outdated
Comment thread packages/rs-drive-abci/src/abci/handler/mod.rs
Comment thread packages/rs-drive-abci/tests/strategy_tests/chain_lock_update.rs Outdated
Comment thread package.json Outdated
{
"name": "@dashevo/platform",
"version": "1.0.0-dev.3",
"version": "1.0.0-pr.1621.3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please revert versions before we merge it

// Scoring system logic
let mut scores: Vec<(ReversedQuorumHashBytes, &BlsPublicKey, [u8; 32])> = Vec::new();

for (quorum_hash, public_key) in quorums {

@shumkov shumkov Jan 26, 2024

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Extract to private method to remove duplication?

@shumkov shumkov changed the title feat: chainlock optimized verification feat!: chainlock optimized verification Jan 28, 2024

@shumkov shumkov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job!

@ogabrielides ogabrielides left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK

@QuantumExplorer

Copy link
Copy Markdown
Member Author

CI was green before so merging.

@QuantumExplorer
QuantumExplorer merged commit 20b39d6 into v1.0-dev Jan 28, 2024
@QuantumExplorer
QuantumExplorer deleted the feat/chainlockOptimizedVerification branch January 28, 2024 15:13
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