You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mrBliss opened this issue
Feb 4, 2020
· 3 comments
Assignees
Labels
bugSomething isn't workingbyronRequired for a Byron mainnet: replace the old core nodes with cardano-nodeconsensusissues related to ouroboros-consensus
We should verify this at the earliest opportunity we have, which is applyChainState (called for synced headers but also when we apply blocks we produced ourselves, as part of applyExtLedgerState). In addition to check whether block numbers are consecutive, we should also check that the first block has the right block number, i.e., genesisBlockNo.
It is important that we check this, because we're assuming that block numbers are a reliable proxy for chain length. So if this is not the case, we might prefer a chain that is actually shorter. So both consecutiveness and the right initial block number are important. For example, an attacker might forge a single block with a very large block number, and we would incorrectly prefer it over all other chains.
The text was updated successfully, but these errors were encountered:
@nc6 , change of plan, no need to do this for each ledger (although the spec should still verify it, I think). I will do this once and for all for all ledgers. You actually discussed doing that when discussing the Byron integration, albeit for hashes, not block numbers; I'm coming round to your point of view now :) PR to follow, unassigning you from this ticket.
So #1578 cleans up a lot of our BlockNo hygiene, but I'd like to fix IntersectMBO/cardano-base#78 before fixing this ticket, in order to ensure that we don't have other places with bad BlockNo hygiene.
bugSomething isn't workingbyronRequired for a Byron mainnet: replace the old core nodes with cardano-nodeconsensusissues related to ouroboros-consensus
Apparently, nowhere in the Byron or Shelley ledger is it verified that blocks have consecutive block numbers.
We do check it in an assertion
ChainFragment
, but in production, assertions will be disabled.We should verify this at the earliest opportunity we have, which is
applyChainState
(called for synced headers but also when we apply blocks we produced ourselves, as part ofapplyExtLedgerState
). In addition to check whether block numbers are consecutive, we should also check that the first block has the right block number, i.e.,genesisBlockNo
.It is important that we check this, because we're assuming that block numbers are a reliable proxy for chain length. So if this is not the case, we might prefer a chain that is actually shorter. So both consecutiveness and the right initial block number are important. For example, an attacker might forge a single block with a very large block number, and we would incorrectly prefer it over all other chains.
The text was updated successfully, but these errors were encountered: