-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: public refunds via FPC (#4750)
Enable and test public refunds. Specifically, when Alice uses an FPC to pay her fees, and she *overpays* (e.g. pays 3 bananas when only 1 is required), she has a public balance transmitted to her as part of TX teardown (2 bananas in the example). In order to accomplish this, we needed to fix #4736. Thus, this PR squashes writes performed in the non-revertible phases of a TX. Further, when all phases were completed, we squash across phases when we recombine the `end` and `endNonRevertible`. This presented a problem, because on current master that "squash across phases" being performed during recombine in TS would need to be mirrored in the base rollup. Instead of doing that, this PR changes the private inputs to the base rollup circuit to accept a `CombinedAccumulatedData`, i.e. effects that have already been recombined. This affords the reduction in gates/opcodes in the base_rollup. This approach does not introduce any new trust assumptions because as mentioned in #4736, the base rollup circuit [trusts that the writes it receives are valid](#2521 (comment)).
- Loading branch information
1 parent
9633b0f
commit 30502c9
Showing
31 changed files
with
816 additions
and
386 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { Config } from 'jest'; | ||
|
||
const config: Config = { | ||
preset: 'ts-jest/presets/default-esm', | ||
moduleNameMapper: { | ||
'^(\\.{1,2}/.*)\\.[cm]?js$': '$1', | ||
}, | ||
testRegex: './src/.*\\.test\\.(js|mjs|ts)$', | ||
rootDir: './src', | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.