Skip to content

Instantly share code, notes, and snippets.

@Latrasis
Last active June 27, 2017 02:15
Show Gist options
  • Save Latrasis/02fecd42c5eb0bb4b0a9d11b044cd1fc to your computer and use it in GitHub Desktop.
Save Latrasis/02fecd42c5eb0bb4b0a9d11b044cd1fc to your computer and use it in GitHub Desktop.
RFC on Peer Banning for Grin

Peer Bans

Peers can be banned based on: invalid transactions, blocks, large payloads and large use.

Send Invalid Transaction:

This includes:

  • Invalid UTXO Inputs: self.inputs

    • Empty Inputs Set
    • Or any input with invalid Commitment
  • Invalid UTXO Outputs: self.outputs

    • Empty Outputs Set
    • Or any output with:
      • Invalid OutputFeatures
      • Invalid Commitment
      • Invalid RangeProof
  • Invalid Signature: excess_sig

Send Invalid Block:

This includes:

  • Invalid Header:

    • Invalid Merkle UTXO Root: self.header.utxo_merkle
    • Invalid Merkle Tx Root: self.header.tx_merkle
    • Invalid Block Feature: self.header.feature
    • Invalid Proof (?): self.pow
  • Invalid UTXO Inputs: self.inputs

    • Empty Inputs Set
    • Or any Input with invalid Commitment
  • Invalid UTXO Outputs: self.outputs

    • Empty Outputs Set
    • Or any output with:
      • Invalid OutputFeatures
      • Invalid Commitment
      • Invalid RangeProof
  • Invalid TxKernels: self.kernels

    • Empty Inputs Set
    • Or any TxKernel with:
      • Invalid Commitment
      • Invalid signature

Send Large Payloads

  • Any message type (Block, Tx, etc) that has a size over an X threshold.

Flooding

  • Any peer that is sending over Y Mb/s threshold for longer than Z seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment