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

NV22 dragon state migration #3955

Merged
merged 7 commits into from
Mar 7, 2024
Merged

NV22 dragon state migration #3955

merged 7 commits into from
Mar 7, 2024

Conversation

LesnyRumcajs
Copy link
Member

@LesnyRumcajs LesnyRumcajs commented Feb 14, 2024

Summary of changes

Changes introduced in this pull request:

  • support for NV22 + state migrations - calibration upgrade date defined, mainnet TBD with the final bundle update,
  • tested:
    • ✔️ mainnet/calibnet produces the same state as Lotus v1.26.0-rc2,
    • ✔️ butterflynet interop tests with Lotus
    • ✔️ devnet checks in CI updated
    • ⚠️ mainnet migration takes quite a while - 150s on my machine, 500s on a droplet, requiring 64 GB of RAM.

Reference issue to close (if applicable)

Closes #3856

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@LesnyRumcajs LesnyRumcajs force-pushed the dragon-state-migration branch 3 times, most recently from 2afd31a to 50102fb Compare March 1, 2024 09:53
@LesnyRumcajs LesnyRumcajs force-pushed the dragon-state-migration branch 3 times, most recently from f2cd2d1 to 71903f7 Compare March 7, 2024 13:29
@LesnyRumcajs LesnyRumcajs marked this pull request as ready for review March 7, 2024 13:47
@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner March 7, 2024 13:47
@LesnyRumcajs LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team March 7, 2024 13:47
@@ -78,18 +80,29 @@ impl<BS: Blockstore + Send + Sync> StateMigration<BS> {
}

let cache = MigrationCache::new(NonZeroUsize::new(10_000).expect("infallible"));
let num_threads = std::env::var("FOREST_STATE_MIGRATION_THREADS")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would validate that to avoid footgun.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forced it to at least 3.

.build()?;

let (state_tx, state_rx) = crossbeam_channel::bounded(1);
let (job_tx, job_rx) = crossbeam_channel::bounded(1);
let (state_tx, state_rx) = crossbeam_channel::bounded(30);
Copy link
Contributor

Choose a reason for hiding this comment

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

why crossbeam if we're using flume elsewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Outside of the scope of this PR. Maybe it could be replaced elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

let (state_tx, state_rx) = crossbeam_channel::bounded(1);
let (job_tx, job_rx) = crossbeam_channel::bounded(1);
let (state_tx, state_rx) = crossbeam_channel::bounded(30);
let (job_tx, job_rx) = crossbeam_channel::bounded(30);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why are the channels bound specifically to 30?

Copy link
Member Author

Choose a reason for hiding this comment

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

Magic number, same as cache set to 10k. Setting it to higher value, just like with cache sizes, may increase the memory footprint.

Copy link
Contributor

Choose a reason for hiding this comment

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

as long as it works. I would probably make it a constant with a little comment instead, but not critical.

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Mar 7, 2024
Merged via the queue into main with commit 2f625fb Mar 7, 2024
26 of 27 checks passed
@LesnyRumcajs LesnyRumcajs deleted the dragon-state-migration branch March 7, 2024 14:40
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.

[Forest] NV22 state migration
3 participants