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

feat(iota-genesis-builder): create a Hornet snapshot filter framework + filter out voting outputs #4513

Merged
merged 33 commits into from
Jan 7, 2025

Conversation

miker83z
Copy link
Contributor

@miker83z miker83z commented Dec 17, 2024

Description of change

This PR builds on top of #4389. In there, the MergingIterator was simply moved into its own file. This iterator was already filtering some outputs to: (i) scale the amount of iota from micro to nano, (ii) find unlockable vesting outputs and merge them (implemented in #1238).

In this PR, these filtering operations are firstly standardized into iterators and then a third filter is added -> ParticipationOutputIterator. This one matches basic outputs having a tag being the voting "Participation Tag" and then removes Tag and Metadata features from the basic output.

[edit]
After this comment and a discussion on Slack, me and @muXxer came to the conclusion that not only "voting" basic outputs should be filtered for feature and metadata removal, but also "staking" basic outputs (unintentionally the implementation was already done to do so).

Links to any relevant issues

#4380 + staking basic outputs

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

  • cargo run --release --bin iota-genesis-builder -- --disable-global-snapshot-verification iota --snapshot-path ../latest-full_snapshot.bin --target-network alphanet-test --address-swap-map-path ../swap.csv

Change checklist

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

Dkwcs and others added 22 commits November 29, 2024 18:37
…ddresses to destination during the migration process
…ss has been swapped at least once

Create dedicated function to convert and swap addresses
* Make some improvements to the address swap map usage
@miker83z miker83z requested review from a team as code owners December 17, 2024 08:44
@iota-ci iota-ci added sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team labels Dec 17, 2024
@miker83z miker83z self-assigned this Dec 17, 2024
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f3a439d

✅ Preview: https://apps-backend-29a719c9ccbdb9b80c97b599a599d8953354da-e8448wny2.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f3a439d

✅ Preview: https://iota-rebased-explorer-092603f1de8088243ccb8b861b23e-j2tjza35r.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: f3a439d

✅ Preview: https://wallet-dashboard-a225fcfa1e2f852205a61a7cd1d5d93e92-429cow23n.vercel.app

@miker83z miker83z requested a review from muXxer December 18, 2024 13:07
DaughterOfMars and others added 3 commits December 19, 2024 10:08
* simplify filters

* Use debug for logs

* fix errors

* clippy

* new method using iterators

* clippy

* use drop for logging

* clippy
Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 8a750b4

✅ Preview: https://apps-ui-5if5ppu7m-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 8a750b4

✅ Preview: https://apps-backend-fg02btls5-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 8a750b4

✅ Preview: https://rebased-explorer-b7p7ejrie-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 8a750b4

✅ Preview: https://wallet-dashboard-pk9gonltg-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 0e5a810

✅ Preview: https://apps-backend-f1j0rf3zw-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 0e5a810

✅ Preview: https://wallet-dashboard-gq5dulnlh-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: 0e5a810

✅ Preview: https://rebased-explorer-2jfwrjozo-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: e95504a

✅ Preview: https://apps-backend-n8jjqenom-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: e95504a

✅ Preview: https://rebased-explorer-p6xd9h2wz-iota1.vercel.app

Copy link
Contributor

This pull request has been deployed to Vercel.

Latest commit: e95504a

✅ Preview: https://wallet-dashboard-9zdzqjjhq-iota1.vercel.app

Base automatically changed from sc-platform/address-swap-test to develop December 20, 2024 08:25
Copy link
Contributor

@kodemartin kodemartin left a comment

Choose a reason for hiding this comment

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

lgtm 🎈

@miker83z miker83z merged commit 05eef35 into develop Jan 7, 2025
42 checks passed
@miker83z miker83z deleted the sc-platform/filter-voting-outputs branch January 7, 2025 17:24
piotrm50 pushed a commit that referenced this pull request Jan 15, 2025
… + filter out voting outputs (#4513)

* feat(iota-genesis-builder): add address swap map for swaping origin addresses to destination during the migration process

* fix(iota-genesis-builder): relative path supporting, remove mut modifier

* fix(iota-genesis-builder): address_swap_map become field of Migration struct, minor renaming refactoring

* fix(iota-genesis-builder): add additional hashmap that track if address has been swapped at least once
Create dedicated function to convert and swap addresses

* fix(iota-genesis-builder): review's cmments fix

* fix(iota-genesis-builder): anyhow error has been added instead of panic

* cargo clippy

* typo spell fix

* fix(iota-genesis-builder): add comments to the public functions

* fix(iota-genesis-builder): remove mut modificator, remove extra hashmap

* fix(iota-types): parse first address from bech32 format, csv headers support

* fix(iota-types): example of CSV file in comments above initialization function

* Minor fix

* refactor(iota-genesis-builder): move output processing out of main

* feat(iota-genesis-builder): create a dedicated run migration function for iota snapshot

* feat(iota-e2e-tests): include snapshot generation and address swap in migration test

* Make some improvements to the address swap map usage (#4376)

* Make some improvements to the address swap map usage

* fix(iota-e2e-tests): update import

* feat(iota-genesis-builder): create a Hornet snapshot filter framework

* feat(iota-genesis-builder): add metrics print in filters

* fix typo

* refactor(iota-genesis-builder): voting -> participation filter

* Simplify the filters by using nested iterators (#4526)

* simplify filters

* Use debug for logs

* fix errors

* clippy

* new method using iterators

* clippy

* use drop for logging

* clippy

* refactor(iota-genesis-builder): update comments

* fix(iota-genesis-builder): participation output keeps sender and issuer feats

* clippy :)

* fix(iota-genesis-builder): remove issuer from basic features

---------

Co-authored-by: Dkwcs <pavlo.botnar@gmail.com>
Co-authored-by: DaughterOfMars <chloedaughterofmars@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sc-platform Issues related to the Smart Contract Platform group. vm-language Issues related to the VM & Language Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[genesis-builder] Filter out voting tags and metadata from basic outputs in a Hornet snapshot
7 participants