-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: gets rid of unencrypted emit in private_context (#7236)
This pr took a stab at something we had discussed related to #7161: - remove the unencrypted emit functions from the private context - have the logic reside in the contracts that need it - `contract_instance_deployer` - `contract_class_registerer` Since having unencrypted emits easily available in the private context is a huge footgun privacy-wise, we decided that it would be better to get rid of it there. However, as we still needed it for the deployer (as we need something to deploy the "first" public code), we left the public inputs and just insert directly into those instead of using a neat function. The setup is still slightly different from what we are doing in private, because it is dealing with `event_type_id` slightly odd, and doing a lot of inefficient things. So it needs to be revisited at some point for optimisations. When the event macros are refined to also handle structs with non-field elements we should be able to use a `to_be_bytes` value from in there to more cleanly emit the event, and also update the "listener" such that we could get rid of the current `DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE` and instead be looking at just the `event_type_id` and the contract address to match it.
- Loading branch information
Showing
11 changed files
with
94 additions
and
199 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
1 change: 0 additions & 1 deletion
1
noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/events.nr
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
...r-contracts/contracts/contract_instance_deployer_contract/src/events/instance_deployed.nr
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -97,4 +97,4 @@ | |
] | ||
] | ||
} | ||
} | ||
} |
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.