-
Notifications
You must be signed in to change notification settings - Fork 152
Integrate summaries of opcode automatically into the evm semantics #2710
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
Closed
Closed
Changes from all commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
ce37bb1
provide `KEVMSummarizer` to sammarize rules for all the instruction r…
Stevengre e159c31
solve error call for legacy_explore and incorrect name for `#next[_]`
Stevengre a8a5c1c
kevm-pyk/: get code passing basic type checking issues
ehildenb 6942dce
qupdate poetry to 2.0.0
Stevengre 2bbdc04
add new command `summarize` for summarizing evm instructions
Stevengre 10d9534
don't use `summarize` but `kevm summarize` instead.
Stevengre c207fc2
provide spec with initial and target node that are not terminal accor…
Stevengre 4127ce0
make format & make check
Stevengre ae80f65
print nodes and add summarize function to generate optimized rules fo…
Stevengre 4ddfc0a
make format & make check
Stevengre c28a58e
add ignore
Stevengre 1652b8f
allow_symbolic_program
Stevengre ad173a1
summarize instructions one by one
Stevengre 73d8d88
summarize `STOP`
Stevengre f464d37
solve the unhook problem during summarizing `ADD`.
Stevengre 7b3f603
summarize all the evm opcode using `KEVMSummarizer.batch_summarize`. …
Stevengre e6bc0bd
fix the summarization for `STOP`.
Stevengre 29a85a7
update the status of `STOP`.
Stevengre 9f1dee6
don't use optimizations during summarization
Stevengre 18592a1
summarize `ADD` successfully with new simplification rules, wrapper r…
Stevengre 383a465
summarized `MUL`
Stevengre c3c4aab
summarized `SUB`
Stevengre 8da7bc6
summarized `DIV`
Stevengre 5ea9aac
summarized `SDIV`
Stevengre 52f2b9d
summarized `MOD`
Stevengre a3c74fe
summarized `SMOD`
Stevengre 230bd0c
summarized `ADDMOD`.
Stevengre 7a6c76d
summarized `MULMOD`
Stevengre dd17c40
try to summarize all the opcode, under checking.
Stevengre acc99e1
check all the finished summarization.
Stevengre 87255c8
update the summarization result
Stevengre 44fb07b
update the summarization statuses.
Stevengre e3c5441
fix the summarization of `EXP`
Stevengre 31645d1
fix the summarization of `ADDRESS`
Stevengre 7e06e1a
fix summarization of
Stevengre 93cc17c
fixed the summarization of `ORIGIN` and `EXTCODECOPY`
Stevengre 818513a
fix summarization of `CALLER`
Stevengre 33272d5
fix summarization of `EXTCODESIZE`
Stevengre 2b55524
fix the summarization of `RETURNDATASIZE`
Stevengre e4468a0
fix the summarization of `MLOAD`
Stevengre 73737ca
fix summarization of `MLOAD`
Stevengre c7577a2
fix the summarization of `MSTORE8`
Stevengre 4fd23b3
fix the summarization of
Stevengre 0493f03
fix the summarization of `JUMPI`
Stevengre 52612df
fix the summarization of `PUSH`
Stevengre 1df22a2
fix the summarization of `LOG`.
Stevengre 00213c2
backup all the useful informations in the PR before preparing the merge
Stevengre 84fba32
delete the logs
Stevengre 341be7a
delete all the proof and summary files
Stevengre 50edba8
ignore the proofs and summaries.
Stevengre 96c0b6c
back up to keep my thinking of debuging
Stevengre d35b118
finish the test process on `STOP`
Stevengre a8eac0f
simlify the implementation
Stevengre b5e222b
comment rule generation validation for faster check
Stevengre 8220e6e
fix make format & check
Stevengre b80e2aa
poetry lock 2.0.1
Stevengre e689d84
delete analysis codes in `exec_summarize`
Stevengre 2e00b4e
make format
Stevengre 98aea06
recover the definition and create a new target for summarization
Stevengre e5e2c18
delete useless lemma comments.
Stevengre 748dc22
test all the passed opcodes
Stevengre da1e883
fix poetry.lock
Stevengre 4531b4e
update summarization results using nohup.out
Stevengre c782b46
simplify the implementation & fix the summarization for BALANCE
Stevengre 8cb972d
try to fix all `ACCOUNT_QUERIES_OPCODES` but failed. fix `SELFBALANCE…
Stevengre ee6ffac
make format & make check
Stevengre e86ecbf
delete log file
Stevengre 7060652
poetry update
Stevengre c86953d
keep edsl unchanged
Stevengre 1e0d8dd
Revert submodule ethereum-tests to c30599
Stevengre 0d50efa
more detailed help info for `summarize` command.
Stevengre 2f18b1c
reduce duplification for semantics
Stevengre 354fd65
delete unecessary import
Stevengre a4bf14d
Apply suggestions from code review
Stevengre 33ffb21
upstream word_stack function to KEVM
Stevengre 88d9963
provide detailed comments for `exec_summarize`
Stevengre 4e43eb2
Consolidate EDSL-SUM module into edsl.md
Stevengre 415fbc0
Remove unnecessary serialization import from EVM module
Stevengre 3c3a577
Rename word_stack method to wordstack in KEVM class
Stevengre 6921f11
Add frozendict for immutable dictionary types in summarizer
Stevengre 1879dee
Remove commented-out 'ALL' key from OPCODES_SUMMARY_STATUS
Stevengre 5ae4347
Enhance accounts_cell function documentation
Stevengre 4ec7728
Prepare build_stack_underflow_spec method for implementation
Stevengre b177372
Improve documentation for build_spec method in KEVMSummarizer
Stevengre 79dd5bc
Simplify default argument handling in build_spec method
Stevengre cf16c4f
Refactor KEVM and summarizer methods to use static helper methods
Stevengre 809acc1
Remove trailing whitespace in KEVM and summarizer modules
Stevengre 4043fd0
Update test-summarize workflow and opcode summary statuses
Stevengre f7423ee
Update Poetry lock file dependencies and version constraints
Stevengre 9f959fe
Update test-pr workflow to initialize specific submodules
Stevengre c3f6bcf
delete simplification rule
Stevengre ac42262
Add summarization simplification lemmas and update imports
Stevengre ce3235f
Remove test-summarize job from GitHub Actions workflow
Stevengre d2b700e
Add Summarization test suite to GitHub Actions workflow
Stevengre 963c022
Increase Summarization test suite timeout to 720 seconds
Stevengre 8e8f923
Adjust Summarization test suite configuration
Stevengre 827e8d0
Increase Summarization test suite timeout to 240 seconds
Stevengre cb2894b
Increase Summarization test suite timeout to 360 seconds
Stevengre fcfc7da
use `summaries` to keep all the opcode summaries
Stevengre 4dad743
Enhance summarize command with opcode-specific and clear options
Stevengre afe412b
Remove the KCFG.
Stevengre f4d9e1c
Modify summary file generation to include EVM imports and requires
Stevengre 862f31e
Refactor summary generation and module structure
Stevengre 9abc550
Modify batch summarization to process passed opcodes instead of unpassed
Stevengre 9e2a1ac
Add comprehensive EVM opcode summary imports to summary.k
Stevengre 56a7922
Refactor summary file generation to simplify and clean up specifications
Stevengre 0ae7674
new way to remove inf gas
Stevengre 55671b6
remove_dash_from_var
Stevengre 101845a
Simplify summary specification files by removing unnecessary account …
Stevengre 572d4fe
Generate summary specification files for multiple EVM opcodes
Stevengre 3fdefd2
Enhance summary specification file generation for balance opcode
Stevengre 66e57e3
Refine summarizer and workflow configuration
Stevengre 754f84d
Update poetry.lock with platform-specific dependency constraints
Stevengre c77f67e
Update poetry.lock with Hypothesis and setuptools version bumps
Stevengre 7b51cf4
bring back the modification in the master branch
Stevengre a9c71c2
Simplify summary-balance account ID regex transformation
Stevengre 8b0697b
Add new target options for KEVM CLI summary targets
Stevengre 65d78f6
Improve CLI target argument formatting
Stevengre e5c4c77
update expected file with new module name
Stevengre 88d3441
provide a basic way to verify the summaries
Stevengre 97c23cd
change the `require` to pass the verification
Stevengre 2cfbbf0
try to add gas gaurd automatically
Stevengre 53de37f
try to provide gas guard automatically
Stevengre f59cbec
solved out of gas problem for most opcode summaries
Stevengre 9a59d44
fix summaries for the summaries of opcode like return
Stevengre 9033bda
`make test-prove-summaries` passed
Stevengre 3423f02
[to delete] add concrete execution result for both normal semantics a…
Stevengre 6fbcbe0
Update test timeout and dependencies in poetry.lock
Stevengre 0c9b396
Remove references to 'summary-exp-2-spec.k' and 'SUMMARY-EXP-2-SPEC' …
Stevengre 8a64faf
[to delete] update the concrete execution result of the summary rules.
Stevengre 3f38455
Update interpreter error handling and restore summary-exp-2-spec refe…
Stevengre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
/dist/ | ||
__pycache__/ | ||
.coverage | ||
proofs/ | ||
summaries/ | ||
proofs/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
74 changes: 74 additions & 0 deletions
74
kevm-pyk/src/kevm_pyk/kproj/evm-semantics/summaries/summary-add-2-spec.k
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
requires "../evm.md" | ||
requires "../buf.md" | ||
|
||
module SUMMARY-ADD-2-SPEC | ||
imports EVM | ||
imports BUF | ||
|
||
|
||
rule [BASIC-BLOCK-21-TO-20]: <kevm> | ||
<k> | ||
( #next [ ADD ] ~> .K => .K ) | ||
~> K_CELL:K | ||
</k> | ||
<schedule> | ||
SCHEDULE_CELL:Schedule | ||
</schedule> | ||
<useGas> | ||
( USEGAS_CELL:Bool => true ) | ||
</useGas> | ||
<ethereum> | ||
<evm> | ||
<callState> | ||
<wordStack> | ||
( ( W0:Int => chop ( ( W0:Int +Int W1:Int ) ) ) : ( ( W1:Int : WS:WordStack ) => WS:WordStack ) ) | ||
</wordStack> | ||
<pc> | ||
( PC_CELL:Int => ( PC_CELL:Int +Int 1 ) ) | ||
</pc> | ||
<gas> | ||
( ( GAS_CELL:Int => ( GAS_CELL:Int -Int Gverylow < SCHEDULE_CELL:Schedule > ) ) ) | ||
</gas> | ||
... | ||
</callState> | ||
... | ||
</evm> | ||
... | ||
</ethereum> | ||
... | ||
</kevm> | ||
requires USEGAS_CELL:Bool andBool ( ( ( Gverylow < SCHEDULE_CELL:Schedule > ) ) ) <=Int GAS_CELL | ||
[priority(20), label(BASIC-BLOCK-21-TO-20)] | ||
|
||
rule [BASIC-BLOCK-22-TO-15]: <kevm> | ||
<k> | ||
( #next [ ADD ] ~> .K => .K ) | ||
~> K_CELL:K | ||
</k> | ||
<useGas> | ||
( USEGAS_CELL:Bool => false ) | ||
</useGas> | ||
<ethereum> | ||
<evm> | ||
<callState> | ||
<wordStack> | ||
( ( W0:Int => chop ( ( W0:Int +Int W1:Int ) ) ) : ( ( W1:Int : WS:WordStack ) => WS:WordStack ) ) | ||
</wordStack> | ||
<pc> | ||
( PC_CELL:Int => ( PC_CELL:Int +Int 1 ) ) | ||
</pc> | ||
<gas> | ||
( GAS_CELL:Int ) | ||
</gas> | ||
... | ||
</callState> | ||
... | ||
</evm> | ||
... | ||
</ethereum> | ||
... | ||
</kevm> | ||
requires ( notBool USEGAS_CELL:Bool ) | ||
[priority(20), label(BASIC-BLOCK-22-TO-15)] | ||
|
||
endmodule |
Oops, something went wrong.
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.
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.
What's the difference between these two modules?
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.
SUMMARY
is to use the summary rules.SUMMARIZE
is used to generate the summary rules.