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

shielded-pool: delegate supply tracking to components #4020

Merged
merged 14 commits into from
Mar 15, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Mar 13, 2024

Close #4018

@erwanor erwanor added A-IBC Area: IBC integration with Penumbra A-staking Area: Design and implementation of staking and delegation zellic-component-remediated Tag PRs that are remediating Zellic findings consensus-breaking breaking change to execution of on-chain data state-breaking breaking change to on-chain data labels Mar 14, 2024
@erwanor erwanor force-pushed the erwan/4018_rm_supply_track branch from 8189d85 to 7649a8a Compare March 14, 2024 22:41
@erwanor erwanor force-pushed the erwan/4018_rm_supply_track branch from 7649a8a to b483e30 Compare March 14, 2024 23:30
@erwanor
Copy link
Member Author

erwanor commented Mar 15, 2024

This PR leaves the asset metadata tracking in the shielded pool. The reason is that it is useful to have a single RPC capable of serving queries about asset metadata, and the shielded pool crate is a lower level component that all customers of register_denom already depend on (independently), in other words, there isn't a great place to move it to.

@erwanor erwanor marked this pull request as ready for review March 15, 2024 01:14
@erwanor erwanor requested review from cratelyn and hdevalence March 15, 2024 01:15
@cratelyn cratelyn added this to the Sprint 2 milestone Mar 15, 2024
Co-authored-by: katelyn martin <[email protected]>
Signed-off-by: Erwan Or <[email protected]>
async fn denom_by_asset(&self, asset_id: &asset::Id) -> Option<Metadata> {
self.get(&state_key::denom_by_asset(asset_id))
.await
.expect("no deserialization error")
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Will this potentially fail for benign resigns we nevertheless want to throw upstream, e.g. wrong storage path? IDK what the convention here is though.

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 don't think so, the failure mode for this is if we have a cache miss that hits storage and fails. The most likely reason this happens is some disk failure that cause storage degradation. Either way, it's irrecoverable for callers and the node should halt.

@erwanor
Copy link
Member Author

erwanor commented Mar 15, 2024

Merging to get out of the way of #4001, happy to revisit.

@erwanor erwanor merged commit 6268a27 into main Mar 15, 2024
6 checks passed
@erwanor erwanor deleted the erwan/4018_rm_supply_track branch March 15, 2024 15:20
@erwanor erwanor self-assigned this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-IBC Area: IBC integration with Penumbra A-staking Area: Design and implementation of staking and delegation consensus-breaking breaking change to execution of on-chain data state-breaking breaking change to on-chain data zellic-component-remediated Tag PRs that are remediating Zellic findings
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

shielded-pool: remove supply tracking from component
3 participants