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

sct(component): implement Component trait and split modules #3723

Merged
merged 13 commits into from
Feb 2, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Feb 1, 2024

Prelude to #3712, and follow-up to #3617 (clean-up).

This splits the penumbra_sct::component::view module into three:

  • component::tree mediate access to the state commitment tree and nullifier set
  • component::clock provide access to the blockchain clocks (epoch index, block heights and timestamps)
  • component::source provide a helper trait to create "ambient" (i.e. intra-block) tracking of commitment sources

This is a WIP. I am leaning toward fixing #3712 in a different PR, because it might require deeper structural change to block/epoch finalization.

I am not completely sold on the name, but the idea is that what you
find here are extension traits that let you manage the blockchain
clocks. Those clocks can be logical e.g. a block or an epoch, or
literal wall clock (recorded by block timestamps, and eventually
PBTS).

In particular, we define `EpochManager` and `EpochRead` which
implement write and read capabiltiies respectively.
In this module, we find composable extension traits that let us
interface with the chain's commitment tree. This is done by plugging
into `SctRead` or `SctManager`.

We also add a third interface (`tree:VerificationExt`) which action
handlers can pull in order to perform SCT specific verification of
anchors or nullifiers.
This is a purely mechanical refactor, and might be better to
merge into the tree module to increase cohesion.
@erwanor erwanor requested a review from hdevalence February 1, 2024 21:44
@erwanor erwanor added the A-node Area: System design and implementation for node software label Feb 1, 2024
@erwanor erwanor marked this pull request as ready for review February 1, 2024 23:27
@erwanor erwanor self-assigned this Feb 2, 2024
@conorsch conorsch added this to the Testnet 65: Deimos milestone Feb 2, 2024
@erwanor erwanor merged commit 8a3733e into main Feb 2, 2024
7 checks passed
@erwanor erwanor deleted the erwan/sct_app_refactor branch February 2, 2024 19:48
TalDerei pushed a commit that referenced this pull request Feb 8, 2024
* sct(view): remove catch-all view module

* sct(component): remove top-level module sig

* sct(component): add `component::clock`

I am not completely sold on the name, but the idea is that what you
find here are extension traits that let you manage the blockchain
clocks. Those clocks can be logical e.g. a block or an epoch, or
literal wall clock (recorded by block timestamps, and eventually
PBTS).

In particular, we define `EpochManager` and `EpochRead` which
implement write and read capabiltiies respectively.

* sct(component): add `component::Tree`

In this module, we find composable extension traits that let us
interface with the chain's commitment tree. This is done by plugging
into `SctRead` or `SctManager`.

We also add a third interface (`tree:VerificationExt`) which action
handlers can pull in order to perform SCT specific verification of
anchors or nullifiers.

* sct(component): move `SourceContext`

This is a purely mechanical refactor, and might be better to
merge into the tree module to increase cohesion.

* sct(component): update query service imports

* sct(component): implement `cnidarium_component::Component` on the sct

* sct(component): propagate api changes

* sct(component): sketch out updated state key schema

* app: use `Sct::init_chain` and `Sct::begin_block`

* sct(component): track module definition

* sct(component): use updated state key schema

* penumbra: misc small fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-node Area: System design and implementation for node software
Projects
Archived in project
Status: Testnet 65: Deimos
Development

Successfully merging this pull request may close these issues.

2 participants