-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Labels
bug 🐛Something isn't workingSomething isn't workingneeds triage ♟️Issue needs to be picked up or assignedIssue needs to be picked up or assigned
Description
Component
Forge
Describe the bug
#1078 introduced a fix for test contract not being available in EraVM context.
However, it has a bug: immutable values are not migrated for it.
To reproduce, remote the #[ignore] attribute on the test_zk_can_invoke_test_contract_with_immutables test added in the abovementioned PR -- it will fail.
The exact approach to fix the bug is not clear. I see two options:
- Try to deduce the slots for
ImmutableSimulatorbased on deployed bytecode and immutable references. Not sure if it's possible:zksolcassigns slots for the simulator based on the order in which values are assigned, not declared, and AFAIU we can't get this information easily. - Try to deploy the contract in the EraVM context and check which slots will be set. This feels error-prone, since a lot of factors can cause different values for immutables between EraVM and EVM. If we're going to go this way, I would probably suggest to add a safety check: after getting immutables for EraVM contract, extract values from deployed EVM contract and ensure that
set(eravm_immutable_values) == set(evm_immutable_values).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't workingneeds triage ♟️Issue needs to be picked up or assignedIssue needs to be picked up or assigned
Type
Projects
Status
Todo