-
Notifications
You must be signed in to change notification settings - Fork 241
flamenco: refactor txn_ctx/instr_ctx account getters API #4606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flamenco: refactor txn_ctx/instr_ctx account getters API #4606
Conversation
a114adf
to
5b3ca09
Compare
7d588cd
to
cea7474
Compare
c7c10f6
to
f9b677f
Compare
cbe19cb
to
11274c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving some comments, happy to chat more/clarify any of these points
86a80a7
to
875c33b
Compare
|
||
if ( FD_UNLIKELY( use_sysvar_instructions ) ) { | ||
ret = fd_sysvar_instructions_update_current_instr_idx( txn_ctx, i ); | ||
if( ret != FD_ACC_MGR_SUCCESS ) { | ||
FD_LOG_WARNING(( "sysvar instructions failed to update instruction index" )); | ||
txn_ctx->instr_err_idx = i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to prevent a segfault when debugging a mismatch in test-vectors.
fd_exec_txn_ctx_get_account_modify_fee_payer( fd_exec_txn_ctx_t * ctx, | ||
fd_txn_account_t * * account ); | ||
static inline int | ||
fd_exec_txn_ctx_find_index_of_account( fd_exec_txn_ctx_t const * ctx, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we do a reverse iteration here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it's for performance reasons to compare to 0 instead of N. The slight performance edge probably is negligible, so I'm happy to change to forward iteration if it's clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great!
875c33b
to
fd24d11
Compare
fd24d11
to
7e99720
Compare
Notable changes:
try_borrow_last_program_account
in the instr_ctx to match agave semantics and account borrowing checks.