Replace self.caller
with self.signer
in fee_public
#2397
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR updates the use of
self.caller
incredits.aleo/fee_public
withself.signer
. The intention is to enforce that fees must be paid by the signer for safety and clarity.Programs that import
credits.aleo
are already unable to callfee_public
in an internal function because of this enforcement - https://github.com/AleoHQ/snarkVM/blob/eefd27d8637c78925f25bdb5878e67a9e2addeeb/synthesizer/process/src/trace/mod.rs#L159This means that
self.caller
andself.signer
must already be equivalent in fee executions, however the change is to make the intention forcredits.aleo/fee_public
logic extra clear.Test Plan
A test has been added to check that calls to
fee_public
andfee_private
from external programs are invalid.Notes
A new genesis block must be generated because keys for
fee_public
have been updated.