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

Mandatory checkpoint on Canopy - breaking cached state test change #1898

Merged
merged 6 commits into from
Mar 18, 2021

Conversation

oxarbitrage
Copy link
Contributor

@oxarbitrage oxarbitrage commented Mar 12, 2021

Motivation

We want to checkpoint in Canopy to avoid the development of some validation code. More details in #1846

Solution

Change the mandatory checkpoint from Sapling to Canopy in the testnet and in the mainnet.

I synchronized zebra using this PR up to tip in 2 hours and 40 minutes. This is an improve (expected) from the last tries in the same machine of 3 hours.

In this PR mainnet checkpoints were upgraded while testnet ones were already passing Canopy so this was not needed.

Review

@teor2345

Related Issues

If merged this PR will close #1846

Follow Up Tasks

Post-canopy test vectors #1104 and #1099
Panic on pre-Canopy blocks in NonFinalizedState::commit_block #1903

@teor2345

This comment has been minimized.

Copy link
Contributor

@teor2345 teor2345 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, just missing an update to the testnet checkpoints. (And a few typos.)

I already have that synced, so I'll start generating the list now, and push it to this branch when it's done.

I also want to checkout this PR, and make sure we've replaced every relevant instance of Sapling with Canopy.

zebra-consensus/src/checkpoint/list/tests.rs Outdated Show resolved Hide resolved
zebra-consensus/src/checkpoint/list/tests.rs Outdated Show resolved Hide resolved
@teor2345
Copy link
Contributor

In this PR mainnet checkpoints were upgraded while testnet ones were already passing Canopy so this was not needed.

Please update both mainnet and testnet checkpoints for consistency. Otherwise, our testnet checkpoints will be very old.

I pushed this change.

In general, we want to keep both checkpoint lists up to date, whenever we change one of them.

@teor2345
Copy link
Contributor

I also want to checkout this PR, and make sure we've replaced every relevant instance of Sapling with Canopy.

There were lots of missing changes.

Please use an interactive search and replace tool to create future PRs like this.

I used the following commands:

fastmod Sapling Canopy
fastmod sapling canopy
fastmod sapling canopy .github

Then I checked each change to make sure that it was correct. (Sapling is the name of a network upgrade, and a shielded pool, so we can't just do an automatic search and replace.)

The .github command was required because fastmod ignores dotfiles by default.
(I also needed to remove smart quotes, due to a bug in fastmod's unicode handling. See #1902.)

@teor2345
Copy link
Contributor

@dconnolly this PR changes the cached tests to use Canopy, so it will require a cached state rebuild.

Can you show @oxarbitrage how to do that?

@teor2345 teor2345 changed the title Checkpoint on Canopy Checkpoint on Canopy - breaking test change Mar 15, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

@oxarbitrage can you check my changes to make sure they're ok?

I also added some follow-up tasks.

book/src/dev/rfcs/0005-state-updates.md Show resolved Hide resolved
Copy link
Contributor Author

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

  • I didn't changed the RFCs in the initial PR because i wasn't sure if that was something we should do, for example i am unsure if a ZIP can be changed after is implemented. In this case i think is ok.
  • I didn't added new testnet checkpoints by lack of time on Friday(had to sync a zcashd testnet), thanks for adding them.
  • I missed some changes, thanks for the fixes.

Looks good.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

@oxarbitrage has checked my changes, and I've checked his.

Leaving this PR open so @dconnolly can check the cached state changes if she wants.

@teor2345
Copy link
Contributor

* I didn't changed the RFCs in the initial PR because i wasn't sure if that was something we should do, for example i am unsure if a ZIP can be changed after is implemented. In this case i think is ok.

In general, I don't think we need to spend a lot of effort updating RFCs - if there is a significant change, we should do a rewrite or a new RFC.

But in this case, it took only a few minutes to update. And I didn't want us to get confused between Sapling and Canopy checkpoints.

@teor2345 teor2345 requested review from dconnolly and teor2345 and removed request for teor2345 March 17, 2021 00:55
@teor2345 teor2345 changed the title Checkpoint on Canopy - breaking test change Checkpoint on Canopy - breaking cached state test change Mar 18, 2021
@teor2345 teor2345 changed the title Checkpoint on Canopy - breaking cached state test change Mandatory checkpoint on Canopy - breaking cached state test change Mar 18, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

This is fine

@teor2345 teor2345 merged commit d19585c into ZcashFoundation:main Mar 18, 2021
@dconnolly dconnolly mentioned this pull request Mar 23, 2021
23 tasks
dconnolly added a commit that referenced this pull request Mar 23, 2021
Zebra's latest alpha checkpoints on Canopy activation, continues our work on NU5, and fixes a security issue.

Some notable changes include:

## Added
- Log address book metrics when PeerSet or CandidateSet don't have many peers (#1906)
- Document test coverage workflow (#1919)
- Add a final job to CI, so we can easily require all the CI jobs to pass (#1927)

## Changed
- Zebra has moved its mandatory checkpoint from Sapling to Canopy (#1898, #1926)
  - This is a breaking change for users that depend on the exact height of the mandatory checkpoint.

## Fixed
- tower-batch: wake waiting workers on close to avoid hangs (#1908)
- Assert that pre-Canopy blocks use checkpointing (#1909)
- Fix CI disk space usage by disabling incremental compilation in coverage builds (#1923)

## Security
- Stop relying on unchecked length fields when preallocating vectors (#1925)
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.

Change the mandatory checkpoint to Canopy
2 participants