-
Notifications
You must be signed in to change notification settings - Fork 773
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
refactor(trie): abstract database implementation with an interface #1917
Conversation
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
Rebased this via UI after testing locally. |
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.
LGTM, great great work, thanks so much! 😄
Will merge.
@holgerd77 would you accept a PR that extracts the |
Could you outline a potential API usage (instantiation) in 4-5 lines? |
Those 2 would be how I imagine it to be used, basically just extracting the existing import { Trie } from "@ethereumjs/trie";
import { LevelDB } from "@ethereumjs/trie-level";
const trie = new Trie({ db: new LevelDB() }); import { Trie } from "@ethereumjs/trie";
import { LevelDB } from "@ethereumjs/trie-level";
import level from "level";
const trie = new Trie({ db: new LevelDB(level("path")) }); |
Ok, thanks, will ask within the team! 🙂 |
(I guess chances are 50:50) |
@holgerd77 created a draft of the changes to show what it would actually entail - https://github.com/faustbrian/ethereumjs-monorepo/commit/da41ce53a0b1b5b124751eec4aa17c5417706d6a |
Thanks a lot for all this pro-active engagement, that's really great!! 👍 I guess we do not have an agreement yet, opinions are somewhat mixed and reserved, will keep you updated! |
Hi there, to follow-up: still no clear opinion crystalizing out. Do you see (have yourself) some substantial practical gains from this separation or is this rather some "we should do it since this is how things should be?" thing? (To be clear: I (and I guess I can say: we) would also very much value the second argument, however in the current situation first argument would give a stronger reasoning to do since we do have to limit ourselves right now and from the "it would be structurally cleaner to do x" perspective we still have a lot on the plate which we would/could/would want to realize at some point (but also can't/won't do right now for very much practical/procedural reasons)) |
(and so be totally transparent on this: my current tendency is to rather not do since this does feel as overloading to me, this this current release round is just already demanding a lot from the team due to it's dramatically large scope it already has) |
Pretty much "how it should be done" but also practical gains resulting from that because then the trie package can be used in browsers which would resolve #1056. Alternatively you could also upgrade |
Thanks, we have various Can you judge on the effort to then bring all of this to level 8? This might then also be a way here, would also fit well in the scope of our release process, to do such an upgrade right now. |
I upgraded it in one of my own applications and that only took an hour with testing if everything worked but I can work on a PR tomorrow and submit a draft during the weekend so you can see what it looks like. |
Uh. If it is not too much of a burden too you this would be great! 💯 Thanks a lot for all these improvement offers - also for being flexible what to integrate. So when you do a Is this strictly a breaking change, or would old DBs still work, do you know that (we would nevertheless do towards Also, in case you do you might want to wait for #1928, this is our very last rebase of |
As far as I am aware from documentation and my own testing there is no breaking changes to the data structures so the databases should be fine. The 8.0 release was primarily API refactors to make the package more flexible for browser and server usage. |
@holgerd77 I subscribed to #1928 and will work on the PR as soon as I get a notification that it is merged. |
Ah, the PR ist just a preparatory test rebase and won't get merged. Instead the result will get pushed as the new develop branch (and so your PR should then still be submitted towards develop). Will notify you once develop is updated. |
@faustbrian Hi there, we have now merged in According to our timeline from #1914 a feature freeze for the v6 |
Will work on it tomorrow or on friday and submit the PR as soon as possible then. |
Resubmission of #1895 with squashed history and rebase on
develop