-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fixed private log size (#9585)
### Description This PR will limit the private logs to have at most 8 fields. - For notes: 1 for storage slot, 1 for note type id, and 6 for custom fields. - For events: 1 for storage slot, 1 for event type id, 1 for address tag, and 5 for custom fields. This is to make it more difficult to figure out what a tx is about when all the logs are the same length. In the current codebase, the max number of custom fields is 4 for note, and 5 for event. We can adjust the limit to allow more custom fields if necessary. ### The implementation - Make all private logs (logs emitted from private: encrypted note logs and encrypted logs) the same size by extending the incoming cipher text to a fixed length: - [1 byte for the actual plaintext length][the actual plaintext][random bytes] - The length of the extended cipher text for event log is 1 field less, because we will append the address tag to it, which will then make it the same length as note log. - Remove the first byte of private logs, which used to indicate the number of public values. It was always 0 for private logs because only public logs (unencrypted logs) have public values. Note: the gate counts increases significantly because we are hashing more data. This is just temporary. We will stop hashing logs soon and propagate them to the databus. --------- Co-authored-by: sirasistant <[email protected]>
- Loading branch information
1 parent
0435d00
commit 755c70a
Showing
12 changed files
with
291 additions
and
101 deletions.
There are no files selected for viewing
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
Oops, something went wrong.