Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Unified outputs #53

Closed
wants to merge 4 commits into from
Closed

Unified outputs #53

wants to merge 4 commits into from

Conversation

guidanoli
Copy link
Contributor

@guidanoli guidanoli commented May 24, 2023

No description provided.

@guidanoli guidanoli added feature New feature or request onchain Related to the onchain code labels May 24, 2023
@guidanoli guidanoli self-assigned this May 24, 2023
@gligneul gligneul changed the base branch from next to main May 25, 2023 14:26
@guidanoli guidanoli changed the base branch from main to feature/unify-proof-libraries July 18, 2023 18:01
Base automatically changed from feature/unify-proof-libraries to main July 21, 2023 20:46
BREAKING CHANGE: This commit removes constants
`VOUCHER_METADATA_LOG2_SIZE`, `NOTICE_METADATA_LOG2_SIZE`,
`EPOCH_VOUCHER_LOG2_SIZE`, and `EPOCH_NOTICE_LOG2_SIZE` from the
`CanonicalMachine` library; and parameters `outputEpochLog2Size` and
`outputHashesLog2Size` from the `validateEncodedOutput` function in
`LibOutputValidation`.
* Outputs are now encoded like Solidity function calls.
  Notices are like function calls to `Notice(bytes)`,
  and vouchers, to `Voucher(address,bytes)`.

BREAKING CHANGE: Changes the encoding of outputs.
* The epoch hash used to be composed by three Merkle trees: one for the
  vouchers generated in the epoch, another for the notices generated in
  the epoch, and a third one for the machine address space as a whole.
  This commit unifies vouchers and notices in the same Merkle tree,
  making the epoch hash composed now of only two Merkle trees: one for
  the outputs generated in the epoch, and another for the machine.

* The leaves of this new tree represent any type of output: voucher,
  notice, or any other output that we might come up with in the future.
  Their binary representations are disjoint because of a 4-byte header.

* This unification greatly simplifies the output validation algorithm,
  and removes a 256-bit field from the `OutputValidityProof` struct.

* Add text to `LibOutputValidation` that explains how the epoch hash
  is calculated, with the help of an ASCII diagram

BREAKING CHANGE: Removes fields `vouchersEpochRootHash` and
`noticesEpochRootHash` from the `OutputValidityProof` struct, and adds
`outputsEpochRootHash`. Changes the epoch hash calculation.
* In order to test the changes made to the output validation
  library, a workaround was implemented that uses the notice tree as
  the output tree for the new algorithm. This workaround is temporary
  and should be replaced when a new version of the echo machine is made
  available.
@guidanoli
Copy link
Contributor Author

Rebased.

@guidanoli
Copy link
Contributor Author

This PR has been migrated to cartesi/rollups-contracts#43.

@guidanoli guidanoli closed this Aug 28, 2023
@guidanoli guidanoli deleted the feature/output-unification branch August 28, 2023 16:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request onchain Related to the onchain code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant