Support ZSAs in zebra-state #8990
Labels
A-consensus
Area: Consensus rule updates
A-state
Area: State / database changes
NU-7
Network Upgrade: NU7 specific tasks
Motivation
ZIP 227: Global Issuance State defines a map,
issued_assets
, ofAssetBase
andAssetState
("amount of the Asset in circulation" and whether the asset has been finalized such that no more of the asset may be issued). This is used to contextually validate ZSA actions that transfer or burn assets in ZIP 226.The asset state may also need to include a reference note commitment (such as the first note commitment for that asset).
Design
issued_assets: HashMap<AssetBase, AssetState>
should be added as a field onChainInner
update_chain_tip_with_block_parallel()
method should be updated to maintain theissued_assets
map when blocks are added to the chain:finalize
flag when assets are finalized.revert_chain_with()
method should be updated to revert changes to theissued_assets
map when blocks are removed from the chain, applying the opposite changes as those applied when blocks are added.Testing
Existing property-based and vectors tests for the non-finalized state that add blocks to non-finalized chains and check that the internal state of the updated chain match expectations will need to be updated.
The new column family should be added to the column family snapshot, and serialization tests should be added for the new types used in the db format (
AssetBase
andAssetState
).The text was updated successfully, but these errors were encountered: