ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

Add option to disable EIPs

Open jochem-brouwer opened this issue 3 years ago • 6 comments

In Common, it would be nice to add an option to disable certain EIPs. The function signature would be disableEIP(eip: number) and disableEIPs(eips: number[]). It is not entirely trivial to just disable them. We should check if other activated EIPs at the current moment depend on the disabled EIP. If that's the case, throw and do not disable any. The user should thus carefully ensure that the list of activated EIPs is in the right order: each time an EIP is deleted, it should at that moment have no dependants.

For instance, if EIP B depends upon EIP A, then disableEIPs([A, B]) would throw, but disableEIPs([B, A]) should not.

jochem-brouwer avatar Feb 03 '22 16:02 jochem-brouwer

Instead of additional methods in common I would rather think this should be added to the common constructor opts, so in addition to the existing eips key we would also add disabledEIPs. I don't think anyone should be disabling EIPs on the fly after the common is already constructed :)

Some of the EIP json definition files in common have a requiredEIPs field, if we ensure they are reliably filled out we can possibly use that for the scenario where other EIPs might depend on a deactivated one.

ryanio avatar Feb 04 '22 19:02 ryanio

Yep, you are right, this should indeed go in the constructor :smile:

jochem-brouwer avatar Feb 09 '22 21:02 jochem-brouwer

We have setEIPs though which means that if I have a Common I can add EIPs - might want to reconsider that at some point? I think it is more clean to have a frozen Common? Especially when situations change, such as added EIPs then the VM should update the opcodes (which we do). Might want to freeze Common forcing users to re-instantiate anything which uses Common if it changes (?). But that is rather cumbersome though...

jochem-brouwer avatar Feb 09 '22 21:02 jochem-brouwer

Related: #1687

jochem-brouwer avatar Feb 09 '22 22:02 jochem-brouwer

We have setEIPs though which means that if I have a Common I can add EIPs - might want to reconsider that at some point? I think it is more clean to have a frozen Common? Especially when situations change, such as added EIPs then the VM should update the opcodes (which we do). Might want to freeze Common forcing users to re-instantiate anything which uses Common if it changes (?). But that is rather cumbersome though...

Yes - also just wrote a similar suggestion in the chat - I guess this method is not really used anywhere anyhow and I would fully agree with your frozen-Common argumentation.

holgerd77 avatar Feb 10 '22 19:02 holgerd77

High level note for eventual implementers: please do not start this task without additional confirmation and/or discussion.

holgerd77 avatar Jul 04 '22 16:07 holgerd77

No follow-up, will close.

holgerd77 avatar Feb 15 '24 12:02 holgerd77