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

VM: add option to insert/override (custom) precompiles #1706

Closed
jochem-brouwer opened this issue Feb 9, 2022 · 4 comments · Fixed by #1770
Closed

VM: add option to insert/override (custom) precompiles #1706

jochem-brouwer opened this issue Feb 9, 2022 · 4 comments · Fixed by #1770

Comments

@jochem-brouwer
Copy link
Member

It would be nice, especially for custom chains, to insert or override precompiles in the VM. This should be done in the constructor of the VM.

@jochem-brouwer
Copy link
Member Author

This might actually also go well with a slight refactor of the precompiles. We currently would not directly support different precompiles at the same address. These are all hardcoded.

@holgerd77
Copy link
Member

If you identify useful refactorings along these examinations would be great as well, can very well also be breaking, then just do towards develop for the breaking releases.

Also, just to complement: not to forget the "remove" case - beside insert/override, but I guess this can be easily integrated in some coherent data structure, somehting like:

customPrecompiles = {
  address1 (not existing): function(), // insert
  address2 (existing): function(), // override
  address3 (exisiting): undefined // remove
}

? Just a very first shot.

@jochem-brouwer
Copy link
Member Author

Yep, that makes sense, probably will follow the format I'm using in the custom VM opcodes (#1705).

@holgerd77
Copy link
Member

Closed by #1813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants