marigold-dev / marigold-dev/deku

Tendermint tests before integration

Open
#512 0 comments 0 reactions 0 assignees View on GitHub
backlog
Dominant language
OCaml
Stars
82
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hi!

@AngryStitch and I are very please to invite you to test our implementation of Tendermint, available on branch https://github.com/marigold-dev/deku/tree/tendermint-clean before we do an actual merge request.

The algorithm is implemented as a "pure" algorithm in `src/node/tendermint*` files, the entrypoint being `src/node/tendermint.ml`. This code does use mutable state but should not leak it. Integration into deku through `src/node/flows.ml` was much messier, and I haven't eliminated the global state in here, but I don't like it. @EduardoRFS @d4hines thoughts?

Please be aware of the following:
- clocks (timeouts) implementation is unsatisfying and probably a bit buggy; I probably shouldn't have used Lwt.async like that and will try to rework it, I'm open to suggestions.
- consensus **gets definitely stuck if not enough validators are making progress**. This is likely due to the clocks, I will investigate tomorrow. This means that you can kill one validator while the consensus is running, then start it again, but not more than that for now. It sucks, I know.
- it takes quite a while for a late validator to get the right snapshot and join the consensus, I'll also try to improve that soon.
- we modified the `sandbox.sh` script to have 4 validators by default.
- the consensus algorithm can be started manually through the use of the `start_consensus.sh` script. I don't have a good opinion on how to remove this script for the final version and I'm open to suggestions about this as well.
- I propose to modify the style of handlers to explicitly depend on Lwt, as some parts of the code need to be synchronous IMO (i.e., noticing that you're late when you receive a consensus operation, and requesting the previous blocks before starting the consensus). Thoughts?

Contributor guide

No contributing guide indexed for this repository

Research direction

Check the tendermint-clean branch, starting with src/node/tendermint.ml and the integration in src/node/flows.ml. Run sandbox.sh with its four-validator setup and start_consensus.sh, then investigate the noted clock, validator restart, and late-join behavior. Done would require a reliable consensus test result before integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
distributed-systems, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.