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

Backporting old HF rules #652

Closed
5 tasks done
holgerd77 opened this issue Jan 20, 2020 · 4 comments
Closed
5 tasks done

Backporting old HF rules #652

holgerd77 opened this issue Jan 20, 2020 · 4 comments

Comments

@holgerd77
Copy link
Member

holgerd77 commented Jan 20, 2020

We should really take on backporting the old HF rules rather sooner than later, re-remembered this when @s1na told about his block execution setup in the internal channel. This shouldn't be too hard to do and it would open up the VM to various interesting new use cases if we had a fully HF-supporting code base.

Some context: until mid 2018 the common ground/policy on this library was to "throw away" the old HF code on HF updates (due to economical reasons) and implement the new HF rules. This changed along #304 with the introduction of the overhauled ethereumjs-common library allowing for easier parallel HF integration. Initial integration was on the Byzantium rules, subsequent HFs were then added without deleting the old fork rules.

So the following HFs are currently missing:

  • Frontier / Chainstart
  • Homestead
  • DAO (?)
  • TangerineWhistle
  • Spurious Dragon

The code is still there (along former merged PRs), so this should actually have some good basis to work on (of course things will need some adoption). This should also be a pretty rewarding work. @ryanio @evertonfraga @marcgarreau eventually this is some good task to get more familiar with the VM code.

Probably we should wait with this for after the monorepo transition since this will be easier to implement then, but might also depend on the specific HF to implement.

@ryanio
Copy link
Contributor

ryanio commented Jan 20, 2020

Sounds great, would love to be a part of this work.

@evertonfraga
Copy link
Contributor

I love this idea. Initially, I see lots of fork name comparison to set the correct values. We should first categorize the set of changes required and define a solid plan to implement them.

In a first pass I see these categories of changes. Feel free to add more:

1. New precompiles/opcodes

Should we deny the use of newer opcodes in former HF versions? I guess this behavior is a bit flaky today, but my hunch is yes, we should deny.

2. Opcode repricing

We should make extensive use of the Commons lib to set these values. Today, there's only a fraction of the basic opcodes (chainstart) in the lib. We should have them all in place as the main source of truth.

3. VM optimization/behavior rules, eg: EIP-663

Those can be more complex and need to have fork name comparison to set the new behavior.

@jochem-brouwer
Copy link
Member

Progress:

Homestead: #815

TangerineWhistle: #807

SpuriousDragon: #791

@holgerd77
Copy link
Member Author

Fixed by linked PRs, will close.

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

No branches or pull requests

5 participants