Skip to content
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

Witness Support #73

Open
holgerd77 opened this issue Jun 17, 2021 · 1 comment
Open

Witness Support #73

holgerd77 opened this issue Jun 17, 2021 · 1 comment

Comments

@holgerd77
Copy link
Member

Witness format specification along the Eth1.x initiative is in development within the stateless-ethereum-specs repository.

The format definition itself is not too much of black magic and I think it makes sense to start on an integration early on to help a bit along on the research and specification side. Scope of the work is limited and there needs to be a start at some point (imagine Prysmatic having waited for the Eth 2.0 specs to finalize 😜).

Things get trickier on the real-life-behavior properties side with demands on stream- and chunkability together with restrictions on memory allocation, see Representation section in the docs. I e.g. first thought to have a separate witness repository with a class-based representation of a witness: this might not be feasible due to the memory constraints?

My suggestion would be to start relatively low and to concentrate on format decoding and to forget about the other properties for now.

We can e.g. add an (experimental) function...

type Witness = Buffer // some basic Buffer-based witness type

Trie.fromWitness(witness: Witness, trie?: Trie): Promise<Trie>

... to the merkle-patricia-tree library a bit analogue (on the signature) to the Trie.fromProof method. Then we can slowly get a better feeling for the format and are driven more to engage in the specs repo and so generally have some starter here to further build upon. I would assume that it should be possible for larger parts of the code created along to be re-used within a more finalized implementation structure going more coherent with the additional properties from the spec. Does this make sense?

One base question here to answer as a pre-requisite is if this makes sense to implement on top of a hex trie implementation, also asked this here ethereum/portal-network-specs#10 on the specs repo.

So eventually we need to reflect on a binary trie strategy (add/implement/re-use) first. Update: see also #16

Other sources:

@holgerd77
Copy link
Member Author

(older issue, moved over from https://github.com/ethereum/js-team-organization repository)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant