Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Make patricia-trie usable from Polkadot (WAS: Extract patricia-trie to its own repo) #8620

Closed
rphmeier opened this issue May 14, 2018 · 5 comments
Assignees
Labels
F6-refactor 📚 Code needs refactoring. M5-dependencies 🖇 Dependencies.
Milestone

Comments

@rphmeier
Copy link
Contributor

Along with various bits of generalization in it and its dependencies to make generic over hash function, hash type, and node encoding and decoding.

CC paritytech/polkadot#157

@rphmeier rphmeier added the F6-refactor 📚 Code needs refactoring. label May 14, 2018
@dvdplm dvdplm self-assigned this May 14, 2018
@dvdplm
Copy link
Collaborator

dvdplm commented May 15, 2018

Tasks:

  • make trait Hash generic over the hashing algorithm (investigate doing this in the hashdb crate, see Modifications for better cross-project use of HashDB/Patricia Trie #7019)
  • make Node generic over hash; add a NodeCodec trait
  • implement NodeCodec for rlp
  • make sure encoding does not suffer performance hit; investigate using smallvec here
  • port structures like TrieDB to be generic TrieDB<H: Hash, C: NodeCodec<H>>

@rphmeier looks about right to you? I'd like to do the extractions asap to avoid merge conflicts down the line as people might be making changes to the in-tree versions of the crates.

dvdplm added a commit that referenced this issue May 15, 2018
Move the rlp out of tree and use the crate from crates.io. Part of issue #8620.
dvdplm added a commit that referenced this issue May 15, 2018
Use triehash and trie-standardmap from crates.io

Part of #8620.
dvdplm added a commit that referenced this issue May 15, 2018
Part of ##8620

NOTE: pending publication of v1.12 on crates.io
@rphmeier
Copy link
Contributor Author

Looks about right. We might want to introduce a small crate just for the hash trait so other code (hashdb, triehash, etc.) can depend on it, and a separate crate for rlp-node-codec.

@debris
Copy link
Collaborator

debris commented May 17, 2018

Sorry for not replying immediately to this thread. I don't agree with one of the points here, which is extract patricia_trie's in-tree dependencies into own repos. I believe it's redundant and will introduce a lot of maintenance burden.

extract trie-standardmap – @debris this code does not have a license; you ok with GPL v3?

great catch, sure!

extract plain_hasher – @debris this crate is owned by you so I can't push updates. Can you transfer it to parity?

historically, plain_hasher was a separate repo, but it's usecase is very specific for us, and after discussing it with Arkadiy, I decided to move it to parity to avoid maintenance burden.

@5chdn 5chdn added this to the 1.12 milestone May 17, 2018
@5chdn 5chdn added the M5-dependencies 🖇 Dependencies. label May 17, 2018
@5chdn
Copy link
Contributor

5chdn commented May 17, 2018

I have no strong opinion here, but I want to highlight that we should rename ethcore-* crates to parity-* soon. If we touch this code now, let's keep it in mind. cc #8649

@dvdplm dvdplm changed the title Extract patricia-trie to its own repo Make patricia-trie usable from Polkadot (WAS: Extract patricia-trie to its own repo) Jun 6, 2018
@5chdn 5chdn modified the milestones: 2.0, 2.1 Jul 17, 2018
@5chdn 5chdn modified the milestones: 2.1, 2.2 Sep 11, 2018
@5chdn 5chdn modified the milestones: 2.2, 2.3 Oct 29, 2018
@5chdn 5chdn modified the milestones: 2.3, 2.4 Jan 10, 2019
@5chdn 5chdn removed this from the 2.4 milestone Feb 21, 2019
@5chdn 5chdn added this to the 2.5 milestone Feb 21, 2019
@soc1c soc1c modified the milestones: 2.5, 2.6 Apr 2, 2019
@ordian ordian modified the milestones: 2.6, 2.7 Jul 12, 2019
@adria0
Copy link

adria0 commented Jul 27, 2020

Closing the issue due to its stale state

@adria0 adria0 closed this as completed Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F6-refactor 📚 Code needs refactoring. M5-dependencies 🖇 Dependencies.
Projects
None yet
Development

No branches or pull requests

7 participants