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

ZSA integration (step 8): Merge zsa-issued-assets into zsa-integration-consensus with bug fixes #29

Open
wants to merge 36 commits into
base: zsa-integration-consensus
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1af120e
Defines and implements the issued asset state types
arya2 Nov 12, 2024
cc8bc0d
Adds issued assets to the finalized state
arya2 Nov 12, 2024
c7116f3
Validates issuance actions and burns before committing blocks to a no…
arya2 Nov 12, 2024
bb62c67
Adds `issued_assets` fields on `ChainInner` and `ContextuallyValidate…
arya2 Nov 12, 2024
3d00b81
Adds issued assets map to non-finalized chains
arya2 Nov 12, 2024
2daf84f
adds new column family to list of state column families
arya2 Nov 12, 2024
c6c099b
Updates AssetState, AssetStateChange, IssuedAssetsOrChange, & Semanti…
arya2 Nov 14, 2024
9e0e043
Fixes tests by computing an `IssuedAssetsChange` for conversions to C…
arya2 Nov 14, 2024
8f26a89
fixes finalization checks
arya2 Nov 14, 2024
e063729
Adds documentation to types and methods in `asset_state` module, fixe…
arya2 Nov 15, 2024
6aad8da
Merge branch 'zsa-issued-assets' into zsa-integration-state
dmidem Nov 27, 2024
f0b64ad
Fix compilation errors that appeared after the previous merge
dmidem Nov 27, 2024
bc0c8e6
Avoid using NonEmpty in orchard_zsa/issuance
dmidem Nov 27, 2024
17f3ee6
Fix BurnItem serialization/deserializartioon errors (use LE instead o…
dmidem Nov 27, 2024
3f96af0
Make a minor fix and add FIXME comment in orchard_flavor_ext.rs
dmidem Nov 27, 2024
5524480
Fix the sign of burn value in SupplyChange::add in orchard_zsa/asset_…
dmidem Nov 27, 2024
8096da4
Fix the 'transactions must have only one burn item per asset base' er…
dmidem Nov 27, 2024
20fd58d
Use NoteValue from the orchard crate for BurnItem amount instead of u…
dmidem Nov 27, 2024
4932495
Use BurnItem::from instead of try_from
dmidem Nov 27, 2024
89be470
Fix a compilation error for the previous commit ('Use BurnItem::from …
dmidem Nov 27, 2024
c3daec9
Fix a compilation error for the previous commit ('Use BurnItem::from …
dmidem Nov 27, 2024
a8668d6
Modify ValueCommitment::with_asset to accept value as a NoteValue ins…
dmidem Dec 3, 2024
e31f24c
Adds TODOs
arya2 Nov 28, 2024
2a5aebd
Adds state request/response variants for querying asset states
arya2 Nov 28, 2024
f7b43a9
Adds a `getassetstate` RPC method
arya2 Nov 28, 2024
e35ae57
Adds snapshot test
arya2 Nov 28, 2024
c278758
Addesses some FIXMEs and replaces a couple others with TODOs.
arya2 Nov 29, 2024
d144774
Removes `issued_assets_change` field from `SemanticallyVerifiedBlock`
arya2 Nov 29, 2024
727e3e3
Temporarily disable specific Clippy checks for Rust 1.83.0 compatibility
dmidem Dec 5, 2024
9a8c032
Disable clippy warning about doc comment for empty line
dmidem Dec 5, 2024
fb512d9
Update Orchard ZSA consensus tests to calculate and check asset supply
dmidem Dec 6, 2024
977af42
Rename ZSA workflow tests (including file, constant and variable name…
dmidem Dec 6, 2024
29af613
Add amount method to BurnItem and make BurnItem pub (visible for othe…
dmidem Dec 6, 2024
2b7926a
Fix Orchard ZSA workflow tests to make it compilable with getblocktem…
dmidem Dec 6, 2024
73c804f
Fix clippy error
dmidem Dec 6, 2024
6bd4284
Add rust-toolchain.toml with Rust version 1.82.0 to avoid clippy erro…
dmidem Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion zebra-chain/src/orchard_zsa/asset_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct AssetState {
pub struct AssetStateChange {
/// Whether the asset should be finalized such that no more of it can be issued.
pub should_finalize: bool,
// FIXME: is this a correct comment?
/// Whether the asset should be finalized such that no more of it can be issued.
pub includes_issuance: bool,
/// The change in supply from newly issued assets or burned assets, if any.
Expand All @@ -50,6 +51,7 @@ impl Default for SupplyChange {
}
}

// FIXME: can we reuse some functions from orchard crate?s
impl SupplyChange {
/// Applies `self` to a provided `total_supply` of an asset.
///
Expand Down Expand Up @@ -81,7 +83,8 @@ impl SupplyChange {
// Burn amounts MUST not be 0
// TODO: Reference ZIP
0.. => signed.try_into().ok().map(Self::Issuance),
..0 => signed.try_into().ok().map(Self::Burn),
// FIXME: (-signed) - is this a correct fix?
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is correct, thank you for catching it!

..0 => (-signed).try_into().ok().map(Self::Burn),
})
{
*self = result;
Expand Down