Skip to content

Commit b5f3018

Browse files
committed
fix: library linking time indeterminism (#185)
1 parent 2ee358d commit b5f3018

File tree

33 files changed

+728
-535
lines changed

33 files changed

+728
-535
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
- Moved suppressed messages inside `settings` in standard JSON input
1515
- Moved EraVM artifacts to `contract.eravm` in standard JSON output
1616

17+
### Fixed
18+
19+
- Different bytecode for compile-time and post-compile-time library linking
20+
1721
### Deprecated
1822

1923
- Suppressed messages at the root of standard JSON input

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/04-standard-json.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The input JSON provides the compiler with the source code and settings for the c
2121

2222
Internally, *zksolc* extracts all *zksolc*-specific options and converts the input JSON to the subset expected by *solc* before calling it.
2323

24-
```json
24+
```javascript
2525
{
2626
// Required: Source code language.
2727
// Currently supported: "Solidity", "Yul", "LLVM IR", "EraVM Assembly".
@@ -171,7 +171,7 @@ The output JSON contains all artifacts produced by both *zksolc* and *solc* comp
171171

172172
If *solc* is provided to *zksolc*, the output JSON is initially generated by *solc*, and ZKsync-specific data is appended by *zksolc* afterwards. If *solc* is not provided, the output JSON is generated by *zksolc* alone.
173173

174-
```json
174+
```javascript
175175
{
176176
// Required: File-level outputs.
177177
"sources": {

era-compiler-solidity/src/evmla/ethereal_ir/function/block/element/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,8 @@ where
185185
.value
186186
.ok_or_else(|| anyhow::anyhow!("Instruction value missing"))?;
187187

188-
Ok(Some(
189-
context
190-
.resolve_library(path.as_str())?
191-
.as_basic_value_enum(),
192-
))
188+
era_compiler_llvm_context::eravm_evm_call::linker_symbol(context, path.as_str())
189+
.map(Some)
193190
}
194191
InstructionName::PUSH_Data => {
195192
let value = self

0 commit comments

Comments
 (0)