Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Assume as a validator, we see a block A with an incorrect block number. On the next block we create, we deploy a slashing transaction containing block A's hash and a string saying "incorrect block number". The slashing transaction will call into the PoS contract which will call into a SystemProcess that will call Validate.blockNumber at https://github.com/rchain/rchain/blob/dev/casper/src/main/scala/coop/rchain/casper/Validate.scala#L340 . We know to call into SystemProcess that calls Validate.blockNumber instead of some other Validate.*** as the slashing transaction has a string saying "incorrect block number", so we can match against that. This system call will be similar to SystemProcesses.validateRevAddress https://github.com/rchain/rchain/blob/dev/rholang/src/main/scala/coop/rchain/rholang/interpreter/SystemProcesses.scala#L117 . The system call should take a Seq(blockHash) (this is the block hash of block A) and produce (return) true/false on the ack, so we'll have to do some minor adaptor work from the underlying Validate.blockNumber call. Maybe even change the Validate.blockNumber type signature itself but then we'll have to adjust in Validate.blockSummary and the corresponding tests.

...