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.
This pr took a stab at something we had discussed related to #7161:
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 ato_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 currentDEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE
and instead be looking at just theevent_type_id
and the contract address to match it.