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

Tracks issued assets state and contextually validates issue actions and asset burns #26

Open
wants to merge 10 commits into
base: zsa-integration-issuance-commitments
Choose a base branch
from

Conversation

arya2
Copy link
Collaborator

@arya2 arya2 commented Nov 12, 2024

This PR tracks issued assets in Zebra's state and uses that state to contextually validate issue actions and asset burns.

It still needs tests, additional documentation, cleanup, and to track information for creating split notes.

Review

This PR may be easier to review by commit.

@arya2 arya2 self-assigned this Nov 12, 2024
@arya2 arya2 force-pushed the zsa-issued-assets branch from 9f5cb45 to 3d00b81 Compare November 12, 2024 07:48
@arya2 arya2 marked this pull request as ready for review November 12, 2024 07:56
@arya2 arya2 requested review from PaulLaux and dmidem November 12, 2024 07:56
@arya2 arya2 force-pushed the zsa-issued-assets branch 2 times, most recently from 902bfa6 to 44dd204 Compare November 12, 2024 08:13
@arya2 arya2 force-pushed the zsa-issued-assets branch from 44dd204 to 2daf84f Compare November 12, 2024 08:24
self.issued_assets.get(asset_base).cloned()
}

/// Remove the History tree index at `height`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dmidem I think it would be simpler to keep the issued assets maps on each ContextuallyValidatedBlock partial relative to the previous block instead of making them partial relative to the finalized tip, but if they need to be relative to the finalized tip, copying the AssetBases for every block would multiply the non-finalized state's theoretical max memory use, so those should go in Arcs.

Suggested change
/// Remove the History tree index at `height`.
/// When a block with the provided `transactions` and partial `issued_assets` state is removed
/// from the chain tip, revert its changes from the [`Chain`]'s partial issued assets state.
///
/// When a block is removed from the chain root to be committed to the finalized state, any
/// assets in its partial `issued_assets` with an asset state matching the one in the chain's
/// partial issued assets map is removed from the chain's partial issued assets map (since that
/// it should match the finalized issued asset state.)

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.

1 participant