Skip to content
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

Optimize schedule.md #2349

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0cc04bc
delete DEFAULT schedule
Mar 8, 2024
11699ef
remove references to DEFAULT schedule
Mar 8, 2024
d233dfa
replace equality with FRONTIER with a Ghasdelegatecall operator
Mar 12, 2024
4ce121a
create ScheduleTuple type
Mar 12, 2024
aaed371
make previous schedule operators private
Mar 12, 2024
0206477
add scheduleTuple cell
Mar 12, 2024
8c2338c
update scheduleTuple cell
Mar 12, 2024
223b24c
modify functions to pass ScheduleTuple instead of Schedule
Mar 12, 2024
c26f5ad
look up scheduleTuple cell instead of scheduleCell in most places
Mar 12, 2024
3e10d08
call getters instead of schedule lookup function most places
Mar 12, 2024
d3ebb1c
update rules in driver.md that require both ScheduleTuple and Schedule
Mar 12, 2024
c0951e5
update output files
Mar 13, 2024
5de20e8
update claims
Mar 13, 2024
c4e2dba
fix lemmas.k
Mar 13, 2024
df70ba6
update mcd specs
Mar 19, 2024
fa55f1d
update kontrol specs
Mar 15, 2024
5359c7a
try increased verbosity
Mar 19, 2024
118cc21
fix bug in expected outputs
Mar 19, 2024
dccfaf3
update some more k files with new schedule functions
Mar 20, 2024
4a11255
fix specs that reference Csstore
Mar 26, 2024
2ac239f
fix sed error
Mar 27, 2024
8a8abb1
change Schedule to ScheduleTuple in more tests
Mar 27, 2024
27a732b
fix another set of claims
Mar 27, 2024
0a386d1
fix more specs
Mar 27, 2024
2790eff
fix another spec
Mar 27, 2024
d290879
Set Version: 1.0.512
Mar 27, 2024
684d271
Update kevm-pyk/src/kevm_pyk/kproj/evm-semantics/schedule.md
Mar 28, 2024
0923406
Set Version: 1.0.513
Mar 28, 2024
ef257a5
Merge branch 'master' into schedule3
Mar 28, 2024
5e509f0
Set Version: 1.0.514
Mar 28, 2024
d3b133c
Merge branch 'master' into schedule3
Apr 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: 'Build targets'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'CXX=clang++-14 poetry -C kevm-pyk run kdist --verbose build -j`nproc` evm-semantics.haskell evm-semantics.kllvm evm-semantics.kllvm-runtime'
- name: 'Test integration'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-integration'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-integration PYTEST_ARGS+=-vv'
- name: 'Test conformance'
run: docker exec -u github-user kevm-ci-concrete-${{ github.sha }} /bin/bash -c 'make test-conformance'
- name: 'Test llvm krun'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ KEEP_OUTPUTS := false
CHECK := git --no-pager diff --no-index --ignore-all-space -R

tests/ethereum-tests/LegacyTests/Constantinople/VMTests/%: KEVM_MODE = VMTESTS
tests/ethereum-tests/LegacyTests/Constantinople/VMTests/%: KEVM_SCHEDULE = DEFAULT
tests/ethereum-tests/LegacyTests/Constantinople/VMTests/%: KEVM_SCHEDULE = HOMESTEAD

tests/%.run-interactive: tests/%
$(POETRY_RUN) kevm-pyk run $< $(KEVM_OPTS) $(KRUN_OPTS) --target $(TEST_CONCRETE_BACKEND) \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ You can call `kevm-pyk --help` to get a quick summary of how to use the script.
Run the file `tests/ethereum-tests/LegacyTests/Constantinople/VMTests/vmArithmeticTest/add0.json`:

```sh
poetry -C kevm-pyk run kevm-pyk run tests/ethereum-tests/LegacyTests/Constantinople/VMTests/vmArithmeticTest/add0.json --schedule DEFAULT --mode VMTESTS
poetry -C kevm-pyk run kevm-pyk run tests/ethereum-tests/LegacyTests/Constantinople/VMTests/vmArithmeticTest/add0.json --schedule HOMESTEAD --mode VMTESTS
```

To enable the debug symbols for the llvm backend, build using this command:
Expand Down
2 changes: 1 addition & 1 deletion kevm-pyk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kevm-pyk"
version = "1.0.521"
version = "1.0.522"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion kevm-pyk/src/kevm_pyk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from typing import Final


VERSION: Final = '1.0.521'
VERSION: Final = '1.0.522'
1 change: 0 additions & 1 deletion kevm-pyk/src/kevm_pyk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ def kprove_legacy_args(self) -> ArgumentParser:
@cached_property
def evm_chain_args(self) -> ArgumentParser:
schedules = (
'DEFAULT',
'FRONTIER',
'HOMESTEAD',
'TANGERINE_WHISTLE',
Expand Down
34 changes: 18 additions & 16 deletions kevm-pyk/src/kevm_pyk/kproj/evm-semantics/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
syntax EthereumCommand ::= loadTx ( Account ) [klabel(loadTx)]
// --------------------------------------------------------------
rule <k> loadTx(_) => #end EVMC_OUT_OF_GAS ... </k>
<schedule> SCHED </schedule>
<scheduleTuple> SCHED </scheduleTuple>
<txPending> ListItem(TXID:Int) ... </txPending>
<message>
<msgID> TXID </msgID>
Expand All @@ -101,8 +101,9 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
...
</k>
<schedule> SCHED </schedule>
<scheduleTuple> SCHEDT </scheduleTuple>
<gasPrice> _ => #effectiveGasPrice(TXID) </gasPrice>
<callGas> _ => GLIMIT -Int G0(SCHED, CODE, true) </callGas>
<callGas> _ => GLIMIT -Int G0(SCHEDT, CODE, true) </callGas>
<origin> _ => ACCTFROM </origin>
<callDepth> _ => -1 </callDepth>
<txPending> ListItem(TXID:Int) ... </txPending>
Expand All @@ -122,9 +123,9 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
<nonce> NONCE </nonce>
...
</account>
<accessedAccounts> _ => #if Ghaswarmcoinbase << SCHED >> #then SetItem(MINER) #else .Set #fi </accessedAccounts>
<accessedAccounts> _ => #if Ghaswarmcoinbase(SCHEDT) #then SetItem(MINER) #else .Set #fi </accessedAccounts>
anvacaru marked this conversation as resolved.
Show resolved Hide resolved
<touchedAccounts> _ => SetItem(MINER) </touchedAccounts>
requires #hasValidInitCode(lengthBytes(CODE), SCHED)
requires #hasValidInitCode(lengthBytes(CODE), SCHEDT)

rule <k> loadTx(ACCTFROM)
=> #accessAccounts ACCTFROM ACCTTO #precompiledAccountsSet(SCHED)
Expand All @@ -134,8 +135,9 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
...
</k>
<schedule> SCHED </schedule>
<scheduleTuple> SCHEDT </scheduleTuple>
<gasPrice> _ => #effectiveGasPrice(TXID) </gasPrice>
<callGas> _ => GLIMIT -Int G0(SCHED, DATA, false) </callGas>
<callGas> _ => GLIMIT -Int G0(SCHEDT, DATA, false) </callGas>
<origin> _ => ACCTFROM </origin>
<callDepth> _ => -1 </callDepth>
<txPending> ListItem(TXID:Int) ... </txPending>
Expand All @@ -155,7 +157,7 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
<nonce> NONCE => NONCE +Int 1 </nonce>
...
</account>
<accessedAccounts> _ => #if Ghaswarmcoinbase << SCHED >> #then SetItem(MINER) #else .Set #fi </accessedAccounts>
<accessedAccounts> _ => #if Ghaswarmcoinbase(SCHEDT) #then SetItem(MINER) #else .Set #fi </accessedAccounts>
<touchedAccounts> _ => SetItem(MINER) </touchedAccounts>
requires ACCTTO =/=K .Account

Expand Down Expand Up @@ -189,32 +191,32 @@ To do so, we'll extend sort `JSON` with some EVM specific syntax, and provide a
| #loadAccessListAux ( Account , List ) [klabel(#loadAccessListAux)]
// ---------------------------------------------------------------------------------------------
rule <k> #loadAccessList ([ .JSONs ]) => .K ... </k>
<schedule> SCHED </schedule>
requires Ghasaccesslist << SCHED >>
<scheduleTuple> SCHED </scheduleTuple>
requires Ghasaccesslist(SCHED)

rule <k> #loadAccessList ([ _ ]) => .K ... </k>
<schedule> SCHED </schedule>
requires notBool Ghasaccesslist << SCHED >>
<scheduleTuple> SCHED </scheduleTuple>
requires notBool Ghasaccesslist(SCHED)

rule <k> #loadAccessList ([[ACCT, [STRG:JSONs]], REST])
=> #loadAccessListAux (#asAccount(ACCT), #parseAccessListStorageKeys([STRG]))
~> #loadAccessList ([REST])
...
</k>
<schedule> SCHED </schedule>
requires Ghasaccesslist << SCHED >>
<scheduleTuple> SCHED </scheduleTuple>
requires Ghasaccesslist(SCHED)

rule <k> #loadAccessListAux (ACCT, (ListItem(STRGK) STRGKS))
=> #accessStorage ACCT STRGK:Int
~> #loadAccessListAux (ACCT, STRGKS)
...
</k>
<schedule> SCHED </schedule>
<callGas> GLIMIT => GLIMIT -Int Gaccessliststoragekey < SCHED > </callGas>
<scheduleTuple> SCHED </scheduleTuple>
<callGas> GLIMIT => GLIMIT -Int Gaccessliststoragekey(SCHED) </callGas>

rule <k> #loadAccessListAux (ACCT, .List) => #accessAccounts ACCT ... </k>
<schedule> SCHED </schedule>
<callGas> GLIMIT => GLIMIT -Int Gaccesslistaddress < SCHED > </callGas>
<scheduleTuple> SCHED </scheduleTuple>
<callGas> GLIMIT => GLIMIT -Int Gaccesslistaddress(SCHED) </callGas>
```

- `exception` only clears from the `<k>` cell if there is an exception preceding it.
Expand Down
Loading
Loading