A validator is called prior to transaction's start (not to mention completion). But yet a validator routinely checks if a potential recipient has already received his funds, and other such tests about events in the past.

So is the validator pretending that the transaction has already completed, whereas in truth the transaction has not yet started -- and perhaps never will?


Yes, a validator is called prior to the start of the transaction as it part of the constraints that determines if the transaction can proceed. A validator that executes on-chain has no visibility of past transactions. It can only see the transaction it belongs to, its inputs and input data supplied to the validator.
It is the off-chain code that constructs the transaction that has visibility of the full blockchain of past transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.