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

[MET-46] feat: dynamic data slot for each field #6

Merged
merged 19 commits into from
Dec 21, 2023
Merged

Conversation

RequescoS
Copy link
Contributor

@RequescoS RequescoS commented Dec 20, 2023

Added slot_updated logic for each field in AssetDynamicDetails && AssetOwner structs. Refactored merge functions for this structs. Create insert_gaped_data function, that process CompleteAssetDetails. Wrote test for merge functions. Also this pr include some code clean up: removed unused imports in Cargo.toml for ingester and digital_asset_types, unused directories in project, adjust MakeFile and docker-compose.yaml etc

let slot_updated = vec![owner.slot_updated, leaf.slot_updated]
.into_iter()
.max()
.unwrap(); // unwrap here is save, because vec is not empty
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.unwrap(); // unwrap here is save, because vec is not empty
.unwrap(); // unwrap here is safe, because vec is not empty

pub is_compressible: (u64, bool),
pub is_compressed: (u64, bool),
pub is_frozen: (u64, bool),
pub supply: (u64, Option<u64>),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you have a supply or seq or unchain_data with some slot updated and None value?

pub creators: Vec<Creator>,
pub royalty_amount: u16,
pub slot_updated: u64,
pub is_compressible: (u64, bool),
Copy link
Collaborator

@StanChe StanChe Dec 20, 2023

Choose a reason for hiding this comment

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

Maybe we need something like

struct Updated<T> {
    slot_updated: u64,
    value: T,
}

What do you think of that?

# Conflicts:
#	digital_asset_types/src/dao/scopes/asset.rs
#	nft_ingester/src/bubblegum_updates_processor.rs
#	nft_ingester/src/mplx_updates_processor.rs
#	nft_ingester/src/token_updates_processor.rs
#	rocks-db/src/asset.rs
#	rocks-db/src/batch_client.rs
# Conflicts:
#	nft_ingester/src/token_updates_processor.rs
#	rocks-db/src/asset.rs
@RequescoS RequescoS marked this pull request as ready for review December 21, 2023 01:54
@RequescoS RequescoS changed the title feat: dynamic data slot for each field [MET-46] feat: dynamic data slot for each field Dec 21, 2023
@@ -33,6 +33,8 @@ export INGESTER_SLOT_UNTIL=0
export INGESTER_SLOT_START_FROM=236032212
export INGESTER_BIG_TABLE_CONFIG='{creds="./creds.json", timeout=1000}'

export ingester_synchronizer_batch_size=500
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: let's make capitalize for consistency?

build:
context: .
dockerfile: migrator.Dockerfile

ingester-first-consumer:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can drop ingester-second-consumer as well?

Copy link
Collaborator

@StanChe StanChe left a comment

Choose a reason for hiding this comment

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

image Sviat, you're rocking today 🚀 Approve just before you've reached 20k lines impact

@RequescoS RequescoS merged commit 1262ef1 into main Dec 21, 2023
1 check passed
@RequescoS RequescoS deleted the feat/dynamic-merge branch December 21, 2023 16:36
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.

3 participants