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

Support function with struct and array argument types #2136

Merged
merged 40 commits into from
Nov 9, 2023

Conversation

spencerhaoxiao
Copy link
Contributor

@spencerhaoxiao spencerhaoxiao commented Oct 25, 2023

  1. Add function abi_array to support function with array arguments
  2. Add function 'abi_tuple' to support function with struct arguments (copied from PR 2015)
  3. Code in kontrolx is not updated, as this function has been moved to kontrol repo.
    Note: Included the content from PR 2105 because the component type of an array could be struct. As discussed with @palinatolmach, I will include the changes in PR 2105 into this PR.

@spencerhaoxiao spencerhaoxiao changed the title add abi_array function Support function with struct and array arguments Oct 26, 2023
kevm-pyk/src/kevm_pyk/kproj/plugin Outdated Show resolved Hide resolved
kevm-pyk/src/kevm_pyk/kevm.py Outdated Show resolved Hide resolved
kevm-pyk/src/kevm_pyk/kevm.py Outdated Show resolved Hide resolved
for i in reversed(args):
res = KApply('_,__EVM-ABI_TypedArgs_TypedArg_TypedArgs', [i, res])
return res
def typed_args(args: list[KApply], res: KApply | None = None) -> KApply:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's reason to expose the unit, I'd just go with the default:

Suggested change
def typed_args(args: list[KApply], res: KApply | None = None) -> KApply:
def typed_args(args: list[KApply]) -> KApply:

kevm-pyk/src/kontrolx/solc_to_k.py Outdated Show resolved Hide resolved
@spencerhaoxiao spencerhaoxiao changed the title Support function with struct and array arguments Support function with struct and array argument types Nov 2, 2023
@spencerhaoxiao spencerhaoxiao marked this pull request as ready for review November 2, 2023 10:50
spencerhaoxiao and others added 11 commits November 2, 2023 18:51
* .gitignore, tests/specs/examples: commit bin-runtime files

* kevm-pyk/test_prove: simplify compilation process now that we dont need to generate K code

* .gitmodules: remove forge-std

* kevm-pyk/: remove more references to foundry tests

* kevm-pyk/src/tests/integration/test-data: remove references to foundry tests

* kevm-pyk/src/tests/integration/test_{foundry_prove,solc_to_k}: remove unused files

* Set Version: 1.0.326

* tests/foundry/lib/forge-std: remove submodule

* Set Version: 1.0.328

---------

Co-authored-by: devops <[email protected]>
* Remove `foundry.md` and the `foundry` target

* Set Version: 1.0.329

---------

Co-authored-by: devops <[email protected]>
* bump soliditylang docs version in readme

* Set Version: 1.0.328

* Set Version: 1.0.329

* Set Version: 1.0.330

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Palina Tolmach <[email protected]>
* deps/pyk_release: Set Version v0.1.480

* Set Version: 1.0.329

* kevm-pyk/: sync poetry files pyk version v0.1.480

* deps/k_release: sync release file version 6.0.164

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

* deps/pyk_release: Set Version v0.1.481

* kevm-pyk/: sync poetry files pyk version v0.1.481

* deps/k_release: sync release file version 6.0.174

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

* Set Version: 1.0.330

* kevm-pyk/: sync poetry files pyk version v0.1.481

* deps/pyk_release: Set Version v0.1.482

* kevm-pyk/: sync poetry files pyk version v0.1.482

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

* deps/pyk_release: Set Version v0.1.483

* kevm-pyk/: sync poetry files pyk version v0.1.483

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

* deps/pyk_release: Set Version v0.1.484

* kevm-pyk/: sync poetry files pyk version v0.1.484

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

* deps/pyk_release: Set Version v0.1.485

* kevm-pyk/: sync poetry files pyk version v0.1.485

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

* Set Version: 1.0.331

* deps/pyk_release: Set Version v0.1.486

* fix poetry2nix

* kevm-pyk/: sync poetry files pyk version v0.1.486

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

* minor tweak

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Palina Tolmach <[email protected]>
Co-authored-by: Sam Balco <[email protected]>
…#2099)

* Rerun claims based on digest, computed from claim body + dependent claims

* Set Version: 1.0.309

* Make KClaimJob a frozen class and cache digest

* Set Version: 1.0.310

* Change to using frozenset

* Raise exception when label is not found

* Set Version: 1.0.310

* Set Version: 1.0.312

* Set Version: 1.0.314

* Set Version: 1.0.329

* Update kevm-pyk/src/kevm_pyk/__main__.py

Co-authored-by: Andrei Văcaru <[email protected]>

* Fix formatting

* Set Version: 1.0.330

* Set Version: 1.0.331

* Set Version: 1.0.332

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Andrei Văcaru <[email protected]>
Co-authored-by: rv-jenkins <[email protected]>
* kevm-pyk/{cli,__main__}: remove options --[no-]simplify-init

* kevm-pyk/__main__: setup temporary directory for saving proofs if needed

* Set Version: 1.0.328

* Set Version: 1.0.329

* Set Version: 1.0.331

* Set Version: 1.0.332

* Set Version: 1.0.333

* kevm-pyk/test_prove: remove kserver

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: rv-jenkins <[email protected]>
@palinatolmach palinatolmach mentioned this pull request Nov 9, 2023
@rv-jenkins rv-jenkins merged commit 7b04335 into master Nov 9, 2023
11 checks passed
@rv-jenkins rv-jenkins deleted the function_array_args branch November 9, 2023 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants