MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
1.98k stars 525 forks source link

UMT: mina-replayer does not generate output-file #15260

Open jrwashburn opened 6 months ago

jrwashburn commented 6 months ago

Preliminary Checks

Description

mina-replayer does not generate the output file when provided with the --output-file flag.

Steps to Reproduce

  1. mina-migration-replayer --migration-mode --archive-uri "postgresql://..." --input-file ~/migration/replayer-checkpoint-2335.json --checkpoint-interval 10 --output-file replayer_output.json

Expected Result

Expect replayer_output.json to be written in the current directory.

Actual Result

No output file is written.

Daemon version

Sorry - already upgraded but this was with the migration mode replayer from 1.0.0umt-tooling

How frequently do you see this issue?

Always

What is the impact of this issue on your ability to run a node?

Medium

Status

n/a

Additional information

While this does not impact the ability to run the migration, it does impact the ability to validate it, so I think this is a must-fix prior to fork.

mrmr1993 commented 5 months ago

@jrwashburn it looks like the output file is only written when there were no errors. Is the ask here that we always give an output file, or is it enough to log that we are skipping writing to $output_file due to errors?

jrwashburn commented 5 months ago

I think the verification process requires an output file? https://docs2-git-archivemigration-minadocs.vercel.app/berkeley-upgrade/migrating-archive-database-to-berkeley#how-to-verify-a-successful-migration

ghost-not-in-the-shell commented 5 months ago
  1. There's no output file because you didn't specify the target_epoch_ledgers_state_hash field in the input file, in the script you provided I saw that you are just using the checkpoint file.
  2. The file that's used in the verification process is the checkpoint file. --output-file flag is not getting used as all during the migration process.
jrwashburn commented 5 months ago
  1. There's no output file because you didn't specify the target_epoch_ledgers_state_hash field in the input file, in the script you provided I saw that you are just using the checkpoint file.

I'm not sure I understand the expectation - I think we are referring to step 5 or step 6 from these docs: https://docs2-git-archivemigration-minadocs.vercel.app/berkeley-upgrade/migrating-archive-database-to-berkeley#how-to-verify-a-successful-migration

Step 6 docs don't include a target_epoch_ledgers_state_hash - just --fork-state-hash: mina-berkeley-migration.exe --batch-size 2000 --config-file /etc/mina/genesis_ledgers/mainnet.json --mainnet-archive-uri postgres://postgres:postgres@localhost/archive_balances_migrated --migrated-archive-uri postgres://postgres:postgres@localhost/berkeley_migrated --blocks-bucket mina_network_block_data --network mainnet --fork-state-hash "3NLdCBNrDseiDKvVj8rZ15k2oAUvx4XuCc8mzf6fL2CmqTJVVceM"

  1. The file that's used in the verification process is the checkpoint file. --output-file flag is not getting used as all during the migration process.

The migration docs need to be updated; they specify to run with --output-file in step 6 labeled 5.b phase 2:

mina-replayer --migration-mode --archive-uri postgres://postgres:postgres@localhost/ --input-file checkpoint-XXXX.json --checkpoint-interval 100 --checkpoint-file-prefix migration --output-file migrated-checkpoint-at-fork-block.json

It's not clear how this is supposed to work or how to validate the migration.