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/stackerdb #3534

Closed
wants to merge 29 commits into from
Closed

Feat/stackerdb #3534

wants to merge 29 commits into from

Conversation

jcnelson
Copy link
Member

@jcnelson jcnelson commented Jan 27, 2023

Closing in favor of:

This PR creates a Stacker DB subsystem in the peer network. A stacker DB is an ephemeral database that can be created for any existing smart contract that confirms to a simple trait interface. Nodes opt-in to hosting replicas of the DB, and users of the smart contract get to leverage the Stacks p2p network to store app-specific state for up to one reward cycle at a time.

This PR is just a draft because the system is not complete. This PR still needs the following:

  • An RPC interface for getting chunks
  • An RPC interface for storing chunks
  • An update to /v2/neighbors to include the list of stacker DBs that the neighbor claims to replicate
  • The ability to query the DB's associated smart contract for a list of principals and number of DB slots they can write to
  • The ability to vacuum DBs every reward cycle
  • Messages for nodes to inform their neighbors when they have new chunks, as well as the means for neighbors to react by pulling the chunks if they are newer (right now, the system is only pull-oriented).
  • Integration tests for all of the above.

I'm creating this draft to (1) start running CI on it and (2) start working with @donpdonp and @xoloki to get the RPC interface and contract interface nailed down.

…ansion to handle test-defined stacker DB instances
… communication logic into a trait with trait methods so we can use it for stacker DBs as well as neighbor walks
@codecov
Copy link

codecov bot commented Jan 27, 2023

Codecov Report

Merging #3534 (9fb35ff) into develop (448b6df) will decrease coverage by 0.08%.
The diff coverage is 12.72%.

@@             Coverage Diff             @@
##           develop    #3534      +/-   ##
===========================================
- Coverage    30.98%   30.90%   -0.08%     
===========================================
  Files          298      308      +10     
  Lines       272236   276225    +3989     
===========================================
+ Hits         84340    85362    +1022     
- Misses      187896   190863    +2967     
Impacted Files Coverage Δ
src/burnchains/mod.rs 60.22% <ø> (ø)
src/main.rs 0.00% <0.00%> (ø)
src/net/codec.rs 38.48% <0.00%> (-3.56%) ⬇️
src/net/inv.rs 39.29% <0.00%> (-0.25%) ⬇️
src/net/poll.rs 45.70% <0.00%> (+1.29%) ⬆️
src/net/prune.rs 8.89% <0.00%> (-0.06%) ⬇️
src/net/stackerdb/bits.rs 0.00% <0.00%> (ø)
src/net/stackerdb/mod.rs 0.00% <0.00%> (ø)
src/net/stackerdb/selectors/pox.rs 0.00% <0.00%> (ø)
src/net/stackerdb/selectors/smart_contract.rs 0.00% <0.00%> (ø)
... and 75 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

This was referenced Feb 4, 2023
@jcnelson
Copy link
Member Author

jcnelson commented Feb 9, 2023

Closing in favor of the other stacker DB PRs.

@jcnelson jcnelson closed this Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant