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

Fix GenericPrecompileRegistry #36

Closed therealbytes closed 1 month ago

therealbytes commented 1 month ago

Rationale

This is a crucial part of Concrete and the implementation is a bit of a mess right now.

Implementation

Fix the implementation of GenericPrecompileRegistry and test it properly.

Desired implementation:

// AddPrecompiles takes a mapping of precompiles and assigns it to a block.
// These precompiles will be considered to be active in all blocks between the assigned block (inclusive)
// and the next assigned block (exclusive).
AddPrecompiles(startingBlock uint64, precompiles map[common.Address]Precompile)
// AddPrecompile assigns a precompile to a block and address.
AddPrecompile(startingBlock uint64, address common.Address, precompile Precompile)
// Precompiles returns a mapping of all active precompiles in the given block.
Precompiles(blockNumber uint64) map[common.Address]Precompile
// Precompile returns the active precompile at the given block and address, if any, and true if there is one.
Precompile(address common.Address, blockNumber uint64) (Precompile, bool)
// Active precompiles should be removed. Precompiles should only return precompiles that are active.
ActivePrecompiles(blockNumber uint64) []common.Address

[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.

muheebyusufbaba1 commented 1 month ago

i would like to work on this

aji70 commented 1 month ago

i would love to be assigned this task @therealbytes

Naveenkhasyap commented 1 month ago

Hi @therealbytes , I would like to work on this task, I have experience in Golang and love to contribute this project.

I will add the missing methods in the PrecompileRegistry and add missing test cases for those methods as well.
will connect with you guys over Discord for more discussions if needed.