Skip to content

migration: Make migration-block-time a required flag#242

Merged
piersy merged 3 commits intocelo9from
palango/migration
Oct 7, 2024
Merged

migration: Make migration-block-time a required flag#242
piersy merged 3 commits intocelo9from
palango/migration

Conversation

@palango
Copy link
Copy Markdown

@palango palango commented Oct 1, 2024

Resolves https://github.com/celo-org/celo-blockchain-planning/issues/627

By making the flag required, we ensure node operators will always add one. So long as the correct number is passed as an argument (to be shared by the sequencer) the resulting block hash will match the sequencer's

@palango palango requested review from alecps and piersy October 1, 2024 15:52
Comment on lines +160 to +161
migrationBlockTime = uint64(time.Now().Unix())
// If the migration block time is not set, use the time of the last block incremented by one.
// This makes sure the migration is deterministic.
migrationBlockTime = header.Time + config.L2BlockTime
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think we want to do this, or at least not just one block time, because the sequencer will try to fill all the time between the migration block time and 'now' with blocks when it is started. So it's better to leave some space for the migration to happen, ideally we can pick the time to coincide with the completion of the migration.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So to clarify, we would increment header.time by a number roughly equal (maybe slightly less) than the time it takes to the migration so that the node doesn't try to add too many blocks to fill the gap?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah so we don't end up spamming blocks just as the network starts, so I would either use the flag or hardcode this a few days before we do the next migration, after we've done a trial run and have an idea of how long it would take.

Copy link
Copy Markdown

@alecps alecps left a comment

Choose a reason for hiding this comment

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

This looks good to me apart from the concern raised by Piers

@piersy piersy marked this pull request as draft October 2, 2024 11:05
@piersy
Copy link
Copy Markdown

piersy commented Oct 2, 2024

Lets put this on hold till we know roughly how long a mainnet migration will take.

@alecps
Copy link
Copy Markdown

alecps commented Oct 3, 2024

@piersy Another solution here would be to make the block time flag required and since only whoever is doing the first migration will need to run the script without passing a timestamp, we could add a way to explicitly override the requirement. E.g. maybe the flag is required but if --migration-block-time=now is passed then time.Now() is used. External operators will never need to do this

@piersy
Copy link
Copy Markdown

piersy commented Oct 3, 2024

@piersy Another solution here would be to make the block time flag required and since only whoever is doing the first migration will need to run the script without passing a timestamp, we could add a way to explicitly override the requirement. E.g. maybe the flag is required but if --migration-block-time=now is passed then time.Now() is used. External operators will never need to do this

@alecps I think just making it required is ok, the person who runs it first can just pick a timestamp by adding a few minutes to the current time.

@alecps alecps force-pushed the palango/migration branch from 6137080 to 34ba0ba Compare October 3, 2024 19:29
@alecps alecps marked this pull request as ready for review October 3, 2024 19:32
@alecps alecps requested a review from piersy October 3, 2024 19:32
@alecps alecps changed the title migration: Use deterministic default for migration block timestamp migration: Make-- migration-block-time a required flag Oct 3, 2024
@alecps alecps changed the title migration: Make-- migration-block-time a required flag migration: Make--migration-block-time a required flag Oct 3, 2024
@alecps alecps changed the title migration: Make--migration-block-time a required flag migration: Make migration-block-time a required flag Oct 3, 2024
Copy link
Copy Markdown

@piersy piersy left a comment

Choose a reason for hiding this comment

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

Looks good!

@karlb
Copy link
Copy Markdown

karlb commented Oct 7, 2024

The failing test is known to be flaky, see #249. This should not keep us from merging this PR.

@piersy piersy merged commit 3e1813b into celo9 Oct 7, 2024
@piersy piersy deleted the palango/migration branch October 7, 2024 11:37
karlb pushed a commit that referenced this pull request Oct 12, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Oct 14, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Oct 14, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Oct 14, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
alecps pushed a commit that referenced this pull request Oct 15, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
alecps pushed a commit that referenced this pull request Oct 16, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Oct 16, 2024
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 13, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 15, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 15, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 20, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 27, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 29, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 29, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Jan 31, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Feb 4, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Feb 4, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Feb 12, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Feb 12, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
karlb pushed a commit that referenced this pull request Feb 12, 2025
Make migration-block-time a required flag

---------

Co-authored-by: alecps <alec@cLabs.co>
Co-authored-by: piersy <pierspowlesland@gmail.com>
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.

4 participants