-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: Introduce max_cycles_limit
of a Godwoken block
#767
Merged
jjyr
merged 23 commits into
godwokenrises:develop
from
zeroqn:feat-mem-pool-max-block-cycles-limit
Jul 28, 2022
Merged
feat: Introduce max_cycles_limit
of a Godwoken block
#767
jjyr
merged 23 commits into
godwokenrises:develop
from
zeroqn:feat-mem-pool-max-block-cycles-limit
Jul 28, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This comment was marked as outdated.
This comment was marked as outdated.
zeroqn
force-pushed
the
feat-mem-pool-max-block-cycles-limit
branch
from
July 19, 2022 13:07
e698660
to
ba61a5e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
zeroqn
force-pushed
the
feat-mem-pool-max-block-cycles-limit
branch
from
July 20, 2022 08:09
ba61a5e
to
433399d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
zeroqn
force-pushed
the
feat-mem-pool-max-block-cycles-limit
branch
from
July 20, 2022 13:55
433399d
to
157a62b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Flouse
requested review from
magicalne and
blckngm
and removed request for
blckngm
July 21, 2022 06:15
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
blckngm
reviewed
Jul 22, 2022
This comment was marked as outdated.
This comment was marked as outdated.
jjyr
requested changes
Jul 22, 2022
Flouse
changed the title
feat: max block cycles limit
feat: Introduce Jul 25, 2022
max_cycles_limit
of a Godwoken block
Rename to TransactionError::BlockCyclesLimitReached
Use log::info instead
replace by cycles.execution
rename BlockCyclesLimitReached to InsufficientPoolCycles remove CyclesPool::none, use None instead rename check_sub_cycles to consume_cycles
Execution cycles < block max cycles Execution cycles < L2TX_MAX_CYCLES Execution + virtual cycles > block max cycles
zeroqn
force-pushed
the
feat-mem-pool-max-block-cycles-limit
branch
from
July 27, 2022 01:52
1ab088b
to
fade15e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Withdrawal request is pushed to mem pool immediately https://github.com/nervosnetwork/godwoken/runs/7533962286?check_suite_focus=true#step:9:741 In this case, we should produce new block with withdrawal request to update state.
This comment was marked as outdated.
This comment was marked as outdated.
jjyr
previously approved these changes
Jul 27, 2022
This comment was marked as outdated.
This comment was marked as outdated.
Running integration testWorkflow Run Id: 2746091149 Components:
Manually running integration testPost a comment contains
Note:
Run Resultsuccess |
blckngm
approved these changes
Jul 28, 2022
jjyr
approved these changes
Jul 28, 2022
This was referenced Aug 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pr adds a new cycles limit
max_cycles_limit
to mem block. If mem pool's available cycles is not enough, transactions will be packaged in next block. If a transaction's cycles exceededmax_cycles_limit
, it will be discarded.Motivation
A dynamic configurable way to manage number of block transaction.
Specification
Split transaction's cycles into two parts:
execution cycles
andvirtual cycles
. Only syscalls listed inSyscallCyclesConfig
contribute to transaction'svirtual cycles
.SyscallCyclesConfig
Different between
L2TX_MAX_CYCLES
and blockmax_cycles_limit
Implementation
max_cycles_limit
andsyscall_cycles: SyscallCyclesConfig
toMemBlockConfig
TransactionError::ExceededMaxBlockCycles
andTransactionError::InsufficientPoolCycles
max_cycles_limit
max_cycles_limit
TransactionError::ExceededMaxBlockCycles
forgw_execute_l2transacton
andgw_execute_raw_l2transaction