#3443 enforces that an asset callback returns the same asset value it received. Once that change is merged, PROCESSED_ASSET_VALUE carries no information: callback implementers must return the input value, and the kernel must save and compare the two values.
Remove the asset-value return from both callback interfaces. The kernel should retain the original asset value and continue using it after the callback. Asset callbacks would then validate the operation without being able to replace its value.
This requires updating:
on_before_asset_added_to_account and on_before_asset_added_to_note
- the kernel callback helper and its callers
- the standard
invoke_send_policy and invoke_receive_policy procedures
- transfer-policy interfaces that return the value only for the callback
- callback tests, documentation, and the changelog
The callback-boundary equality assertion and its dedicated error can then be removed because callbacks will no longer return a replacement value.
If value-transforming callbacks are needed later, they should use a separate interface with explicit safety rules rather than changing the policy callback contract.
#3443 enforces that an asset callback returns the same asset value it received. Once that change is merged,
PROCESSED_ASSET_VALUEcarries no information: callback implementers must return the input value, and the kernel must save and compare the two values.Remove the asset-value return from both callback interfaces. The kernel should retain the original asset value and continue using it after the callback. Asset callbacks would then validate the operation without being able to replace its value.
This requires updating:
on_before_asset_added_to_accountandon_before_asset_added_to_noteinvoke_send_policyandinvoke_receive_policyproceduresThe callback-boundary equality assertion and its dedicated error can then be removed because callbacks will no longer return a replacement value.
If value-transforming callbacks are needed later, they should use a separate interface with explicit safety rules rather than changing the policy callback contract.