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.

49 lines
1.1 KiB

  1. # Blockchain Reactor
  2. The Blockchain Reactor's high level responsibility is to enable peers who are
  3. far behind the current state of the consensus to quickly catch up by downloading
  4. many blocks in parallel, verifying their commits, and executing them against the
  5. ABCI application.
  6. Tendermint full nodes run the Blockchain Reactor as a service to provide blocks
  7. to new nodes. New nodes run the Blockchain Reactor in "fast_sync" mode,
  8. where they actively make requests for more blocks until they sync up.
  9. Once caught up, "fast_sync" mode is disabled and the node switches to
  10. using (and turns on) the Consensus Reactor.
  11. ## Message Types
  12. ```go
  13. const (
  14. msgTypeBlockRequest = byte(0x10)
  15. msgTypeBlockResponse = byte(0x11)
  16. msgTypeNoBlockResponse = byte(0x12)
  17. msgTypeStatusResponse = byte(0x20)
  18. msgTypeStatusRequest = byte(0x21)
  19. )
  20. ```
  21. ```go
  22. type bcBlockRequestMessage struct {
  23. Height int64
  24. }
  25. type bcNoBlockResponseMessage struct {
  26. Height int64
  27. }
  28. type bcBlockResponseMessage struct {
  29. Block Block
  30. }
  31. type bcStatusRequestMessage struct {
  32. Height int64
  33. type bcStatusResponseMessage struct {
  34. Height int64
  35. }
  36. ```
  37. ## Protocol
  38. TODO