You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should propagate errors as structs with a type and error code, and only set the error into the task info context once to avoid error overwrite errors and clean up code.
This would look like returning a struct that looks like this:
struct __attribute__((packed)) fd_exec_result {
/* kind and err matching agave */
uchar kind;
schar err;
/* custom err is a u32 in agave */
uint custom_err;
};
typedef struct fd_exec_result fd_exec_result_t;
For VM errors, the proposed returned error struct would look like this:
struct fd_vm_result {
fd_exec_result_t exec_res;
int err; // this can be a schar to save space
};
typedef struct fd_vm_result fd_vm_result_t;
We should propagate errors as structs with a type and error code, and only set the error into the task info context once to avoid error overwrite errors and clean up code.
This would look like returning a struct that looks like this:
For VM errors, the proposed returned error struct would look like this:
Open to other suggestions as well! The motivation for this proposal is to remove the need for the developer to remember to set error details via macros like https://github.com/firedancer-io/firedancer/blob/main/src/flamenco/runtime/context/fd_exec_txn_ctx.h#L169. Using these macros before returning can be easily forgotten or accidentally called more than once up the call stack (when returning errors).
Example of forgotten
ERR_FOR_LOG
: #4025Example of overwritten error: https://github.com/firedancer-io/firedancer/pull/4069/files#diff-7068ff1660560ece7e7d6a7c6848146e115fc8ad40dd3addaab552703d70b15eR414
The text was updated successfully, but these errors were encountered: