marigold-dev / marigold-dev/pollinate

Use maps instead of hashtables for pairing responses and requests

Open
#20 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
OCaml
Stars
22
Forks
3
PR merge metrics
No merged PRs in 30d

Description

In order to match requests and responses, an index is used to identify them as a pair. A map should be used to store these data instead of a hashtable. See below.

> Why [not use hashtables]? What do you want us to use instead?

> Maps, Hashtbl's are mutable but they also have collision, which makes them quite tricky to analyze, especially in a critical environment such as a blockchain, so don't use them unless you really need that additional bit of performance

_Originally posted in https://github.com/marigold-dev/deku/issues/432#issuecomment-1046873460_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the request/response pairing logic in the OCaml code and identify where the index is stored in a hashtable. Read the surrounding UDP P2P communication flow before changing the data structure. Done means pairing continues to match each response with its request without relying on the hashtable.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
networking
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.