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

English documentation updates up to v0.8.27-105-g256e95281 (2024-10-03) #381

Open
wants to merge 1,755 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
1755 commits
Select commit Hold shift + click to select a range
cccbc12
Updated some outdated docs and TODOs related to the optimizer outputs
cameel May 28, 2024
1a60d18
Do not perform IR optimization if only unoptimized IR is requested
cameel May 29, 2024
b4c395b
Merge pull request #15162 from ethereum/do-not-optimize-without-optim…
cameel Jul 24, 2024
f89e83b
yul: AsmPrinter has mode enum to determine printing mode instead of d…
clonker Jul 12, 2024
065c2c3
Merge pull request #15259 from ethereum/asm_printer_mode
clonker Jul 25, 2024
5af1115
Add library abi notes in ABI page
kuzdogan Jul 25, 2024
e0fb91f
Merge pull request #15301 from kuzdogan/add-library-abi-notes
nikola-matic Jul 30, 2024
911ab3c
SMTChecker: Introduce SMT-LIB context
blishko Jun 20, 2024
e73ab6a
Merge pull request #15239 from ethereum/smt-better-context
blishko Jul 30, 2024
9a1d740
Add --asm-json option in assembler mode.
aarlt Oct 12, 2023
4c7e490
Merge pull request #14612 from ethereum/add-asm-json-output-assembler…
cameel Jul 31, 2024
c458c3e
SMTChecker: Use pipe instead of temporary file in solver interface
blishko Jul 31, 2024
7245108
Merge pull request #15307 from ethereum/smt-pipe
nikola-matic Jul 31, 2024
b4917bb
SMTChecker: Do not prematurely end reading solver's response
blishko Jul 21, 2024
ecfe63a
SMTChecker: Explain command-line arguments of individual solvers
blishko Jul 31, 2024
1bb7872
Merge pull request #15311 from ethereum/smt-solver-command
nikola-matic Aug 1, 2024
c5685e7
generate transient storage layout
matheusaaguiar Jun 24, 2024
7094e30
Merge pull request #15247 from ethereum/transientStorageLayout
nikola-matic Aug 2, 2024
978f9a0
Yul: Immutable AST class with top-level block
clonker Jul 11, 2024
d109d6b
Yul: StackCompressor/StackLimitEvader return modified ast and operate…
clonker Jul 29, 2024
d067964
Yul: introduce setCode method for yul::Object to properly clean up re…
clonker Aug 2, 2024
44bfa72
Yul: optimizer tests assert that there are no subobjects but Data
clonker Aug 2, 2024
860f0d4
Change the constant optimizer to make use of PUSH0
axic Apr 12, 2023
6e7d94e
Add new Peephole Optimiser method (deduplicateNextTag)
matheusaaguiar Mar 30, 2024
7e67811
Update tests
matheusaaguiar Mar 30, 2024
a500a63
workaround to skip failing hardhat tests
matheusaaguiar Jun 28, 2024
57ab4dc
Parser: Fix spuriously emitted parser error for unary plus operations…
clonker Aug 5, 2024
38088a1
Merge pull request #15315 from ethereum/spurious_unary_plus_parser_error
nikola-matic Aug 5, 2024
5dbaa13
Merge pull request #14117 from ethereum/push0-optimisations
ekpyron Aug 5, 2024
40aec73
Update libyul/Object.cpp
ekpyron Aug 6, 2024
c92b32f
Merge pull request #15258 from ethereum/immutable_ast_class
ekpyron Aug 6, 2024
961c99d
Tests for warnings sensitive to optimization
cameel Jul 31, 2024
ea262ed
EVMObjectCompiler: Don't require a mutable object
cameel Jul 31, 2024
fe4c52e
Move optimized IR reparsing from CompilerStack to YulStack
cameel Jul 31, 2024
ea85a78
CLI: remove --yul flag
clonker Aug 6, 2024
f99c239
Merge pull request #15316 from ethereum/remove_yul_cli_arg
r0qs Aug 8, 2024
55a5fd9
Fix SMT logic error when assigning to an array of contracts or functi…
pgebal Aug 9, 2024
da68f49
Dont allow initialization of transient storage state variables
matheusaaguiar Aug 6, 2024
44e008b
Yul: remove deprecated dialect
clonker Aug 7, 2024
2d01e62
Merge pull request #15210 from ToonVanHove/doc-fix
matheusaaguiar Aug 12, 2024
dd64adf
Merge pull request #15317 from ethereum/RestrictTransientStorageVaria…
ekpyron Aug 12, 2024
60530b8
Merge pull request #15319 from ethereum/remove_yul_deprecated_dialect
ekpyron Aug 12, 2024
6d3340a
Merge pull request #15309 from ethereum/fix-wrong-native-locations-in…
ekpyron Aug 12, 2024
61d1d9d
fix typo in micropayment.rst
Allarious Aug 12, 2024
1c0b2f5
Yul: Remove EVMDialectTyped
clonker Aug 13, 2024
6512722
Yul tests: Adapt or remove EVMDialectTyped tests
clonker Aug 13, 2024
40e05d6
Yul optimizer tests: Update test expectations to use evm instead of e…
clonker Aug 13, 2024
d7bfea0
Yul syntax tests: Update test expectations to use evm instead of evmT…
clonker Aug 13, 2024
83895d0
Error codes: Whitelist 1733 and 9547 as they rely on Yul types (which…
clonker Aug 13, 2024
f90d4c0
Merge pull request #15328 from Allarious/patch-2
nikola-matic Aug 13, 2024
63d87a2
Use submodules for some dependencies.
aarlt Jun 12, 2024
5647d99
Merge pull request #15329 from ethereum/remove_evm_typed
ekpyron Aug 13, 2024
3de3c7b
Bump evmone to v0.12.0 in CI
nikola-matic Aug 9, 2024
3d3b78e
Fix UB introduced by casting difference of two unsigneds to signed
clonker Aug 14, 2024
add191d
Merge pull request #15333 from ethereum/yul_evm_code_transform_ub
clonker Aug 14, 2024
da1bc0b
SMTChecker: Add setup of z3 to SMTSolverCommand
blishko Aug 14, 2024
363274d
Update ContractCompiler.cpp
lmanini Aug 15, 2024
fa781b7
Remove cmake dependency and bump boost in ossfuzz
nikola-matic Aug 13, 2024
1c21f83
Add ubuntu2404 docker image
nikola-matic Aug 14, 2024
314b145
Merge pull request #15334 from ethereum/smt-z3-command
ekpyron Aug 15, 2024
3da2cd9
Merge pull request #15246 from meetmangukiya/stack-too-deep-yul-srclo…
ekpyron Aug 15, 2024
b9b1d08
Pass vector of SMT expressions to SymbolicFunctionVariable function
zo9999 Apr 3, 2024
fc0fb95
Merge pull request #14981 from zo9999/fix-signature-of-function-opera…
blishko Aug 15, 2024
60b2b03
Merge pull request #15335 from lmanini/patch-2
ekpyron Aug 15, 2024
a197cbe
Add back CLion build directories to .gitignore.
ekpyron Aug 18, 2024
cae1dec
Merge pull request #15342 from ethereum/gitignore
clonker Aug 19, 2024
b172de5
SMTChecker: Inline let expressions in solvers' models
blishko Aug 15, 2024
c7adde3
Merge pull request #15195 from ethereum/some_dependencies_as_git_subm…
aarlt Aug 19, 2024
98b22f8
Merge pull request #15336 from ethereum/smt-lets
blishko Aug 19, 2024
3b532e4
docs: add the onlyBuyer modifier in function confirmPurchase()
DestinyWei Oct 22, 2023
91076d6
Update safe-remote.rst
mehtavishwa30 Aug 19, 2024
020bde9
SMTChecker: Translate bitvector constants properly
blishko Jul 20, 2024
3f74db6
Merge pull request #15344 from ethereum/revert-docs-pr
ekpyron Aug 19, 2024
06d2bde
Object compiler tests for nested identical objects
cameel Jul 22, 2024
8f237de
Object: Add missing `override` specifier to overridden methods
cameel Jun 12, 2024
6654e87
ObjectDebugData: Expose a helper for formatting the @use-src comment
cameel Jun 12, 2024
27daf26
Caching of optimized IR
cameel Jul 31, 2024
5c7fc04
OptimizedIRCachingTest
cameel Jul 30, 2024
20857af
Merge pull request #15267 from ethereum/caching-optimized-ir
clonker Aug 19, 2024
f6aee35
Fix some submodule related problems.
aarlt Aug 19, 2024
c6075d5
Merge pull request #15346 from ethereum/fix_submodules
ekpyron Aug 19, 2024
05c96ce
Merge pull request #15345 from ethereum/smt-parse-constants
ekpyron Aug 19, 2024
b6ab054
Update fmtlib to v11.0.2.
aarlt Jul 29, 2024
90c0fbb
Merge pull request #15305 from ethereum/version_bump_submodules
aarlt Aug 20, 2024
20fa893
More precise calculations when evaluating how many bytes immutables r…
matheusaaguiar Aug 23, 2024
0e80fbf
prep: Extend `StandardCompiler` settings with `eofVersion` flag. Fix …
rodiazet Jul 22, 2024
5414520
prep: Change `toBigEndian` interface to support rvalue ref.
rodiazet Jul 22, 2024
6437d7e
Merge pull request #15355 from ipsilon/eof-prep-0
ekpyron Aug 23, 2024
2b7274c
Merge pull request #15357 from ipsilon/eof-prep-2
ekpyron Aug 23, 2024
b8d4798
Merge pull request #15354 from ethereum/fixImmutableImpreciseBytesReq…
ekpyron Aug 23, 2024
431911d
Merge pull request #15321 from ethereum/bump-evmc-and-evmone-to-12
nikola-matic Aug 26, 2024
9e752f5
chore: update array_storage_index_zeroed_test.sol
eltociear Aug 26, 2024
a9b9c7d
Merge pull request #15360 from eltociear/patch-3
cameel Aug 27, 2024
b8373e9
CI: explicitly add numpy to LSP test dependencies on windows
clonker Aug 28, 2024
de5e3b8
Merge pull request #15366 from ethereum/lsp_testing_win
clonker Aug 28, 2024
47a715f
Yul: Remove boolType and defaultType from dialect
clonker Aug 14, 2024
f5174e7
Yul: Remove dialect and printing mode from AsmPrinter
clonker Aug 14, 2024
0d0f277
Yul: Remove types from AST
clonker Aug 15, 2024
fbaa505
Yul: Builtins now record number of args and rets instead of respectiv…
clonker Aug 16, 2024
4938075
Yul: Improve variable naming and type error message wording, update t…
clonker Aug 27, 2024
664ee23
Merge pull request #15332 from ethereum/remove_yul_dialect_types
clonker Aug 28, 2024
c5b1ac3
Fix showProvedSafe flag and JSON key name
ardislu Jul 27, 2024
82a3071
SMTChecker: Introduce first draft of Z3CHCSmtlib2Interface
blishko Aug 19, 2024
d5cdf07
Merge pull request #15348 from ethereum/smt-z3smtlib-first-draft
blishko Aug 28, 2024
9e8369f
Merge pull request #15304 from ardislu/fix-show-proved-safe
nikola-matic Aug 28, 2024
4aff997
Implementation of direct SSA CFG generation.
ekpyron Aug 20, 2024
d9116dc
Yul: Split SSA CFG into separate graphs for functions
r0qs Aug 21, 2024
7d87b63
Yul: Dot output of SSA CFG
clonker Aug 9, 2024
80533d8
Convert Yul CFG to Json
r0qs May 31, 2024
b167c27
prep: Pass `_eofVersion` to `libevmasm/Assembly` class
rodiazet Aug 26, 2024
1854186
eof: Remove eof experimental test. It should be reintroduced later.
rodiazet Aug 28, 2024
92a74ed
SMTChecker: Introduce helper struct for query result
blishko Jul 20, 2024
9fb67f0
Merge pull request #15369 from ethereum/smt-helper-struct
blishko Aug 29, 2024
5b1704b
Merge pull request #15359 from ethereum/ssaCfg
ekpyron Aug 29, 2024
ae1c3d4
Merge pull request #15180 from ethereum/export-yul-cfg-json
clonker Aug 29, 2024
03880e4
Updating copyright year to 2024
githubfromgui Feb 13, 2024
d7865f1
Do not suppress the original message from unexpected AssemblyExceptions
cameel Aug 30, 2024
7ad125f
Merge pull request #15375 from ethereum/propagate-assembly-exception-…
matheusaaguiar Aug 30, 2024
2f46323
Bump min Boost dependency to 1.67 on Linux and macOS
cameel Aug 30, 2024
40e005b
Merge pull request #15376 from ethereum/fix-boost-min-version
cameel Aug 30, 2024
ad969e2
Hide undocumented yul export cfg option
r0qs Sep 2, 2024
b30f1e2
Create opRetro.json
mehtavishwa30 Sep 2, 2024
1c4da04
Merge pull request #15385 from ethereum/hide-undocumented-experimenta…
ekpyron Sep 2, 2024
1673c5c
Introduce ubuntu2404 clang docker image
nikola-matic Aug 29, 2024
c1d33a0
Merge pull request #15386 from ethereum/op-grant-verification
ekpyron Sep 2, 2024
9c43cc5
Merge pull request #15370 from ethereum/add-ubuntu2404-clang-image
r0qs Sep 2, 2024
b3ba1b2
Rename opRetro.json to funding.json
mehtavishwa30 Sep 2, 2024
168850b
Merge pull request #15238 from ethereum/relaxMemorySafety
ekpyron Sep 2, 2024
79f05ca
Mark PROFILE_OPTIMIZER_STEPS CMake option as advanced
cameel Aug 30, 2024
b52094b
Remove nlohmann JSON version check
cameel Aug 30, 2024
01a01eb
Clearer names and descriptions for advanced CMake options
cameel Aug 30, 2024
3184534
Improve names/descriptions of Z3-related CMake variables
cameel Sep 2, 2024
d6f9519
Merge pull request #15377 from ethereum/tweak-cmake-options
cameel Sep 2, 2024
9b33e00
Merge pull request #15356 from ipsilon/eof-prep-1
ekpyron Sep 3, 2024
3b04038
Disable failing import tests introduced by boost upgrade
nikola-matic Sep 3, 2024
bf54bdf
Merge pull request #15394 from ethereum/disable-failing-filesystem-tests
ekpyron Sep 3, 2024
3f6f2d3
Fix Yul stack output using standard json in the presence of warnings.
ekpyron Sep 3, 2024
3e5060c
Remove mantic from release PPA script (obsolete).
ekpyron Sep 3, 2024
1207b48
Merge pull request #15396 from ethereum/fixYulStackForWarnings
ekpyron Sep 3, 2024
c14977c
Merge pull request #15393 from ethereum/removeMantic
ekpyron Sep 3, 2024
b92cabd
Sort changelog for the upcoming release
nikola-matic Sep 3, 2024
3c3da63
Merge pull request #15395 from ethereum/sort-changelog-and-fix-incons…
ekpyron Sep 3, 2024
830ec2c
Set changelog release date
nikola-matic Sep 4, 2024
40a35a0
Merge pull request #15399 from ethereum/set-changelog-release-date
nikola-matic Sep 4, 2024
7e5836a
Set version to 0.8.28
nikola-matic Sep 4, 2024
09e9aa6
Merge pull request #15400 from ethereum/set-version-to-0-8-28
nikola-matic Sep 4, 2024
a298438
We no longer use a `release` branch
cameel Sep 2, 2024
ee08a75
docker_deploy_manual.sh: Make script more configurable to allow testi…
cameel Sep 2, 2024
7cca807
b_alpine_docker nightly job
cameel Sep 2, 2024
32b8b41
docker_deploy_manual.sh: Switch to plain docker build output
cameel Sep 2, 2024
7f582e4
Add ContiguousDisjointSet datastructure
clonker Sep 5, 2024
fc2e90f
Add topological sort implementation for forward SSACFG
clonker Sep 9, 2024
40758c3
Merge pull request #15389 from ethereum/ci-job-testing-docker-build
cameel Sep 9, 2024
13fe5ba
Replace errors/warning/info empty check with proper errors only check
matheusaaguiar Jun 18, 2024
c446d3b
SMTChecker: Fix parsing of model values in BMC
blishko Aug 22, 2024
a204f47
SMTChecker: Prepare Z3 SMT-LIB interface for BMC engine
blishko Aug 29, 2024
ac81d42
Merge pull request #15203 from ethereum/replaceErrorsEmptyWithHasErrors
cameel Sep 9, 2024
62909de
Merge pull request #15371 from ethereum/smt-prepare-bmc
blishko Sep 9, 2024
6f548be
Upgrade jobs to run on Ubuntu 2404
nikola-matic Sep 9, 2024
6a69527
xSMTChecker: Fix SMT logic error when assigning to an array of addresses
pgebal Sep 9, 2024
e629a03
Merge pull request #15420 from pgebal/smt-checker/fix-arrays-of-address
blishko Sep 10, 2024
9d7cc42
legacy codegen transient storage support for state variables
matheusaaguiar Jul 8, 2024
6ef580c
Merge pull request #15257 from ethereum/transientStorageLegacyCodegen
nikola-matic Sep 10, 2024
9df0379
Merge pull request #15418 from ethereum/liveness-disjoint-set
clonker Sep 11, 2024
4fca0b6
Merge pull request #15422 from ethereum/run-jobs-on-ubuntu-2404
nikola-matic Sep 11, 2024
668adbe
Remove STRICT_NLOHMANN_JSON_VERSION_CHECK leftover.
aarlt Sep 9, 2024
4049f51
Merge pull request #15421 from ethereum/remove_leftover
cameel Sep 11, 2024
16b2447
Upgrade jobs to run on Ubuntu 2404
nikola-matic Sep 9, 2024
1d58415
Update `evmc to` `12.0.0` and `evmone` to `0.12.0`
rodiazet Sep 13, 2024
322d656
Make it easier for users to discover that copying arrays and structs …
mehtavishwa30 Sep 16, 2024
2e6a2d2
Add SSACFG loop nesting forest
clonker Sep 9, 2024
2b0d08c
Apostrophe added in README.md (#15431)
anandhuRaveendran Sep 17, 2024
a92a51b
Merge pull request #15320 from ipsilon/evmc-evmone-12
ekpyron Sep 17, 2024
154fc1d
Merge pull request #15419 from ethereum/liveness-loop-nesting-forest
matheusaaguiar Sep 17, 2024
963d70b
Yul: Add toDot to SSACFG
clonker Sep 18, 2024
573d7d8
Yul: Add toDot to ControlFlow
clonker Sep 18, 2024
515f8ab
Bump all CI jobs to use Ubuntu 22.04 images
nikola-matic Sep 18, 2024
db40301
Merge pull request #15438 from ethereum/ssaCfg-todot
clonker Sep 18, 2024
38fd087
Fix pip issues for 24.04
nikola-matic Sep 18, 2024
10f2e60
Yul: Fix removal of trivial phi functions in SSA CFG Builder
clonker Sep 12, 2024
5fc7269
Remove 22.04 images and docker buildpack deps
nikola-matic Sep 18, 2024
ba4d768
Merge pull request #15437 from ethereum/bump-all-jobs-to-2404
cameel Sep 18, 2024
7e9ac48
SSACFGBuilder: Only eliminate trivial phi of sealed blocks and add re…
clonker Sep 17, 2024
c4a199a
SSACFGBuilder: clean up tryRemoveTrivialPhi
clonker Sep 19, 2024
7d33151
Merge pull request #15429 from ethereum/ssaCfg-fix-trivial-phi-fct-re…
ekpyron Sep 19, 2024
55f746b
eof: Introduce EOF container format support in `Assembly::assemble` (…
rodiazet Sep 19, 2024
603d9de
eof: pass EOF flag to `Assembly::fromJSON`
rodiazet Sep 20, 2024
bc9f3e0
eof: Add container format test
rodiazet Sep 20, 2024
33b67f0
Merge pull request #15367 from ipsilon/eof-prep-3
cameel Sep 20, 2024
1ba4349
Rename Standard JSON output selection tests CLI to match the naming c…
cameel Sep 23, 2024
3452ba0
More CLI tests for output selection in Standard JSON
cameel Sep 23, 2024
60cea4d
Merge pull request #15447 from ethereum/output-selection-tests
cameel Sep 23, 2024
9b4a07b
SSACFG: Fix canContinue in user-defined function calls
clonker Sep 23, 2024
4461699
SSACFG: Handle nested function definitions
clonker Sep 24, 2024
bd73354
Merge pull request #15448 from ethereum/ssaCfg-fixCanContinue
clonker Sep 24, 2024
47ba76f
benchmarks: Move shared code using /usr/bin/time into a helper with J…
cameel Sep 24, 2024
8bb279b
benchmarks: Switch to displaying CPU time rather than wall clock time…
cameel Sep 24, 2024
95534b6
benchmarks: Show peak memory usage
cameel Sep 24, 2024
9bf850b
benchmarks: Cosmetic tweaks to how results are displayed
cameel Sep 24, 2024
545cab3
eof: Refactor `assemble` functions in `evmasm::Assembly``
rodiazet Sep 25, 2024
ad53637
Merge pull request #15450 from ethereum/memory-usage-in-benchmarks
cameel Sep 25, 2024
4b285f1
Merge pull request #15446 from ipsilon/eof-prep-4-refactor
cameel Sep 25, 2024
09c48f5
eof: Support EOF in `assemblyStream`
rodiazet Sep 24, 2024
9e65fff
eof: Support EOF in `computeSourceMapping`
rodiazet Sep 24, 2024
415d2fc
eof: strict asm output test update
rodiazet Sep 25, 2024
3ee5f2d
Merge pull request #15449 from ipsilon/eof-assembly-print-output
cameel Sep 25, 2024
cffc4f8
Add missing ASAN runtime libraries
r0qs Sep 25, 2024
4627827
Bump ubuntu 24.04 clang image
r0qs Sep 25, 2024
2f58ee3
Merge pull request #15454 from ethereum/add-missing-asan-rt-libraries
r0qs Sep 26, 2024
fd6a655
Merge pull request #15455 from ethereum/bump-clang-docker
r0qs Sep 26, 2024
b705136
Do not treat all warnings as errors when building with sanitizers.
r0qs Sep 25, 2024
6f2ab08
Merge pull request #15453 from ethereum/disable-pedantic-asan-builds
r0qs Sep 26, 2024
5643e8e
Remove a few unused YulStack imports
cameel Sep 25, 2024
372dab4
Store a reference to a Solidity source provider in YulStack
cameel Sep 25, 2024
4216aa7
Fix shifted native source locations in Yul AST in presence of code sn…
cameel Sep 25, 2024
f369cdd
Merge pull request #15457 from ethereum/fix-code-snippets-shifting-yu…
cameel Sep 26, 2024
578e1bb
CompilerStack: Helper for Yul parsing
cameel Sep 24, 2024
9ccc44a
CompilerStack: Yul AST generation only on demand
cameel Sep 24, 2024
26d5b3f
Merge pull request #15451 from ethereum/compiler-stack-do-not-store-s…
cameel Sep 27, 2024
5cbfd0d
Via-IR code-gen for transient state variables
nikola-matic Jul 22, 2024
0968a33
Update old tests
nikola-matic Sep 13, 2024
8dfba60
New tests
nikola-matic Sep 16, 2024
6398cb2
Changelog
nikola-matic Sep 16, 2024
98fdc44
Fix missing underscore in Yul function names
nikola-matic Sep 25, 2024
4ba39cb
Merge pull request #15292 from ethereum/transient-storage-for-value-t…
nikola-matic Sep 27, 2024
b540741
Transient storage docs
matheusaaguiar Sep 5, 2024
146e2bc
outputPerformanceMetrics(): Add missing std:: prefixes
cameel Sep 30, 2024
c6df887
Fix evmone MacOS link
nikola-matic Sep 30, 2024
542f7a5
Merge pull request #15465 from ethereum/missing-std-prefix-in-perform…
nikola-matic Sep 30, 2024
891b7c8
Do not cache instances of Compiler in CompilerStack
cameel Sep 26, 2024
3c5e46b
CompilerStack: Do not cache the JSON representation of generated sources
cameel Sep 26, 2024
786eb15
Merge pull request #15466 from ethereum/fix-evmone-link
clonker Sep 30, 2024
bc9342a
Merge pull request #15460 from ethereum/compiler-stack-do-not-store-c…
cameel Sep 30, 2024
a8a679d
Merge pull request #15441 from ethereum/ssaCfg-trivial-phi-cleanup
ekpyron Sep 30, 2024
ba6dee1
Merge pull request #15409 from ethereum/transientStorageDocs
nikola-matic Oct 1, 2024
6bee17d
CompilerStack: Add missing members to reset()
cameel Sep 16, 2024
a4fa886
StandardCompiler: Fix bad `if` indent triggering a warning
cameel Sep 16, 2024
a9d9143
Pass selected outputs down to CompilerStack to avoid generating them …
cameel Sep 16, 2024
885c916
Merge pull request #15433 from ethereum/compiler-stack-per-contract-o…
cameel Oct 1, 2024
8d8ac1c
eof: Pass `eofVersion` flag to `EVMDialect`
rodiazet Oct 1, 2024
4ab3e36
Merge pull request #15467 from ipsilon/eof-pass-flag-to-evm-dialect
cameel Oct 1, 2024
62dc597
Replace Hardhat with EDR in CI
fvictorio Sep 27, 2024
351922c
Merge pull request #15461 from fvictorio/replace-hardhat-with-edr-in-ci
ekpyron Oct 2, 2024
2b41846
cmake: remove USE_LD_GOLD option
clonker Oct 2, 2024
a458344
Merge pull request #15474 from ethereum/remove_use_ld_gold
ekpyron Oct 2, 2024
badd115
Avoid unnecessary copy in full inliner.
ekpyron Oct 2, 2024
39e5aef
Re-enable cxx20 job
nikola-matic Oct 2, 2024
d8f3790
Merge pull request #15476 from ethereum/inlinerDepthCopy
ekpyron Oct 2, 2024
256e952
Merge pull request #15475 from ethereum/re-enable-cxx20-job
ekpyron Oct 2, 2024
08ebeaa
English documentation updates up to v0.8.27-105-g256e95281 (2024-10-03)
soldocsbot Oct 3, 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
26 changes: 22 additions & 4 deletions liblangutil/EVMVersion.cpp
Original file line number Diff line number Diff line change
@@ -26,23 +26,26 @@ using namespace solidity;
using namespace solidity::evmasm;
using namespace solidity::langutil;

bool EVMVersion::hasOpcode(Instruction _opcode) const
bool EVMVersion::hasOpcode(Instruction _opcode, std::optional<uint8_t> _eofVersion) const
{
// EOF version can be only defined since prague
assert(!_eofVersion.has_value() || this->m_version >= prague());

switch (_opcode)
{
case Instruction::RETURNDATACOPY:
case Instruction::RETURNDATASIZE:
return supportsReturndata();
case Instruction::STATICCALL:
return hasStaticCall();
return !_eofVersion.has_value() && hasStaticCall();
case Instruction::SHL:
case Instruction::SHR:
case Instruction::SAR:
return hasBitwiseShifting();
case Instruction::CREATE2:
return hasCreate2();
return !_eofVersion.has_value() && hasCreate2();
case Instruction::EXTCODEHASH:
return hasExtCodeHash();
return !_eofVersion.has_value() && hasExtCodeHash();
case Instruction::CHAINID:
return hasChainID();
case Instruction::SELFBALANCE:
@@ -58,6 +61,21 @@ bool EVMVersion::hasOpcode(Instruction _opcode) const
case Instruction::TSTORE:
case Instruction::TLOAD:
return supportsTransientStorage();
// Instructions below are deprecated in EOF
case Instruction::CALL:
case Instruction::CALLCODE:
case Instruction::DELEGATECALL:
case Instruction::SELFDESTRUCT:
case Instruction::JUMP:
case Instruction::JUMPI:
case Instruction::PC:
case Instruction::CREATE:
case Instruction::CODESIZE:
case Instruction::CODECOPY:
case Instruction::EXTCODESIZE:
case Instruction::EXTCODECOPY:
case Instruction::GAS:
return !_eofVersion.has_value();
default:
return true;
}
2 changes: 1 addition & 1 deletion liblangutil/EVMVersion.h
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ class EVMVersion:
bool hasMcopy() const { return *this >= cancun(); }
bool supportsTransientStorage() const { return *this >= cancun(); }

bool hasOpcode(evmasm::Instruction _opcode) const;
bool hasOpcode(evmasm::Instruction _opcode, std::optional<uint8_t> _eofVersion) const;

/// Whether we have to retain the costs for the call opcode itself (false),
/// or whether we can just forward easily all remaining gas (true).
11 changes: 10 additions & 1 deletion libsolidity/ast/ASTJsonExporter.cpp
Original file line number Diff line number Diff line change
@@ -664,12 +664,21 @@ bool ASTJsonExporter::visit(InlineAssembly const& _node)
for (Json& it: externalReferences | ranges::views::values)
externalReferencesJson.emplace_back(std::move(it));

auto const& evmDialect = dynamic_cast<solidity::yul::EVMDialect const&>(_node.dialect());

std::vector<std::pair<std::string, Json>> attributes = {
std::make_pair("AST", Json(yul::AsmJsonConverter(sourceIndexFromLocation(_node.location()))(_node.operations().root()))),
std::make_pair("externalReferences", std::move(externalReferencesJson)),
std::make_pair("evmVersion", dynamic_cast<solidity::yul::EVMDialect const&>(_node.dialect()).evmVersion().name())
std::make_pair("evmVersion", evmDialect.evmVersion().name())
};

// TODO: Add test in test/linsolidity/ASTJSON/assembly. This requires adding support for eofVersion in ASTJSONTest
if (evmDialect.eofVersion())
{
solAssert(*evmDialect.eofVersion() > 0);
attributes.push_back(std::make_pair("eofVersion", *evmDialect.eofVersion()));
}

if (_node.flags())
{
Json flags = Json::array();
11 changes: 10 additions & 1 deletion libsolidity/ast/ASTJsonImporter.cpp
Original file line number Diff line number Diff line change
@@ -720,7 +720,16 @@ ASTPointer<InlineAssembly> ASTJsonImporter::createInlineAssembly(Json const& _no
astAssert(evmVersion.has_value(), "Invalid EVM version!");
astAssert(m_evmVersion == evmVersion, "Imported tree evm version differs from configured evm version!");

yul::Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(evmVersion.value());
// TODO: Add test in test/linsolidity/ASTJSON/assembly. This requires adding support for eofVersion in ASTJSONTest
std::optional<uint8_t> eofVersion;
if (auto const it = _node.find("eofVersion"); it != _node.end())
{
eofVersion = it->get<uint8_t>();
astAssert(eofVersion > 0);
}
astAssert(m_eofVersion == eofVersion, "Imported tree EOF version differs from configured EOF version!");

yul::Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(evmVersion.value(), eofVersion);
ASTPointer<std::vector<ASTPointer<ASTString>>> flags;
if (_node.contains("flags"))
{
6 changes: 4 additions & 2 deletions libsolidity/ast/ASTJsonImporter.h
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ namespace solidity::frontend
class ASTJsonImporter
{
public:
ASTJsonImporter(langutil::EVMVersion _evmVersion)
:m_evmVersion(_evmVersion)
ASTJsonImporter(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion)
:m_evmVersion(_evmVersion), m_eofVersion(_eofVersion)
{}

/// Converts the AST from JSON-format to ASTPointer
@@ -166,6 +166,8 @@ class ASTJsonImporter
std::set<int64_t> m_usedIDs;
/// Configured EVM version
langutil::EVMVersion m_evmVersion;
/// Configured EOF version. Equals std::nullopt if non-EOF
std::optional<uint8_t> m_eofVersion;
};

}
3 changes: 2 additions & 1 deletion libsolidity/codegen/CompilerContext.cpp
Original file line number Diff line number Diff line change
@@ -436,7 +436,7 @@ void CompilerContext::appendInlineAssembly(
ErrorList errors;
ErrorReporter errorReporter(errors);
langutil::CharStream charStream(_assembly, _sourceName);
yul::EVMDialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion);
yul::EVMDialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion, std::nullopt);
std::optional<langutil::SourceLocation> locationOverride;
if (!_system)
locationOverride = m_asm->currentSourceLocation();
@@ -522,6 +522,7 @@ void CompilerContext::appendInlineAssembly(
analysisInfo,
*m_asm,
m_evmVersion,
std::nullopt,
identifierAccess.generateCode,
_system,
_optimiserSettings.optimizeStackAllocation
1 change: 1 addition & 0 deletions libsolidity/codegen/ContractCompiler.cpp
Original file line number Diff line number Diff line change
@@ -958,6 +958,7 @@ bool ContractCompiler::visit(InlineAssembly const& _inlineAssembly)
*analysisInfo,
*m_context.assemblyPtr(),
m_context.evmVersion(),
std::nullopt,
identifierAccessCodeGen,
false,
m_optimiserSettings.optimizeStackAllocation
7 changes: 4 additions & 3 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
@@ -357,7 +357,7 @@ bool CompilerStack::parse()

try
{
Parser parser{m_errorReporter, m_evmVersion};
Parser parser{m_errorReporter, m_evmVersion, m_eofVersion};

std::vector<std::string> sourcesToParse;
for (auto const& s: m_sources)
@@ -427,7 +427,8 @@ bool CompilerStack::parse()
void CompilerStack::importASTs(std::map<std::string, Json> const& _sources)
{
solAssert(m_stackState == Empty, "Must call importASTs only before the SourcesSet state.");
std::map<std::string, ASTPointer<SourceUnit>> reconstructedSources = ASTJsonImporter(m_evmVersion).jsonToSourceUnit(_sources);
std::map<std::string, ASTPointer<SourceUnit>> reconstructedSources =
ASTJsonImporter(m_evmVersion, m_eofVersion).jsonToSourceUnit(_sources);
for (auto& src: reconstructedSources)
{
solUnimplementedAssert(!src.second->experimentalSolidity());
@@ -896,7 +897,7 @@ Json CompilerStack::generatedSources(std::string const& _contractName, bool _run
ErrorList errors;
ErrorReporter errorReporter(errors);
CharStream charStream(source, sourceName);
yul::EVMDialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion);
yul::EVMDialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion, m_eofVersion);
std::shared_ptr<yul::AST> parserResult = yul::Parser{errorReporter, dialect}.parse(charStream);
solAssert(parserResult);
sources[0]["ast"] = yul::AsmJsonConverter{sourceIndex}(parserResult->root());
2 changes: 1 addition & 1 deletion libsolidity/parsing/Parser.cpp
Original file line number Diff line number Diff line change
@@ -1448,7 +1448,7 @@ ASTPointer<InlineAssembly> Parser::parseInlineAssembly(ASTPointer<ASTString> con
SourceLocation location = currentLocation();

expectToken(Token::Assembly);
yul::Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion);
yul::Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(m_evmVersion, m_eofVersion);
if (m_scanner->currentToken() == Token::StringLiteral)
{
if (m_scanner->currentLiteral() != "evmasm")
7 changes: 5 additions & 2 deletions libsolidity/parsing/Parser.h
Original file line number Diff line number Diff line change
@@ -40,10 +40,12 @@ class Parser: public langutil::ParserBase
public:
explicit Parser(
langutil::ErrorReporter& _errorReporter,
langutil::EVMVersion _evmVersion
langutil::EVMVersion _evmVersion,
std::optional<uint8_t> _eofVersion
):
ParserBase(_errorReporter),
m_evmVersion(_evmVersion)
m_evmVersion(_evmVersion),
m_eofVersion(_eofVersion)
{}

ASTPointer<SourceUnit> parse(langutil::CharStream& _charStream);
@@ -247,6 +249,7 @@ class Parser: public langutil::ParserBase
/// Flag that signifies whether '_' is parsed as a PlaceholderStatement or a regular identifier.
bool m_insideModifier = false;
langutil::EVMVersion m_evmVersion;
std::optional<uint8_t> m_eofVersion;
/// Counter for the next AST node ID
int64_t m_currentNodeID = 0;
/// Flag that indicates whether experimental mode is enabled in the current source unit
3 changes: 2 additions & 1 deletion libyul/AsmAnalysis.cpp
Original file line number Diff line number Diff line change
@@ -625,7 +625,8 @@ void AsmAnalyzer::expectValidIdentifier(YulName _identifier, SourceLocation cons
bool AsmAnalyzer::validateInstructions(std::string const& _instructionIdentifier, langutil::SourceLocation const& _location)
{
// NOTE: This function uses the default EVM version instead of the currently selected one.
auto const builtin = EVMDialect::strictAssemblyForEVM(EVMVersion{}).builtin(YulName(_instructionIdentifier));
// TODO: Add EOF support
auto const builtin = EVMDialect::strictAssemblyForEVM(EVMVersion{}, std::nullopt).builtin(YulName(_instructionIdentifier));
if (builtin && builtin->instruction.has_value())
return validateInstructions(builtin->instruction.value(), _location);
else
8 changes: 5 additions & 3 deletions libyul/ObjectOptimizer.cpp
Original file line number Diff line number Diff line change
@@ -43,13 +43,13 @@ using namespace solidity::util;
using namespace solidity::yul;


Dialect const& yul::languageToDialect(Language _language, EVMVersion _version)
Dialect const& yul::languageToDialect(Language _language, EVMVersion _version, std::optional<uint8_t> _eofVersion)
{
switch (_language)
{
case Language::Assembly:
case Language::StrictAssembly:
return EVMDialect::strictAssemblyForEVMObjects(_version);
return EVMDialect::strictAssemblyForEVMObjects(_version, _eofVersion);
}
util::unreachable();
}
@@ -77,7 +77,7 @@ void ObjectOptimizer::optimize(Object& _object, Settings const& _settings, bool
);
}

Dialect const& dialect = languageToDialect(_settings.language, _settings.evmVersion);
Dialect const& dialect = languageToDialect(_settings.language, _settings.evmVersion, _settings.eofVersion);
std::unique_ptr<GasMeter> meter;
if (EVMDialect const* evmDialect = dynamic_cast<EVMDialect const*>(&dialect))
meter = std::make_unique<GasMeter>(*evmDialect, _isCreation, _settings.expectedExecutionsPerDeployment);
@@ -158,6 +158,8 @@ std::optional<h256> ObjectOptimizer::calculateCacheKey(
rawKey += h256(u256(_settings.expectedExecutionsPerDeployment)).asBytes();
rawKey += FixedHash<1>(uint8_t(_isCreation ? 0 : 1)).asBytes();
rawKey += keccak256(_settings.evmVersion.name()).asBytes();
yulAssert(!_settings.eofVersion.has_value() || *_settings.eofVersion > 0);
rawKey += FixedHash<1>(uint8_t(_settings.eofVersion ? 0 : *_settings.eofVersion)).asBytes();
rawKey += keccak256(_settings.yulOptimiserSteps).asBytes();
rawKey += keccak256(_settings.yulOptimiserCleanupSteps).asBytes();

3 changes: 2 additions & 1 deletion libyul/ObjectOptimizer.h
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ enum class Language
StrictAssembly,
};

Dialect const& languageToDialect(Language _language, langutil::EVMVersion _version);
Dialect const& languageToDialect(Language _language, langutil::EVMVersion _version, std::optional<uint8_t> _eofVersion);

/// Encapsulates logic for applying @a yul::OptimiserSuite to a whole hierarchy of Yul objects.
/// Also, acts as a transparent cache for optimized objects.
@@ -58,6 +58,7 @@ class ObjectOptimizer
{
Language language;
langutil::EVMVersion evmVersion;
std::optional<uint8_t> eofVersion;
bool optimizeStackAllocation;
std::string yulOptimiserSteps;
std::string yulOptimiserCleanupSteps;
13 changes: 7 additions & 6 deletions libyul/YulStack.cpp
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ bool YulStack::parse(std::string const& _sourceName, std::string const& _source)
{
m_charStream = std::make_unique<CharStream>(_source, _sourceName);
std::shared_ptr<Scanner> scanner = std::make_shared<Scanner>(*m_charStream);
m_parserResult = ObjectParser(m_errorReporter, languageToDialect(m_language, m_evmVersion)).parse(scanner, false);
m_parserResult = ObjectParser(m_errorReporter, languageToDialect(m_language, m_evmVersion, m_eofVersion)).parse(scanner, false);
}
catch (UnimplementedFeatureError const& _error)
{
@@ -94,7 +94,7 @@ void YulStack::optimize()
{
if (
!m_optimiserSettings.runYulOptimiser &&
yul::MSizeFinder::containsMSize(languageToDialect(m_language, m_evmVersion), *m_parserResult)
yul::MSizeFinder::containsMSize(languageToDialect(m_language, m_evmVersion, m_eofVersion), *m_parserResult)
)
return;

@@ -130,6 +130,7 @@ void YulStack::optimize()
ObjectOptimizer::Settings{
m_language,
m_evmVersion,
m_eofVersion,
optimizeStackAllocation,
yulOptimiserSteps,
yulOptimiserCleanupSteps,
@@ -163,7 +164,7 @@ bool YulStack::analyzeParsed(Object& _object)
AsmAnalyzer analyzer(
*_object.analysisInfo,
m_errorReporter,
languageToDialect(m_language, m_evmVersion),
languageToDialect(m_language, m_evmVersion, m_eofVersion),
{},
_object.qualifiedDataNames()
);
@@ -196,7 +197,7 @@ void YulStack::compileEVM(AbstractAssembly& _assembly, bool _optimize) const
{
case Language::Assembly:
case Language::StrictAssembly:
dialect = &EVMDialect::strictAssemblyForEVMObjects(m_evmVersion);
dialect = &EVMDialect::strictAssemblyForEVMObjects(m_evmVersion, m_eofVersion);
break;
default:
yulAssert(false, "Invalid language.");
@@ -316,7 +317,7 @@ YulStack::assembleEVMWithDeployed(std::optional<std::string_view> _deployName)
// it with the minimal steps required to avoid "stack too deep".
bool optimize = m_optimiserSettings.optimizeStackAllocation || (
!m_optimiserSettings.runYulOptimiser &&
!yul::MSizeFinder::containsMSize(languageToDialect(m_language, m_evmVersion), *m_parserResult)
!yul::MSizeFinder::containsMSize(languageToDialect(m_language, m_evmVersion, m_eofVersion), *m_parserResult)
);
try
{
@@ -385,7 +386,7 @@ Json YulStack::cfgJson() const
// NOTE: The block Ids are reset for each object
std::unique_ptr<ControlFlow> controlFlow = SSAControlFlowGraphBuilder::build(
*_object.analysisInfo.get(),
languageToDialect(m_language, m_evmVersion),
languageToDialect(m_language, m_evmVersion, m_eofVersion),
_object.code()->root()
);
YulControlFlowGraphExporter exporter(*controlFlow);
3 changes: 2 additions & 1 deletion libyul/backends/evm/AsmCodeGen.cpp
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ void CodeGenerator::assemble(
AsmAnalysisInfo& _analysisInfo,
evmasm::Assembly& _assembly,
langutil::EVMVersion _evmVersion,
std::optional<uint8_t> _eofVersion,
ExternalIdentifierAccess::CodeGenerator _identifierAccessCodeGen,
bool _useNamedLabelsForFunctions,
bool _optimizeStackAllocation
@@ -49,7 +50,7 @@ void CodeGenerator::assemble(
assemblyAdapter,
_analysisInfo,
_parsedData,
EVMDialect::strictAssemblyForEVM(_evmVersion),
EVMDialect::strictAssemblyForEVM(_evmVersion, _eofVersion),
builtinContext,
_optimizeStackAllocation,
_identifierAccessCodeGen,
1 change: 1 addition & 0 deletions libyul/backends/evm/AsmCodeGen.h
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ class CodeGenerator
AsmAnalysisInfo& _analysisInfo,
evmasm::Assembly& _assembly,
langutil::EVMVersion _evmVersion,
std::optional<uint8_t> _eofVersion,
ExternalIdentifierAccess::CodeGenerator _identifierAccess = {},
bool _useNamedLabelsForFunctions = false,
bool _optimizeStackAllocation = false
232 changes: 118 additions & 114 deletions libyul/backends/evm/EVMDialect.cpp
Original file line number Diff line number Diff line change
@@ -177,7 +177,7 @@ std::set<YulName> createReservedIdentifiers(langutil::EVMVersion _evmVersion)
return reserved;
}

std::map<YulName, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _evmVersion, bool _objectAccess)
std::map<YulName, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion, bool _objectAccess)
{

// Exclude prevrandao as builtin for VMs before paris and difficulty for VMs after paris.
@@ -199,7 +199,7 @@ std::map<YulName, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _ev
opcode != evmasm::Instruction::JUMP &&
opcode != evmasm::Instruction::JUMPI &&
opcode != evmasm::Instruction::JUMPDEST &&
_evmVersion.hasOpcode(opcode) &&
_evmVersion.hasOpcode(opcode, _eofVersion) &&
!prevRandaoException(name)
)
builtins.emplace(createEVMFunction(_evmVersion, name, opcode));
@@ -235,113 +235,116 @@ std::map<YulName, BuiltinFunctionForEVM> createBuiltins(langutil::EVMVersion _ev
})
);

builtins.emplace(createFunction("datasize", 1, 1, SideEffects{}, {LiteralKind::String}, [](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext& _context
) {
yulAssert(_context.currentObject, "No object available.");
yulAssert(_call.arguments.size() == 1, "");
Expression const& arg = _call.arguments.front();
YulName const dataName (formatLiteral(std::get<Literal>(arg)));
if (_context.currentObject->name == dataName.str())
_assembly.appendAssemblySize();
else
{
std::vector<size_t> subIdPath =
_context.subIDs.count(dataName.str()) == 0 ?
_context.currentObject->pathToSubObject(dataName.str()) :
std::vector<size_t>{_context.subIDs.at(dataName.str())};
yulAssert(!subIdPath.empty(), "Could not find assembly object <" + dataName.str() + ">.");
_assembly.appendDataSize(subIdPath);
}
}));
builtins.emplace(createFunction("dataoffset", 1, 1, SideEffects{}, {LiteralKind::String}, [](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext& _context
) {
yulAssert(_context.currentObject, "No object available.");
yulAssert(_call.arguments.size() == 1, "");
Expression const& arg = _call.arguments.front();
YulName const dataName (formatLiteral(std::get<Literal>(arg)));
if (_context.currentObject->name == dataName.str())
_assembly.appendConstant(0);
else
{
std::vector<size_t> subIdPath =
_context.subIDs.count(dataName.str()) == 0 ?
_context.currentObject->pathToSubObject(dataName.str()) :
std::vector<size_t>{_context.subIDs.at(dataName.str())};
yulAssert(!subIdPath.empty(), "Could not find assembly object <" + dataName.str() + ">.");
_assembly.appendDataOffset(subIdPath);
}
}));
builtins.emplace(createFunction(
"datacopy",
3,
0,
SideEffects{
false, // movable
true, // movableApartFromEffects
false, // canBeRemoved
false, // canBeRemovedIfNotMSize
true, // cannotLoop
SideEffects::None, // otherState
SideEffects::None, // storage
SideEffects::Write, // memory
SideEffects::None // transientStorage
},
{},
[](
FunctionCall const&,
AbstractAssembly& _assembly,
BuiltinContext&
) {
_assembly.appendInstruction(evmasm::Instruction::CODECOPY);
}
));
builtins.emplace(createFunction(
"setimmutable",
3,
0,
SideEffects{
false, // movable
false, // movableApartFromEffects
false, // canBeRemoved
false, // canBeRemovedIfNotMSize
true, // cannotLoop
SideEffects::None, // otherState
SideEffects::None, // storage
SideEffects::Write, // memory
SideEffects::None // transientStorage
},
{std::nullopt, LiteralKind::String, std::nullopt},
[](
if (!_eofVersion.has_value())
{
builtins.emplace(createFunction("datasize", 1, 1, SideEffects{}, {LiteralKind::String}, [](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext&
BuiltinContext& _context
) {
yulAssert(_call.arguments.size() == 3, "");
auto const identifier = (formatLiteral(std::get<Literal>(_call.arguments[1])));
_assembly.appendImmutableAssignment(identifier);
}
));
builtins.emplace(createFunction(
"loadimmutable",
1,
1,
SideEffects{},
{LiteralKind::String},
[](
yulAssert(_context.currentObject, "No object available.");
yulAssert(_call.arguments.size() == 1, "");
Expression const& arg = _call.arguments.front();
YulName const dataName (formatLiteral(std::get<Literal>(arg)));
if (_context.currentObject->name == dataName.str())
_assembly.appendAssemblySize();
else
{
std::vector<size_t> subIdPath =
_context.subIDs.count(dataName.str()) == 0 ?
_context.currentObject->pathToSubObject(dataName.str()) :
std::vector<size_t>{_context.subIDs.at(dataName.str())};
yulAssert(!subIdPath.empty(), "Could not find assembly object <" + dataName.str() + ">.");
_assembly.appendDataSize(subIdPath);
}
}));
builtins.emplace(createFunction("dataoffset", 1, 1, SideEffects{}, {LiteralKind::String}, [](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext&
BuiltinContext& _context
) {
yulAssert(_context.currentObject, "No object available.");
yulAssert(_call.arguments.size() == 1, "");
_assembly.appendImmutable(formatLiteral(std::get<Literal>(_call.arguments.front())));
}
));
Expression const& arg = _call.arguments.front();
YulName const dataName (formatLiteral(std::get<Literal>(arg)));
if (_context.currentObject->name == dataName.str())
_assembly.appendConstant(0);
else
{
std::vector<size_t> subIdPath =
_context.subIDs.count(dataName.str()) == 0 ?
_context.currentObject->pathToSubObject(dataName.str()) :
std::vector<size_t>{_context.subIDs.at(dataName.str())};
yulAssert(!subIdPath.empty(), "Could not find assembly object <" + dataName.str() + ">.");
_assembly.appendDataOffset(subIdPath);
}
}));
builtins.emplace(createFunction(
"datacopy",
3,
0,
SideEffects{
false, // movable
true, // movableApartFromEffects
false, // canBeRemoved
false, // canBeRemovedIfNotMSize
true, // cannotLoop
SideEffects::None, // otherState
SideEffects::None, // storage
SideEffects::Write, // memory
SideEffects::None // transientStorage
},
{},
[](
FunctionCall const&,
AbstractAssembly& _assembly,
BuiltinContext&
) {
_assembly.appendInstruction(evmasm::Instruction::CODECOPY);
}
));
builtins.emplace(createFunction(
"setimmutable",
3,
0,
SideEffects{
false, // movable
false, // movableApartFromEffects
false, // canBeRemoved
false, // canBeRemovedIfNotMSize
true, // cannotLoop
SideEffects::None, // otherState
SideEffects::None, // storage
SideEffects::Write, // memory
SideEffects::None // transientStorage
},
{std::nullopt, LiteralKind::String, std::nullopt},
[](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext&
) {
yulAssert(_call.arguments.size() == 3, "");
auto const identifier = (formatLiteral(std::get<Literal>(_call.arguments[1])));
_assembly.appendImmutableAssignment(identifier);
}
));
builtins.emplace(createFunction(
"loadimmutable",
1,
1,
SideEffects{},
{LiteralKind::String},
[](
FunctionCall const& _call,
AbstractAssembly& _assembly,
BuiltinContext&
) {
yulAssert(_call.arguments.size() == 1, "");
_assembly.appendImmutable(formatLiteral(std::get<Literal>(_call.arguments.front())));
}
));
}
}
return builtins;
}
@@ -355,10 +358,11 @@ std::regex const& verbatimPattern()
}


EVMDialect::EVMDialect(langutil::EVMVersion _evmVersion, bool _objectAccess):
EVMDialect::EVMDialect(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion, bool _objectAccess):
m_objectAccess(_objectAccess),
m_evmVersion(_evmVersion),
m_functions(createBuiltins(_evmVersion, _objectAccess)),
m_eofVersion(_eofVersion),
m_functions(createBuiltins(_evmVersion, _eofVersion, _objectAccess)),
m_reserved(createReservedIdentifiers(_evmVersion))
{
}
@@ -386,22 +390,22 @@ bool EVMDialect::reservedIdentifier(YulName _name) const
return m_reserved.count(_name) != 0;
}

EVMDialect const& EVMDialect::strictAssemblyForEVM(langutil::EVMVersion _version)
EVMDialect const& EVMDialect::strictAssemblyForEVM(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion)
{
static std::map<langutil::EVMVersion, std::unique_ptr<EVMDialect const>> dialects;
static std::map<std::pair<langutil::EVMVersion, std::optional<uint8_t>>, std::unique_ptr<EVMDialect const>> dialects;
static YulStringRepository::ResetCallback callback{[&] { dialects.clear(); }};
if (!dialects[_version])
dialects[_version] = std::make_unique<EVMDialect>(_version, false);
return *dialects[_version];
if (!dialects[{_evmVersion, _eofVersion}])
dialects[{_evmVersion, _eofVersion}] = std::make_unique<EVMDialect>(_evmVersion, _eofVersion, false);
return *dialects[{_evmVersion, _eofVersion}];
}

EVMDialect const& EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion _version)
EVMDialect const& EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion)
{
static std::map<langutil::EVMVersion, std::unique_ptr<EVMDialect const>> dialects;
static std::map<std::pair<langutil::EVMVersion, std::optional<uint8_t>>, std::unique_ptr<EVMDialect const>> dialects;
static YulStringRepository::ResetCallback callback{[&] { dialects.clear(); }};
if (!dialects[_version])
dialects[_version] = std::make_unique<EVMDialect>(_version, true);
return *dialects[_version];
if (!dialects[{_evmVersion, _eofVersion}])
dialects[{_evmVersion, _eofVersion}] = std::make_unique<EVMDialect>(_evmVersion, _eofVersion, true);
return *dialects[{_evmVersion, _eofVersion}];
}

SideEffects EVMDialect::sideEffectsOfInstruction(evmasm::Instruction _instruction)
8 changes: 5 additions & 3 deletions libyul/backends/evm/EVMDialect.h
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ struct BuiltinFunctionForEVM: public BuiltinFunction
struct EVMDialect: public Dialect
{
/// Constructor, should only be used internally. Use the factory functions below.
EVMDialect(langutil::EVMVersion _evmVersion, bool _objectAccess);
EVMDialect(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion, bool _objectAccess);

/// @returns the builtin function of the given name or a nullptr if it is not a builtin function.
BuiltinFunctionForEVM const* builtin(YulName _name) const override;
@@ -82,10 +82,11 @@ struct EVMDialect: public Dialect
BuiltinFunctionForEVM const* storageLoadFunction() const override { return builtin("sload"_yulname); }
YulName hashFunction() const override { return "keccak256"_yulname; }

static EVMDialect const& strictAssemblyForEVM(langutil::EVMVersion _version);
static EVMDialect const& strictAssemblyForEVMObjects(langutil::EVMVersion _version);
static EVMDialect const& strictAssemblyForEVM(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion);
static EVMDialect const& strictAssemblyForEVMObjects(langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion);

langutil::EVMVersion evmVersion() const { return m_evmVersion; }
std::optional<uint8_t> eofVersion() const { return m_eofVersion; }

bool providesObjectAccess() const { return m_objectAccess; }

@@ -96,6 +97,7 @@ struct EVMDialect: public Dialect

bool const m_objectAccess;
langutil::EVMVersion const m_evmVersion;
std::optional<uint8_t> m_eofVersion;
std::map<YulName, BuiltinFunctionForEVM> m_functions;
std::map<std::pair<size_t, size_t>, std::shared_ptr<BuiltinFunctionForEVM const>> mutable m_verbatimFunctions;
std::set<YulName> m_reserved;
2 changes: 1 addition & 1 deletion libyul/backends/evm/NoOutputAssembly.cpp
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ void NoOutputAssembly::appendImmutableAssignment(std::string const&)
}

NoOutputEVMDialect::NoOutputEVMDialect(EVMDialect const& _copyFrom):
EVMDialect(_copyFrom.evmVersion(), _copyFrom.providesObjectAccess())
EVMDialect(_copyFrom.evmVersion(), _copyFrom.eofVersion(), _copyFrom.providesObjectAccess())
{
for (auto& fun: m_functions)
{
6 changes: 5 additions & 1 deletion test/libsolidity/Assembly.cpp
Original file line number Diff line number Diff line change
@@ -56,7 +56,11 @@ evmasm::AssemblyItems compileContract(std::shared_ptr<CharStream> _sourceCode)
{
ErrorList errors;
ErrorReporter errorReporter(errors);
Parser parser(errorReporter, solidity::test::CommonOptions::get().evmVersion());
Parser parser(
errorReporter,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
ASTPointer<SourceUnit> sourceUnit;
BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(*_sourceCode));
BOOST_CHECK(!!sourceUnit);
2 changes: 1 addition & 1 deletion test/libsolidity/MemoryGuardTest.cpp
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ TestCase::TestResult MemoryGuardTest::run(std::ostream& _stream, std::string con
ErrorList errors;
auto [object, analysisInfo] = yul::test::parse(
compiler().yulIR(contractName),
EVMDialect::strictAssemblyForEVMObjects(CommonOptions::get().evmVersion()),
EVMDialect::strictAssemblyForEVMObjects(CommonOptions::get().evmVersion(), CommonOptions::get().eofVersion()),
errors
);

6 changes: 5 additions & 1 deletion test/libsolidity/SolidityExpressionCompiler.cpp
Original file line number Diff line number Diff line change
@@ -108,7 +108,11 @@ bytes compileFirstExpression(
{
ErrorList errors;
ErrorReporter errorReporter(errors);
sourceUnit = Parser(errorReporter, solidity::test::CommonOptions::get().evmVersion()).parse(stream);
sourceUnit = Parser(
errorReporter,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
).parse(stream);
if (!sourceUnit)
return bytes();
}
3 changes: 2 additions & 1 deletion test/libsolidity/SolidityParser.cpp
Original file line number Diff line number Diff line change
@@ -44,7 +44,8 @@ ASTPointer<ContractDefinition> parseText(std::string const& _source, ErrorList&
auto charStream = CharStream(_source, "");
ASTPointer<SourceUnit> sourceUnit = Parser(
errorReporter,
solidity::test::CommonOptions::get().evmVersion()
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
).parse(charStream);
if (!sourceUnit)
return ASTPointer<ContractDefinition>();
15 changes: 9 additions & 6 deletions test/libyul/Common.cpp
Original file line number Diff line number Diff line change
@@ -46,7 +46,10 @@ namespace
{
Dialect const& defaultDialect()
{
return yul::EVMDialect::strictAssemblyForEVM(solidity::test::CommonOptions::get().evmVersion());
return yul::EVMDialect::strictAssemblyForEVM(
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
}
}

@@ -101,11 +104,11 @@ std::string yul::test::format(std::string const& _source)

namespace
{
std::map<std::string const, yul::Dialect const& (*)(langutil::EVMVersion)> const validDialects = {
std::map<std::string const, yul::Dialect const& (*)(langutil::EVMVersion, std::optional<uint8_t>)> const validDialects = {
{
"evm",
[](langutil::EVMVersion _evmVersion) -> yul::Dialect const&
{ return yul::EVMDialect::strictAssemblyForEVMObjects(_evmVersion); }
[](langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion) -> yul::Dialect const&
{ return yul::EVMDialect::strictAssemblyForEVMObjects(_evmVersion, _eofVersion); }
}
};

@@ -118,7 +121,7 @@ std::map<std::string const, yul::Dialect const& (*)(langutil::EVMVersion)> const
}
}

yul::Dialect const& yul::test::dialect(std::string const& _name, langutil::EVMVersion _evmVersion)
yul::Dialect const& yul::test::dialect(std::string const& _name, langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion)
{
if (!validDialects.count(_name))
BOOST_THROW_EXCEPTION(std::runtime_error{
@@ -129,5 +132,5 @@ yul::Dialect const& yul::test::dialect(std::string const& _name, langutil::EVMVe
"."
});

return validDialects.at(_name)(_evmVersion);
return validDialects.at(_name)(_evmVersion, _eofVersion);
}
2 changes: 1 addition & 1 deletion test/libyul/Common.h
Original file line number Diff line number Diff line change
@@ -54,6 +54,6 @@ parse(std::string const& _source, Dialect const& _dialect, langutil::ErrorList&
Block disambiguate(std::string const& _source);
std::string format(std::string const& _source);

solidity::yul::Dialect const& dialect(std::string const& _name, langutil::EVMVersion _evmVersion);
solidity::yul::Dialect const& dialect(std::string const& _name, langutil::EVMVersion _evmVersion, std::optional<uint8_t> _eofVersion);

}
6 changes: 5 additions & 1 deletion test/libyul/CompilabilityChecker.cpp
Original file line number Diff line number Diff line change
@@ -38,7 +38,11 @@ std::string check(std::string const& _input)
auto parsingResult = yul::test::parse(_input);
obj.setCode(parsingResult.first, parsingResult.second);
BOOST_REQUIRE(obj.hasCode());
auto functions = CompilabilityChecker(EVMDialect::strictAssemblyForEVM(solidity::test::CommonOptions::get().evmVersion()), obj, true).stackDeficit;
auto functions = CompilabilityChecker(
EVMDialect::strictAssemblyForEVM(
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
), obj, true).stackDeficit;
std::string out;
for (auto const& function: functions)
out += function.first.str() + ": " + std::to_string(function.second) + " ";
6 changes: 5 additions & 1 deletion test/libyul/ControlFlowGraphTest.cpp
Original file line number Diff line number Diff line change
@@ -45,7 +45,11 @@ ControlFlowGraphTest::ControlFlowGraphTest(std::string const& _filename):
{
m_source = m_reader.source();
auto dialectName = m_reader.stringSetting("dialect", "evm");
m_dialect = &dialect(dialectName, solidity::test::CommonOptions::get().evmVersion());
m_dialect = &dialect(
dialectName,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
m_expectation = m_reader.simpleExpectations();
}

3 changes: 2 additions & 1 deletion test/libyul/ControlFlowSideEffectsTest.cpp
Original file line number Diff line number Diff line change
@@ -62,8 +62,9 @@ TestCase::TestResult ControlFlowSideEffectsTest::run(std::ostream& _stream, std:
if (!obj.hasCode())
BOOST_THROW_EXCEPTION(std::runtime_error("Parsing input failed."));

// TODO: Add EOF support
ControlFlowSideEffectsCollector sideEffects(
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion()),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
obj.code()->root()
);
m_obtainedResult.clear();
4 changes: 3 additions & 1 deletion test/libyul/EVMCodeTransformTest.cpp
Original file line number Diff line number Diff line change
@@ -67,12 +67,14 @@ TestCase::TestResult EVMCodeTransformTest::run(std::ostream& _stream, std::strin
return TestResult::FatalError;
}

// TODO: Add EOF support
evmasm::Assembly assembly{solidity::test::CommonOptions::get().evmVersion(), false, std::nullopt, {}};
EthAssemblyAdapter adapter(assembly);
EVMObjectCompiler::compile(
*stack.parserResult(),
adapter,
EVMDialect::strictAssemblyForEVMObjects(EVMVersion{}),
// TODO: Make sure that why we cannot pass here solidity::test::CommonOptions::get().evmVersion() and assembly.eofVersion()
EVMDialect::strictAssemblyForEVMObjects(EVMVersion{}, std::nullopt),
m_stackOpt,
std::nullopt
);
3 changes: 2 additions & 1 deletion test/libyul/FunctionSideEffects.cpp
Original file line number Diff line number Diff line change
@@ -88,8 +88,9 @@ TestCase::TestResult FunctionSideEffects::run(std::ostream& _stream, std::string
if (!obj.hasCode())
BOOST_THROW_EXCEPTION(std::runtime_error("Parsing input failed."));

// TODO: Add EOF support
std::map<YulName, SideEffects> functionSideEffects = SideEffectsPropagator::sideEffects(
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion()),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
CallGraphGenerator::callGraph(obj.code()->root())
);

3 changes: 2 additions & 1 deletion test/libyul/KnowledgeBaseTest.cpp
Original file line number Diff line number Diff line change
@@ -63,7 +63,8 @@ class KnowledgeBaseTest
return KnowledgeBase([this](YulName _var) { return util::valueOrNullptr(m_values, _var); });
}

EVMDialect m_dialect{EVMVersion{}, true};
// TODO: Add EOF support
EVMDialect m_dialect{EVMVersion{}, std::nullopt, true};
std::shared_ptr<Object> m_object;
SSAValueTracker m_ssaValues;
std::map<YulName, AssignedValue> m_values;
3 changes: 2 additions & 1 deletion test/libyul/ObjectParser.cpp
Original file line number Diff line number Diff line change
@@ -112,7 +112,8 @@ std::tuple<std::optional<SourceNameMap>, ErrorList> tryGetSourceLocationMapping(

ErrorList errors;
ErrorReporter reporter(errors);
Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(EVMVersion::berlin());
// TODO: Add EOF support
Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(EVMVersion{}, std::nullopt);
ObjectParser objectParser{reporter, dialect};
CharStream stream(std::move(source), "");
auto object = objectParser.parse(std::make_shared<Scanner>(stream), false);
129 changes: 86 additions & 43 deletions test/libyul/Parser.cpp

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion test/libyul/SSAControlFlowGraphTest.cpp
Original file line number Diff line number Diff line change
@@ -48,7 +48,11 @@ SSAControlFlowGraphTest::SSAControlFlowGraphTest(std::string const& _filename):
{
m_source = m_reader.source();
auto dialectName = m_reader.stringSetting("dialect", "evm");
m_dialect = &dialect(dialectName, solidity::test::CommonOptions::get().evmVersion());
m_dialect = &dialect(
dialectName,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
m_expectation = m_reader.simpleExpectations();
}

6 changes: 5 additions & 1 deletion test/libyul/StackLayoutGeneratorTest.cpp
Original file line number Diff line number Diff line change
@@ -49,7 +49,11 @@ StackLayoutGeneratorTest::StackLayoutGeneratorTest(std::string const& _filename)
{
m_source = m_reader.source();
auto dialectName = m_reader.stringSetting("dialect", "evm");
m_dialect = &dialect(dialectName, solidity::test::CommonOptions::get().evmVersion());
m_dialect = &dialect(
dialectName,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
m_expectation = m_reader.simpleExpectations();
}

6 changes: 5 additions & 1 deletion test/libyul/SyntaxTest.cpp
Original file line number Diff line number Diff line change
@@ -75,5 +75,9 @@ SyntaxTest::SyntaxTest(std::string const& _filename, langutil::EVMVersion _evmVe
CommonSyntaxTest(_filename, _evmVersion)
{
std::string dialectName = m_reader.stringSetting("dialect", "evm");
m_dialect = &dialect(dialectName, solidity::test::CommonOptions::get().evmVersion());
m_dialect = &dialect(
dialectName,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);
}
2 changes: 1 addition & 1 deletion test/libyul/YulInterpreterTest.cpp
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ std::string YulInterpreterTest::interpret()
{
Interpreter::run(
state,
EVMDialect::strictAssemblyForEVMObjects(solidity::test::CommonOptions::get().evmVersion()),
EVMDialect::strictAssemblyForEVMObjects(solidity::test::CommonOptions::get().evmVersion(), std::nullopt),
m_ast->root(),
/*disableExternalCalls=*/ !m_simulateExternalCallsToSelf,
/*disableMemoryTracing=*/ false
6 changes: 5 additions & 1 deletion test/libyul/YulOptimizerTest.cpp
Original file line number Diff line number Diff line change
@@ -56,7 +56,11 @@ YulOptimizerTest::YulOptimizerTest(std::string const& _filename):
m_source = m_reader.source();

auto dialectName = m_reader.stringSetting("dialect", "evm");
m_dialect = &dialect(dialectName, solidity::test::CommonOptions::get().evmVersion());
m_dialect = &dialect(
dialectName,
solidity::test::CommonOptions::get().evmVersion(),
solidity::test::CommonOptions::get().eofVersion()
);

m_expectation = m_reader.simpleExpectations();
}
3 changes: 2 additions & 1 deletion test/tools/ossfuzz/StackReuseCodegenFuzzer.cpp
Original file line number Diff line number Diff line change
@@ -105,8 +105,9 @@ DEFINE_PROTO_FUZZER(Program const& _input)
YulAssembler assembler{version, std::nullopt, settings, yul_source};
unoptimisedByteCode = assembler.assemble();
auto yulObject = assembler.object();
// TODO: Add EOF support
recursiveFunction = recursiveFunctionExists(
EVMDialect::strictAssemblyForEVMObjects(version),
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt),
*yulObject
);
}
5 changes: 3 additions & 2 deletions test/tools/ossfuzz/strictasm_diff_ossfuzz.cpp
Original file line number Diff line number Diff line change
@@ -87,10 +87,11 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
// such as unused write to memory e.g.,
// { mstore(0, 1) }
// that would be removed by the redundant store eliminator.
// TODO: Add EOF support
yulFuzzerUtil::TerminationReason termReason = yulFuzzerUtil::interpret(
os1,
stack.parserResult()->code()->root(),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion()),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
/*disableMemoryTracing=*/true
);
if (yulFuzzerUtil::resourceLimitsExceeded(termReason))
@@ -100,7 +101,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* _data, size_t _size)
termReason = yulFuzzerUtil::interpret(
os2,
stack.parserResult()->code()->root(),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion()),
EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion(), std::nullopt),
/*disableMemoryTracing=*/true
);

3 changes: 2 additions & 1 deletion test/tools/ossfuzz/yulProtoFuzzer.cpp
Original file line number Diff line number Diff line change
@@ -78,10 +78,11 @@ DEFINE_PROTO_FUZZER(Program const& _input)
)
yulAssert(false, "Proto fuzzer generated malformed program");

// TODO: Add EOF support
// Optimize
YulOptimizerTestCommon optimizerTest(
stack.parserResult(),
EVMDialect::strictAssemblyForEVMObjects(version)
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt)
);
optimizerTest.setStep(optimizerTest.randomOptimiserStep(_input.step()));
auto const* astRoot = optimizerTest.run();
9 changes: 6 additions & 3 deletions test/tools/ossfuzz/yulProto_diff_ossfuzz.cpp
Original file line number Diff line number Diff line change
@@ -87,27 +87,30 @@ DEFINE_PROTO_FUZZER(Program const& _input)
// such as unused write to memory e.g.,
// { mstore(0, 1) }
// that would be removed by the redundant store eliminator.
// TODO: Add EOF support
yulFuzzerUtil::TerminationReason termReason = yulFuzzerUtil::interpret(
os1,
stack.parserResult()->code()->root(),
EVMDialect::strictAssemblyForEVMObjects(version),
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt),
/*disableMemoryTracing=*/true
);

if (yulFuzzerUtil::resourceLimitsExceeded(termReason))
return;

// TODO: Add EOF support
YulOptimizerTestCommon optimizerTest(
stack.parserResult(),
EVMDialect::strictAssemblyForEVMObjects(version)
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt)
);
optimizerTest.setStep(optimizerTest.randomOptimiserStep(_input.step()));
auto const* astRoot = optimizerTest.run();
yulAssert(astRoot != nullptr, "Optimiser error.");
// TODO: Add EOF support
termReason = yulFuzzerUtil::interpret(
os2,
*astRoot,
EVMDialect::strictAssemblyForEVMObjects(version),
EVMDialect::strictAssemblyForEVMObjects(version, std::nullopt),
true
);
if (yulFuzzerUtil::resourceLimitsExceeded(termReason))
2 changes: 1 addition & 1 deletion test/tools/yulopti.cpp
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ class YulOpti

private:
std::shared_ptr<yul::Block> m_astRoot;
Dialect const& m_dialect{EVMDialect::strictAssemblyForEVMObjects(EVMVersion{})};
Dialect const& m_dialect{EVMDialect::strictAssemblyForEVMObjects(EVMVersion{}, std::nullopt)};
std::unique_ptr<AsmAnalysisInfo> m_analysisInfo;
std::set<YulName> const m_reservedIdentifiers = {};
NameDispenser m_nameDispenser{m_dialect, m_reservedIdentifiers};
2 changes: 1 addition & 1 deletion test/tools/yulrun.cpp
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ void interpret(std::string const& _source, bool _inspect, bool _disableExternalC
state.maxTraceSize = 10000;
try
{
Dialect const& dialect(EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion{}));
Dialect const& dialect(EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion{}, std::nullopt));

if (_inspect)
InspectedInterpreter::run(std::make_shared<Inspector>(_source, state), state, dialect, ast->root(), _disableExternalCalls, /*disableMemoryTracing=*/false);
3 changes: 2 additions & 1 deletion tools/yulPhaser/Program.cpp
Original file line number Diff line number Diff line change
@@ -68,7 +68,8 @@ Program::Program(Program const& program):
std::variant<Program, ErrorList> Program::load(CharStream& _sourceCode)
{
// ASSUMPTION: parseSource() rewinds the stream on its own
Dialect const& dialect = EVMDialect::strictAssemblyForEVMObjects(EVMVersion{});
// TODO: Add support for EOF
Dialect const& dialect = EVMDialect::strictAssemblyForEVMObjects(EVMVersion{}, std::nullopt);

std::variant<std::unique_ptr<AST>, ErrorList> astOrErrors = parseObject(dialect, _sourceCode);
if (std::holds_alternative<ErrorList>(astOrErrors))