Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test ledger properties #1765

Closed
mrBliss opened this issue Mar 9, 2020 · 2 comments
Closed

Test ledger properties #1765

mrBliss opened this issue Mar 9, 2020 · 2 comments
Assignees
Labels
byron ledger integration byron Required for a Byron mainnet: replace the old core nodes with cardano-node consensus issues related to ouroboros-consensus testing
Milestone

Comments

@mrBliss
Copy link
Contributor

mrBliss commented Mar 9, 2020

We expect the following properties to hold for each ledger. Formulate them abstractly (for blk) and test them for each ledger, in particular the Byron ledger.

  • Lemma 1:
    for all s >= ledgerTipSlot st,
         anachronisticProtocolLedgerView cfg st s 
      == protocolLedgerView (applyChainTick cfg s st)
    
  • Lemma 2:
         protocolLedgerView (applyLedgerBlock cfg blk state)
      == protocolLedgerView (applyChainTick cfg (blockSlot blk) state)
    
  • Lemma 3:
        applyLedgerBlock cfg blk st
     == repeatedlyM (applyTx cfg) (extractTxs blk)
                    (applyChainTick cfg (blockSlot blk) st)
    
@mrBliss mrBliss added consensus issues related to ouroboros-consensus testing byron ledger integration priority high byron Required for a Byron mainnet: replace the old core nodes with cardano-node labels Mar 9, 2020
@mrBliss mrBliss added this to the S8 2020-03-12 milestone Mar 9, 2020
@mrBliss mrBliss self-assigned this Mar 9, 2020
@edsko
Copy link
Contributor

edsko commented Mar 10, 2020

Lemma (3) isn't quite true. For example, in Byron, endorsements come from the protocol version in the header, and aren't an explicit transaction. Perhaps we could generalize the lemma somewhat.

mrBliss added a commit that referenced this issue Mar 10, 2020
mrBliss added a commit that referenced this issue Mar 10, 2020
iohk-bors bot added a commit that referenced this issue Mar 11, 2020
1775: Implement lemmas 1 & 2 from #1765 r=edsko a=mrBliss

* Add `assertWithMsg`

* Use `Except` for `anachronisticProtocolLedgerView`

  To be consistent with the other ledger methods, e.g., `applyLedgerBlock`.

* Check Lemma 1 from #1765

* Check Lemma 2 from #1765

* Switch the order of validation in `applyExtLedgerState`
  
  Fixes #1771.

Co-authored-by: Thomas Winant <[email protected]>
@mrBliss
Copy link
Contributor Author

mrBliss commented Mar 11, 2020

We moved lemma 3 to IntersectMBO/ouroboros-consensus#699. The other two are checked by #1775.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
byron ledger integration byron Required for a Byron mainnet: replace the old core nodes with cardano-node consensus issues related to ouroboros-consensus testing
Projects
None yet
Development

No branches or pull requests

2 participants