-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat!: output unification #43
Conversation
8508974
to
296ccb7
Compare
296ccb7
to
77d9f68
Compare
77d9f68
to
ceed045
Compare
ceed045
to
f8b26b3
Compare
f8b26b3
to
a61d5f7
Compare
@@ -105,7 +190,7 @@ library LibOutputValidation { | |||
// is contained in it. We can't simply use hashOfOutput because the | |||
// log2size of the leaf is three (8 bytes) not five (32 bytes) | |||
bytes32 merkleRootOfHashOfOutput = MerkleV2.getMerkleRootFromBytes( | |||
abi.encodePacked(keccak256(encodedOutput)), | |||
abi.encodePacked(keccak256(abi.encode(output))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is a temporary solution to generate correct output validity proofs. We would like to hash output
directly, without having to ABI-encode it.
function writeInputs() internal { | ||
for (uint256 i; i < outputEnums.length; ++i) { | ||
LibServerManager.OutputEnum outputEnum = outputEnums[i]; | ||
if (outputEnum == LibServerManager.OutputEnum.VOUCHER) { | ||
Voucher memory voucher = getVoucher(i); | ||
writeInput(i, voucher.destination, voucher.payload); | ||
writeInput(i, noticeSender, this.encodeVoucher(voucher)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is a temporary solution to generate correct proofs. The new echo DApp should allow us to generate whatever vouchers and notices we need, as well as any output we might come up with in the future.
a61d5f7
to
8c0a23e
Compare
|
8c0a23e
to
51190c3
Compare
51190c3
to
96675e6
Compare
/// xxxxxxxxxxxxxxx │ | ||
/// xxxxxxxxxxxxxxxxx | ||
/// ┌────────┬─┬────────┐ | ||
/// │ ... │┼│ ... │ ───> For each input in the epoch (G) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before rebase, (G)
appears again in the struct OutputValidityProof
's comments, i.e.
/// @param inputIndexWithinEpoch Which input, inside the epoch, the output belongs to (G)
But because the struct OutputValidityProof
is moved to a new file after rebase, this reference is also removed
96675e6
to
d56a860
Compare
d56a860
to
6c25c07
Compare
@@ -978,8 +992,7 @@ contract ApplicationTest is TestBase { | |||
inputIndexWithinEpoch: v.inputIndexWithinEpoch.toUint64(), | |||
outputIndexWithinInput: v.outputIndexWithinInput.toUint64(), | |||
outputHashesRootHash: v.outputHashesRootHash, | |||
vouchersEpochRootHash: v.vouchersEpochRootHash, | |||
noticesEpochRootHash: v.noticesEpochRootHash, | |||
outputsEpochRootHash: v.noticesEpochRootHash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the off-chain component is ready, we should update this and encoding and the helper library LibServerManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, many lines in this PR are mere artifacts that let us test the new output validation scheme using the old machine.
Closes #42