-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Feature: Explicitly limit TransactionContext::instruction_trace_capacity
#27938
Feature: Explicitly limit TransactionContext::instruction_trace_capacity
#27938
Conversation
TransactionContext::instruction_trace_capacity
7de1137
to
68bf5b2
Compare
68bf5b2
to
0582d68
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.
LGTM, but I think we should add a test for when the max is exceeded?
Also, some downstream-project programs are failing since they hit the maximum, which is a hint that maybe it should be higher? |
0582d68
to
ddff44a
Compare
@alessandrod I fixed the tests in downstream-project and added a test for the new error. |
Problem
At the moment the total number of instructions (including CPI) in a transaction is only implicitly limited by the compute budget. The reason for the limit is so that we can calculate an upper bound on the memory that the program-runtime will require for execution, before hand during TX batch loading. This enables us to remove multi-threaded memory management which is the next constraint on parallelism after direct mapping is enabled.
Summary of Changes
instruction_context_capacity
=>instruction_stack_capacity
.number_of_instructions_at_transaction_level
byinstruction_trace_capacity
.InstructionError::MaxInstructionTraceLengthExceeded
.ComputeBudget::max_instruction_trace_length
which is set to 64.test_max_instruction_trace_length()
.TransactionContext::new()
parameter.limit_max_instruction_trace_length
.Feature Gate Issue: #27939
Number of transactions of a given
instruction_trace_length
recorded on MNB