-
Notifications
You must be signed in to change notification settings - Fork 31
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
Core: Add VM fork activation #67
Conversation
Move to a static identifier so we can check easily if a fork is activated without propagating the activated forks from class to class. We'll want this with the Transaction class constructor to decide whether to marshall new fields.
/** | ||
* Tracks which forks are currently activated. | ||
*/ | ||
public final class ActivatedForks { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think use a global static class object to store the fork information is a good idea. While we can benefit from saving a parameter, it would make unit test much harder and is not modularization friendly.
Go back to previous model.
fixed, once merged, we can propagate checking where necessary. |
} | ||
byte[] data = !forks.isEmpty() | ||
? BlockHeaderData.v1(new BlockHeaderData.ForkSignalSet( | ||
forks.toArray(new ValidatorActivatedFork[forks.size()]))).toBytes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but we should consider abstract the signaling into a method, and add unit test.
new ValidatorActivatedFork.Activation(VIRTUAL_MACHINE, number)); | ||
setActivatedForks(activatedForks); | ||
logger.info("Fork VIRTUAL_MACHINE activated at block {}", number); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, can be cleaned up.
Sounds good. Will clean up in next pr |
Introduce fork code for VM.
This allows us to featureflag processing transactions until we have concensus.