Skip to content

Commit

Permalink
Update dependency: deps/kevm_release (#596)
Browse files Browse the repository at this point in the history
* deps/kevm_release: Set Version 1.0.581

* Set Version: 0.1.297

* Sync Poetry files: kevm-pyk version 1.0.581

* flake.{nix,lock}: update Nix derivations

* deps/kevm_release: Set Version 1.0.582

* Set Version: 0.1.298

* Sync Poetry files: kevm-pyk version 1.0.582

* deps/k_release: sync release file version 7.0.105

* flake.{nix,lock}: update Nix derivations

* deps/kevm_release: Set Version 1.0.583

* Sync Poetry files: kevm-pyk version 1.0.583

* deps/k_release: sync release file version 7.0.106

* flake.{nix,lock}: update Nix derivations

* deps/kevm_release: Set Version 1.0.585

* Set Version: 0.1.299

* Sync Poetry files: kevm-pyk version 1.0.585

* flake.{nix,lock}: update Nix derivations

* deps/kevm_release: Set Version 1.0.586

* Sync Poetry files: kevm-pyk version 1.0.586

* flake.{nix,lock}: update Nix derivations

* deps/kevm_release: Set Version 1.0.587

* Sync Poetry files: kevm-pyk version 1.0.587

* flake.{nix,lock}: update Nix derivations

* from #594: compute jumpdests using the Python custom_step

* update expected output

* from #573: add integration test for symbolic constructor

* test_foundry_prove.py: update label in unit test

* Sync Poetry files: kevm-pyk version 1.0.587

* deps/kevm_release: Set Version 1.0.588

* Sync Poetry files: kevm-pyk version 1.0.588

* deps/k_release: sync release file version 7.0.111

* flake.{nix,lock}: update Nix derivations

* Update kompile expected output

* Set Version: 0.1.300

* Fix local reordering issue in kompile output update

* -m test_identity: update cse expected output

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Andrei <[email protected]>
Co-authored-by: palinatolmach <[email protected]>
  • Loading branch information
4 people authored Jun 5, 2024
1 parent 8cd6e5c commit 0b1e629
Show file tree
Hide file tree
Showing 37 changed files with 10,095 additions and 1,647 deletions.
2 changes: 1 addition & 1 deletion deps/k_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.104
7.0.111
2 changes: 1 addition & 1 deletion deps/kevm_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.580
1.0.588
46 changes: 23 additions & 23 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Kontrol";

inputs = {
kevm.url = "github:runtimeverification/evm-semantics/v1.0.580";
kevm.url = "github:runtimeverification/evm-semantics/v1.0.588";
nixpkgs.follows = "kevm/nixpkgs";
nixpkgs-pyk.follows = "kevm/nixpkgs-pyk";
k-framework.follows = "kevm/k-framework";
Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.299
0.1.300
30 changes: 15 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kontrol"
version = "0.1.299"
version = "0.1.300"
description = "Foundry integration for KEVM"
authors = [
"Runtime Verification, Inc. <[email protected]>",
]

[tool.poetry.dependencies]
python = "^3.10"
kevm-pyk = { git = "https://github.com/runtimeverification/evm-semantics.git", tag = "v1.0.580", subdirectory = "kevm-pyk" }
kevm-pyk = { git = "https://github.com/runtimeverification/evm-semantics.git", tag = "v1.0.588", subdirectory = "kevm-pyk" }

[tool.poetry.group.dev.dependencies]
autoflake = "*"
Expand Down
2 changes: 1 addition & 1 deletion src/kontrol/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
if TYPE_CHECKING:
from typing import Final

VERSION: Final = '0.1.299'
VERSION: Final = '0.1.300'
23 changes: 12 additions & 11 deletions src/kontrol/prove.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from subprocess import CalledProcessError
from typing import TYPE_CHECKING, Any, ContextManager, NamedTuple

from kevm_pyk.kevm import KEVM, KEVMSemantics
from kevm_pyk.kevm import KEVM, KEVMSemantics, _process_jumpdests
from kevm_pyk.utils import KDefinition__expand_macros, abstract_cell_vars, run_prover
from pathos.pools import ProcessPool # type: ignore
from pyk.cterm import CTerm, CTermSymbolic
Expand All @@ -16,7 +16,7 @@
from pyk.kcfg import KCFG, KCFGExplore
from pyk.kore.rpc import KoreClient, TransportType, kore_server
from pyk.prelude.bytes import bytesToken
from pyk.prelude.collections import list_empty, map_empty, map_of, set_empty
from pyk.prelude.collections import list_empty, map_empty, map_of, set_empty, set_of
from pyk.prelude.k import GENERATED_TOP_CELL
from pyk.prelude.kbool import FALSE, TRUE, notBool
from pyk.prelude.kint import intToken
Expand Down Expand Up @@ -556,9 +556,9 @@ def _method_to_cfg(
calldata = None
callvalue = None

contract_code = KEVM.bin_runtime(KApply(f'contract_{contract.name_with_path}'))
contract_code = bytes.fromhex(contract.deployed_bytecode)
if isinstance(method, Contract.Constructor):
program = KEVM.init_bytecode(KApply(f'contract_{contract.name_with_path}'))
program = bytes.fromhex(contract.bytecode)
callvalue = method.callvalue_cell

elif isinstance(method, Contract.Method):
Expand All @@ -569,7 +569,7 @@ def _method_to_cfg(
init_cterm = _init_cterm(
empty_config,
program=program,
contract_code=contract_code,
contract_code=bytesToken(contract_code),
use_gas=use_gas,
deployment_state_entries=deployment_state_entries,
calldata=calldata,
Expand Down Expand Up @@ -609,7 +609,7 @@ def _method_to_cfg(
)

for final_node in final_states:
new_init_cterm = _update_cterm_from_node(init_cterm, final_node, contract.name_with_path, config_type)
new_init_cterm = _update_cterm_from_node(init_cterm, final_node, config_type)
new_node = cfg.create_node(new_init_cterm)
if graft_setup_proof:
cfg.create_edge(final_node.id, new_node.id, depth=1)
Expand All @@ -626,7 +626,7 @@ def _method_to_cfg(

final_cterm = _final_cterm(
empty_config,
program=contract_code,
program=bytesToken(contract_code),
failing=method.is_testfail,
config_type=config_type,
is_test=method.is_test,
Expand All @@ -637,7 +637,7 @@ def _method_to_cfg(
return cfg, new_node_ids, init_node_id, target_node.id


def _update_cterm_from_node(cterm: CTerm, node: KCFG.Node, contract_name: str, config_type: ConfigType) -> CTerm:
def _update_cterm_from_node(cterm: CTerm, node: KCFG.Node, config_type: ConfigType) -> CTerm:
new_accounts_cell = node.cterm.cell('ACCOUNTS_CELL')
number_cell = node.cterm.cell('NUMBER_CELL')
timestamp_cell = node.cterm.cell('TIMESTAMP_CELL')
Expand Down Expand Up @@ -760,7 +760,7 @@ def _init_account(address: int) -> None:

def _init_cterm(
empty_config: KInner,
program: KInner,
program: bytes,
contract_code: KInner,
use_gas: bool,
config_type: ConfigType,
Expand All @@ -777,13 +777,14 @@ def _init_cterm(
if not trace_options:
trace_options = TraceOptions({})

jumpdests = set_of(_process_jumpdests(bytecode=program, offset=0))
init_subst = {
'MODE_CELL': KApply('NORMAL'),
'USEGAS_CELL': TRUE if use_gas else FALSE,
'SCHEDULE_CELL': schedule,
'STATUSCODE_CELL': KVariable('STATUSCODE'),
'PROGRAM_CELL': program,
'JUMPDESTS_CELL': KEVM.compute_valid_jumpdests(program),
'PROGRAM_CELL': bytesToken(program),
'JUMPDESTS_CELL': jumpdests,
'ID_CELL': KVariable(Foundry.symbolic_contract_id(), sort=KSort('Int')),
'ORIGIN_CELL': KVariable('ORIGIN_ID', sort=KSort('Int')),
'CALLER_CELL': KVariable('CALLER_ID', sort=KSort('Int')),
Expand Down
2 changes: 1 addition & 1 deletion src/kontrol/solc_to_k.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ def method_sentences(self) -> list[KSentence]:

@property
def sentences(self) -> list[KSentence]:
return [self.subsort, self.production, self.macro_bin_runtime, self.macro_init_bytecode] + self.method_sentences
return [self.subsort, self.production] + self.method_sentences

@property
def method_by_name(self) -> dict[str, Contract.Method]:
Expand Down
2 changes: 2 additions & 0 deletions src/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ def foundry(foundry_root_dir: Path | None, tmp_path_factory: TempPathFactory, wo
str(TEST_DATA_DIR / 'lemmas.k'),
str(TEST_DATA_DIR / 'cse-lemmas.k'),
str(TEST_DATA_DIR / 'pausability-lemmas.k'),
str(TEST_DATA_DIR / 'symbolic-bytes-lemmas.k'),
],
'imports': [
'LoopsTest:SUM-TO-N-INVARIANT',
'ArithmeticCallTest:CSE-LEMMAS',
'CSETest:CSE-LEMMAS',
'PortalTest:PAUSABILITY-LEMMAS',
'ImmutableVarsTest:SYMBOLIC-BYTES-LEMMAS',
],
}
),
Expand Down
1 change: 1 addition & 0 deletions src/tests/integration/test-data/foundry-fail
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ AssertTest.test_failing_branch(uint256)
AssertTest.test_revert_branch(uint256,uint256)
AssumeTest.test_assume_false(uint256,uint256)
AssumeTest.testFail_assume_false(uint256,uint256)
ImmutableVarsTest.test_run_deployment(uint256)
1 change: 1 addition & 0 deletions src/tests/integration/test-data/foundry-prove-all
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ FreshCheatcodes.test_freshSymbolicWord()
GasTest.testInfiniteGas()
GasTest.testSetGas()
GetCodeTest.testGetCode()
ImmutableVarsTest.test_run_deployment(uint256)
LabelTest.testLabel()
LoopsTest.sum_N(uint256)
LoopsTest.testIsNotPrime(uint256)
Expand Down
1 change: 1 addition & 0 deletions src/tests/integration/test-data/foundry-prove-skip
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ FreshCheatcodes.testFail_int128()
FreshCheatcodes.test_freshUints(uint8)
GasTest.testInfiniteGas()
GetCodeTest.testGetCode()
ImmutableVarsTest.test_run_deployment(uint256)
LoopsTest.testIsNotPrime(uint256)
LoopsTest.testIsPrime(uint256,uint256)
LoopsTest.testIsPrimeBroken(uint256,uint256)
Expand Down
1 change: 1 addition & 0 deletions src/tests/integration/test-data/foundry-prove-skip-legacy
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ FreshCheatcodes.test_freshSymbolicWord()
GasTest.testInfiniteGas()
GasTest.testSetGas()
GetCodeTest.testGetCode()
ImmutableVarsTest.test_run_deployment(uint256)
InitCodeTest.test_init()
IntTypeTest.testFail_uint128(uint128)
IntTypeTest.testFail_uint256(uint256)
Expand Down
Loading

0 comments on commit 0b1e629

Please sign in to comment.