-
Notifications
You must be signed in to change notification settings - Fork 204
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: back input regions and bincode valloc with spad #3423
Conversation
c593b37
to
7b296ab
Compare
cff5656
to
763dfc8
Compare
7e4c8fc
to
23ccf0d
Compare
b187aec
to
26d622f
Compare
b1503ec
to
4715366
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.
I think mostly lgtm, I think it would be a lot better if we just stored a handle to the spad for the instr_ctx and txn_ctx instead of having to handle and pass around an spad pointer and a scratch valloc
@@ -0,0 +1,26 @@ | |||
#include "fd_runtime_spad.h" | |||
|
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 nice
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.
maybe we add this to util and just generally expose a valloc for spad? There's nothing necessarily runtime specific about this
@@ -236,11 +237,13 @@ calculate_heap_cost( ulong heap_size, ulong heap_cost, int * err ) { | |||
int | |||
fd_deploy_program( fd_exec_instr_ctx_t * instr_ctx, | |||
uchar const * programdata, | |||
ulong programdata_size ) { | |||
ulong programdata_size, | |||
fd_valloc_t valloc /* Majority of use cases this is a txn ctx spad under the hood; for native to bpf migration this is scratch backed since it's an epoch level event. */ |
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.
We also need to bound out the epoch level events too. Probably makes sense to do in a follow up PR
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.
Agreed.
@@ -25,7 +25,7 @@ struct __attribute__((aligned(8UL))) fd_exec_instr_ctx { | |||
|
|||
fd_funk_txn_t * funk_txn; | |||
fd_acc_mgr_t * acc_mgr; | |||
fd_valloc_t valloc; | |||
fd_valloc_t valloc; /* Scratch-backed valloc TODO: migrate to transaction spad */ |
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.
Can we just set the instr ctx valloc to the spad valloc
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.
Some instruction level test harnesses don't give us spads and instead give us libc malloc valloc and etc. We can do that change in a future PR? I'll update the comment to reflect that.
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.
Okay I renamed this to test_only_valloc and left a comment to make it clear.
@@ -1657,6 +1670,7 @@ fd_exec_vm_syscall_test_run( fd_exec_instr_test_runner_t * runner, | |||
if( !fd_exec_test_instr_context_create( runner, ctx, input_instr_ctx, alloc, skip_extra_checks ) ) | |||
goto error; |
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'm pretty sure we can just use spad here too (like in the valloc)
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.
Let's migrate these non critical path test harness allocations in a future PR, and keep this PR about live or replay transaction execution?
@@ -95,6 +97,170 @@ FD_STATIC_ASSERT( FD_ACCOUNT_REC_ALIGN>=FD_ACCOUNT_REC_DATA_ALIGN, account_rec_d | |||
FD_STATIC_ASSERT( (offsetof(fd_account_rec_t, meta)%FD_ACCOUNT_META_ALIGN)==0, account_rec_meta_offset ); | |||
FD_STATIC_ASSERT( (offsetof(fd_account_rec_t, data)%FD_ACCOUNT_REC_DATA_ALIGN)==0, account_rec_data_offset ); | |||
|
|||
#define MAX_PERMITTED_DATA_INCREASE (10240UL) // 10KB |
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.
🐐
56c9397
to
db82bbb
Compare
31496cf
to
2a82177
Compare
2a24732
to
55217cf
Compare
Also back miscellaneous single transaction execution scoped allocations with spad. The valloc handle in txn_ctx and instr_ctx are gone.
55217cf
to
594a1ce
Compare
No description provided.