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: Mockamoto + coordinator integration #4098

Merged
merged 6 commits into from
Dec 1, 2023
Merged

Conversation

kantai
Copy link
Member

@kantai kantai commented Nov 28, 2023

Description

This PR integrates the mockamoto node into the latest nakamoto coordinator work. It includes a test case that ensures that the event observer sees 100 nakamoto blocks.

This operation simulates bitcoin blocks, storing them directly into the burndb, and then notifying the chains coordinator.

let vrf_seed = VRFSeed::from_proof(&parent_vrf_proof);

let block_commit = LeaderBlockCommitOp {
block_header_hash: BlockHeaderHash([0; 32]),
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure this field is getting validated now. This should be the index block hash of the last tenure's tenure-start block.

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated this to be the parent block ID, but I would suggest that this is not being validated currently: the coordinator absolutely accepted blocks with null block header hashes.

Copy link
Member

Choose a reason for hiding this comment

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

the coordinator absolutely accepted blocks with null block header hashes.

Oh interesting! I'll see if I can fix this in my tenure-change validation PR.

Copy link

codecov bot commented Nov 28, 2023

Codecov Report

Attention: 1162 lines in your changes are missing coverage. Please review.

Comparison is base (1bb5331) 0.04% compared to head (be3c28b) 0.04%.
Report is 29 commits behind head on next.

Files Patch % Lines
testnet/stacks-node/src/mockamoto.rs 0.00% 477 Missing ⚠️
testnet/stacks-node/src/config.rs 0.00% 118 Missing ⚠️
testnet/stacks-node/src/mockamoto/tests.rs 0.00% 94 Missing ⚠️
stacks-common/src/util/secp256k1.rs 0.00% 86 Missing ⚠️
stackslib/src/chainstate/nakamoto/mod.rs 0.00% 74 Missing ⚠️
stackslib/src/chainstate/nakamoto/tests/node.rs 0.00% 72 Missing ⚠️
...kslib/src/chainstate/nakamoto/coordinator/tests.rs 0.00% 57 Missing ⚠️
testnet/stacks-node/src/mockamoto/signer.rs 0.00% 45 Missing ⚠️
stackslib/src/chainstate/stacks/boot/mod.rs 0.00% 39 Missing ⚠️
stackslib/src/net/relay.rs 0.00% 30 Missing ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4098      +/-   ##
==========================================
- Coverage    0.04%    0.04%   -0.01%     
==========================================
  Files         419      421       +2     
  Lines      297652   298557     +905     
==========================================
  Hits          136      136              
- Misses     297516   298421     +905     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

@kantai events for the initial boot contracts and seed balance are missing:

  • The initial synthetic token_transfer tx containing stx_mint events for the seed account(s)
  • These contracts: bns, pox, costs, cost-voting, genesis.

The API tests don't work very well when the stx_mints and bns boot contract in particular are missing. Anyway to get these working?

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

The /new_block event has the properties pox_v1_unlock_height and pox_v2_unlock_height -- can pox_v3_unlock_height be added?

@kantai
Copy link
Member Author

kantai commented Nov 30, 2023

@zone117x -- both should be added in my last commit.

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

This works well for initial API integration, the events were usable to ingest TenureChange txs and NakamotoBlocks. We're still working on pox-3 force unlocks & pox-4 integration and testing. I'll open issues for any bugs found if necessary.

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM

@kantai kantai merged commit 53c168d into next Dec 1, 2023
2 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.

None yet

4 participants