-
Notifications
You must be signed in to change notification settings - Fork 758
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
Major Version Release Planning / Refactor Strategy / v3 and v4 Releases #455
Comments
Ok, ready with some first write-up. |
This is amazing, thanks a lot! I had a question: do you think transitioning to a monorepo is something we can consider maybe for v4? I still maintain it'd help a lot with maintenance. |
Regarding monorepo: what I think might be very well in the scope is that we separate into the modules you prepared (state, bloom, vm, outer VM/Processing). |
@s1na I think we should put a bit more active thinking in how to introduce eWASM along with the releases. One thing I was wondering: is the Would it be a way to start using the EEI on EVM 1.0 together with a refactored Side thought: I wondered if gas handling could also be refactored similar to |
I think we should generally try to get this @s1na Can you have a look at the missing code modernization parts and generally have one step-back-view on stuff here? |
First a general note: While I completely agree with and understand the need for an outlook, the problem is that I'm not so well-versed in the library to be able to come up with a concrete plan/design in advance, without playing around and trying out a bunch of stuff (e.g. #424 which was my first stab at refactoring the VM) until one works! 😅 One reason I'm pursuing both ewasm integration and evm refactoring at the same time is to be able to understand what's common between them and can be abstracted, and answer questions such as the ones you mentioned. But my rough plan is really similar to all you described, basically try to have all these abstractions (EEI, limited I agree about gas handling, I'm not sure what the structure would look like however as of yet, do you have any ideas there?
I was thinking about this, and one strategy we might try in future is to have all major refactoring in a different branch and in the meanwhile if there were any bug fixes, But for the upcoming release, what would you like to have in the release that's not there now so I can prioritize them? (btw, from my perspective, we could already do a release (UPDATE: after #466), since the ES6 modernization shouldn't effect the users and can be shipped in a minor release, if that's the only thing left). |
Makes all very much sense, will give a more detailed answer later the day. |
Some more in-depth answer: the approach to experiment on various fronts until things settle and one get a better hold of the breadth of the changes needed and a feeling for the approaches which might work best make very much sense, so I would very much encourage you to continue this like you are doing right now. We can then reflect every now and then how if we roll things out and what is settled enough to be planned in for a future release and what might generally be a good strategy which would fit. Yeah, probably for the next major release Beyond moving the gas related functions from For the next release we have already one major breaking change with #451 (hookedVM removal), so if we don't want to revert here we have to do some |
One on-top question: is using an This would complete the first point in the list above. Do you have any other code modernization wishes we should integrate in this round? |
(Sorry, mixed up the release version numbers and always had one to low, updated this now) |
@s1na Unrelated, was wondering:
|
|
If you go along with both can you prepare a PR? |
Informational note: atm I would target a v3 release for next Wednesday or Thursday since we seem to have everything together and then we nevertheless have a couple of days to settle down and prepare a bit. |
Sounds good! By the way, how do you think we can test major releases before publishing to npm? Maybe try upgrading ethereumjs-vm in a dependent project and run the tests to get a rough idea? |
Hmm, not sure. Do you really think we should take on this and this is our job? At the end this is a breaking release, and things not to work is to some extend expected. I see a bit the danger that once one starts with this it will draw very much in and take too much time, since we can't do the work on e.g. the Ganache side to do the integration there. If you have low level/easy-to-apply ideas let me know, not totally against it though. |
@holgerd77 So far
These were just ideas at the top of my head. If you think any of them has merit I can create an issue for it for further discussion. |
@s1na Yes, that definitely makes sense to take the occasion and do preparatory breaking changes. Some thoughts:
|
//cc @krzkaczor Thanks for your assessment on the devp2p TypeScript questions, super helpful! 😄 Do you think the time is there to completely switch to a promise-based API on the VM, or should one still support both promises and callbacks? Discussing this above... |
@holgerd77 no problem ;)
|
I was planning to start a discussion in the organization repo today about this. Node 12 has already been released, and it has async stack traces if you stick to IMO this is the major DX improvement in the JS ecosystem since For this to work in the VM almost every EthereumJS library has to be changed, which is a huge task that we shouldn't hurry. For now, we just need to start exposing only promise-based APIs. For legacy code, we can create something similar but opposite to what @s1na did with the promisified StateManager, or recommend using |
@krzkaczor do you mean something like this, or is there a better way? typedoc doesn't seem to detect these default values :( Ok there seems to be consensus on exposing only a promised-based API. Most of the methods are already calling a promisified private method internally, so it shouldn't be difficult. I think only |
@s1na I actually thought about something like: const default = {
x = 5
}
const finalArgs = {
...default,
...args,
} but yours solution is also quite nice! |
What do you think about releasing new versions of the other libs that have been migrated to TS and updated them here before v4? Things like this could be typed if we do that: tx: any // TODO: Update ethereumjs-tx
blockchain: any // TODO: update to ethereumjs-blockchain v4.0.0 |
@alcuadrado Yeah, that would make very much sense, let's definitely do this before (beta) release already!
|
I'm super busy today. I can do it tomorrow. I created an issue in |
👍 |
Would something like
let us use both |
I'm pretty sure that's not possible @davidmurdoch. One thing that we could do is to stop using default exports. That way you could import this module with |
I did a quick test with one of TS projects and it does seem to work. Though I didn't test very thoroughly. May be worth investigating alternatives to exporting a |
That caught my attention, so I made this test.
{
"extends": "@ethereumjs/config-tsc",
"compilerOptions": {
"outDir": "./dist"
}
}
const a = 1;
export default a;
// This never gets exported
export const b = 2;
module.exports = a; Compilation output: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var a = 1;
exports.default = a;
// This never gets exported
exports.b = 2;
module.exports = a;
//# sourceMappingURL=index.js.map As you can see, this beaks the TS modules as soon as you export more things. Assigning I kept reading about this and found another alternative. We can use the IMO we should avoid default exports. This is starting to get a pretty common practice in TS and ESM-based js. /cc @krzkaczor |
If that's the case we can start changing the default exports to named ones ( |
//cc @dryajov (context for others: Dmitriy worked on the devp2p library TypeScript transition, see ethereumjs/ethereumjs-devp2p#51). |
This process has been finished with the |
This is a meta issue for planning the next releases and discussing a refactoring strategy, the refactoring strategy not mainly from the point WHAT to do but WHEN to introduce and how to work on in what order, the WHAT parts should be discussed in the respective issues or PRs:
Some personal pre-note on releases: regarding semantic versioning I for a long time couldn't be so consequent to fully apply this for the VM. This has historical reasons since we were doing HF updates on minor releases and I had so much respect that I didn't dare to do any major version releases. 😄 😄 😄 I would take this current work as an occasion to change this, think we should really just apply semantic versioning here (and especially here) on the VM, everything else just doesn't make sense on a clear and step-back view. Let me know if you have thoughts on this.
Regarding a release strategy I would suggest that we do two follow-up major version releases:
Version v3.0 release: Local refactoring and code modernization
ES6
modernization, Migrate stateManager and storageReader to es6 class syntax #452, Convert Bloom to es6 class #428 (released), Convert VM to es6 class #478hookedVM
, Drop createHookedVm #451fakeBlockchain
, TODOMemory
class, Refactor evm and prepare for ewasm integration #424, Refactor memory manipulation in evm #442Stack
class, TODO, Refactor evm and prepare for ewasm integration #424This list is not complete and doesn't imply that other work can be integrated.
Version v4.0 release: System wide refactoring / TypeScript / eWASM
TypeScript
transition (or move this to v3.0?)evm
refactoring withInterpreter
, opcode and environment (EEI
classes), see discussion here, discuss in EVM refactoring #456eWASM
integration here or maybe also one release later?, Refactor evm and prepare for ewasm integration #424, Basic support for ewasm precompiles #431Bloom
,StateManager
(or do this later on av5.0
release)This is just a draft for some discussion start. We should update this list over time to keep up with the current state of discussion.
Note: feel free to directly edit this list.
The text was updated successfully, but these errors were encountered: