concrete-eth / concrete-geth

Concrete is a framework for building application-specific rollups on the OP Stack
GNU Lesser General Public License v3.0
47 stars 19 forks source link

Test evm2env bindings #41

Closed therealbytes closed 4 weeks ago

therealbytes commented 1 month ago

Rationale

Concrete uses two binding objects concreteBlockContext and concreteEVM in core/vm/evm.go to make EVM methods and data available in the Concrete environment. These are a crucial part of Concrete but are not properly tested.

Implementation

Test each of the binding methods for each of the object listed above.

[ODHack 4.0] Contributors: Note that we highly recommend that you comment on the issue by introducing yourself and how you plan on tackling the issue! Just saying you want an issue is not helpful. This will help with assigning tasks, especially if many comment.

Gift-Naomi commented 1 month ago

@therealbytes Can i work on this?

fabrobles92 commented 1 month ago

I'd love to work on this issue, I plan to tackle this one following the unit test pattern of AAA (Arrange, Act and Assert).

therealbytes commented 1 month ago

@fabrobles92 Assigned you. Please put the tests in a new file with path core/vm/concrete_bindings_test.go.

Feel free to ask if something is not clear. I'm happy to help you get started!

therealbytes commented 1 month ago

As @fabrobles92 reported, there is an issue in the way Concrete handles delegate calls. I am putting this issue on hold while I fix it and assigning him somewhere else.

The issue: a AccountRef is passed as the caller ContractRef when a *Contract is expected. This results in a failing type assertion when making delegate calls through the concrete environment or caller binding.