You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.9 KiB

  1. # Maverick
  2. ![](https://assets.rollingstone.com/assets/2015/article/tom-cruise-to-fight-drones-in-top-gun-sequel-20150629/201166/large_rect/1435581755/1401x788-Top-Gun-3.jpg)
  3. A byzantine node used to test Tendermint consensus against a plethora of different faulty misbehaviors. Designed to easily create new faulty misbehaviors to examine how a Tendermint network reacts to the misbehavior. Can also be used for fuzzy testing with different network arrangements.
  4. ## Misbehaviors
  5. A misbehavior allows control at the following stages as highlighted by the struct below
  6. ```go
  7. type Misbehavior struct {
  8. String string
  9. EnterPropose func(cs *State, height int64, round int32)
  10. EnterPrevote func(cs *State, height int64, round int32)
  11. EnterPrecommit func(cs *State, height int64, round int32)
  12. ReceivePrevote func(cs *State, prevote *types.Vote)
  13. ReceivePrecommit func(cs *State, precommit *types.Vote)
  14. ReceiveProposal func(cs *State, proposal *types.Proposal) error
  15. }
  16. ```
  17. At each of these events, the node can exhibit a different misbehavior. To create a new misbehavior define a function that builds off the existing default misbehavior and then overrides one or more of these functions. Then append it to the misbehaviors list so the node recognizes it like so:
  18. ```go
  19. var MisbehaviorList = map[string]Misbehavior{
  20. "double-prevote": DoublePrevoteMisbehavior(),
  21. }
  22. ```
  23. ## Setup
  24. The maverick node takes most of the functionality from the existing Tendermint CLI. To install this, in the directory of this readme, run:
  25. ```bash
  26. go build
  27. ```
  28. Use `maverick init` to initialize a single node and `maverick node` to run it. This will run it normally unless you use the misbehaviors flag as follows:
  29. ```bash
  30. maverick node --proxy-app persistent_kvstore --misbehaviors double-vote,10
  31. ```
  32. This would cause the node to vote twice in every round at height 10. To add more misbehaviors at different heights, append the next misbehavior and height after the first (with comma separation).