Full Specification
The detailed specification on the Job data structure
Job data structure
Job config
To achieve efficiency and save on gas during execution, all manipulations with the Job structure are performed in assembly inserts. The binary representation of struct Job
is as follows:
Job with calldata config
When the job is invoked with some calldata (even if it is just the selector), it is always padded with a few fields, yielding a special binary representation of the calldata as well; the structure is given below.
Here the executionCalldata
field contains the calldata proper that is forwarded to the target contract; for Selector
jobs, for instance, this field is occupied solely by the four bytes of the target method selector, for Resolver
jobs it contains the ad hoc calldata to pass to the target contract, and for the Predefined Calldata
jobs, it is absent since the fixed calldata is fetched from the job properties inside the execution call.
Config byte
The Job configuration, expanded as a nested struct in the short specification, is a single byte inside the Job structure and defines the properties of the Job. The bits are allocated consecutively in the uint8 config
. The structure of this byte is given below.
CFG_ACTIVE
Flag of a job being active (i.e., admissible for execution given satisfaction of specified logic).CFG_USE_JOB_OWNER_CREDITS
Whether to use job owner credits in native tokens for payment. This makes a hard switch from using job credits to using job owner credits and not just enables it as an option.CFG_ASSERT_RESOLVER_SELECTOR
Indicates whether to enforce the selector of a resolver job function matching between the calldata passed by the Keeper and the job binary representation. This may be desirable because under the hood, resolver jobs work likePRE_DEFINED
jobs, except the calldata is provided by the Keeper. It would therefore be possible for a malicious Keeper to supply a different selector, which is not checkable unless this flag is set toTrue
. Has no bearing on interval jobs, since for them, thecalldata
is fixed.CFG_CHECK_KEEPER_MIN_CVP_DEPOSIT
Whether to enforce conformance of the stake of keepers and slashers to the minimum required stake of the job.
Last updated