Skip to content

Conversation

@random-zebra
Copy link

Zerocoin accumulators values were updated when validating zerocoin mints and then used to verify (v1 and v2) zerocoin spends proofs. Since mints are disabled, and new public zerocoin spends don't rely on accumulators values (and old proofs signatures are no longer checked during IBD), we can remove accumulators databases and maps.
We only need to record the accumulators checksums (to validate legacy zPOS, getting the right stake modifier). These are stored on chain (accumulator checkpoints in block version < 7), but we introduce a small database (indexing <checksum, denom> pairs with the height of their first occurrence on chain) during IBD for performance.
The checksums database is then wiped after the last checkpoint block.

Resync from scratch has been tested both on mainnet and testnet.

Fuzzbawls
Fuzzbawls previously approved these changes Jan 27, 2020
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK

Edit: needs rebase now

@Fuzzbawls Fuzzbawls dismissed their stale review January 27, 2020 08:51

needs rebase

@random-zebra random-zebra force-pushed the 2020_Remove_Zerocoin_1 branch from 547e5a2 to c060fce Compare January 27, 2020 09:00
@random-zebra
Copy link
Author

Rebased.

Fuzzbawls
Fuzzbawls previously approved these changes Jan 27, 2020
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK c060fce43531130d3ee1e616f5c9d31190fc9abb

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Overall looking awesome 💜 .

Just left two comments for future PRs. And Left my node re syncing, once it's done will ACK it.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

ACK 1438309

furszy added a commit that referenced this pull request Jan 28, 2020
…values

1438309 [DB] Introduce legacy zerocoinDB: save accumulator checksums for zPOS (random-zebra)
3c9b537 [Cleanup] Remove Accumulators / AccumulatorCheckpoints / AccumulatorMaps (random-zebra)

Pull request description:

  Zerocoin accumulators **values** were updated when validating zerocoin mints and then used to verify (v1 and v2) zerocoin spends proofs. Since mints are disabled, and new *public* zerocoin spends don't rely on accumulators values (and old proofs signatures are no longer checked during IBD), we can remove accumulators databases and maps.
  We only need to record the accumulators  **checksums** (to validate legacy zPOS, getting the right stake modifier). These are stored on chain (accumulator checkpoints in block version < 7), but we introduce a small database (indexing <checksum, denom> pairs with the height of their first occurrence on chain) during IBD for performance.
  The checksums database is then wiped after the last checkpoint block.

  Resync from scratch has been tested both on mainnet and testnet.

ACKs for top commit:
  furszy:
    ACK 1438309

Tree-SHA512: acf57eca04e0bd63844f83685f043b3d6f948a49a1b3e595b68696926d12ea8f946fb3666dd522d3bc90fddc62750b8f0a105a5306b6fd0b555b6e161b81f858
@furszy furszy merged commit 1438309 into PIVX-Project:master Jan 28, 2020
random-zebra added a commit that referenced this pull request Jan 31, 2020
b77c064 [Docs] Document zerocoin-related RPC changes for release notes (random-zebra)
4800729 [Core][Cleanup] Remove modifier as member of StakeInput objects (random-zebra)
238ea5f [Core][Cleanup][zPIV] CZPivStake --> CLegacyZPivStake (random-zebra)
f1b21a2 [Core][Cleanup][zPIV] Remove code to produce v2 spends and zPOS stakes (random-zebra)

Pull request description:

  This removes (now unused) code to produce old zerocoin spends and zPOS stakes.
  `CZPivStake` class is replaced with a `CLegacyZPivStake` (moved in new files `zpiv/zpos.*`) used exclusively to validate the chain.
  This also refactors `CStakeInput` class, removing the modifier functions (put back in kernel) and cleans up `kernel.*` files, removing old code and reorganizing them.

  This PR is based on top of:
  - [x] #1259
  - [x] #1290

  and it will be rebased after their merge. Only last **3** commits are relevant

ACKs for top commit:
  furszy:
    Re-acking the PR, release notes added. ACK b77c064
  Fuzzbawls:
    ACK b77c064

Tree-SHA512: cdf937822b435d3d05a8d3000d17340c74f7b7b17da4f1937935cb7bd71fddea9628c35a934c5abeea9ecb40b8daed074a49040479138a28fcd6699f2ca8bb8d
@random-zebra random-zebra added this to the 4.1.0 milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants