Aller au contenu principal

Test Results for hydra-node

Hydra.Utils

  • Should throw if it can't write on disk
  • Should throw if the file already exists

Hydra.Persistence

PersistenceIncremental

  • can handle empty files

  • is consistent after multiple append calls in presence of new-lines

    Details
    +++ OK, passed 100 tests:
    73% some item contains a new line
    8% no items stored
  • it cannot load from a different thread once having started appending

    Details
    +++ OK, passed 100 tests.

Persistence

  • can handle empty files

  • is consistent after save/load roundtrip

    Details
    +++ OK, passed 100 tests.

Hydra.Party

Ord

  • is transitive

    Details
    +++ OK, passed 100 tests; 622 discarded.
  • is reflexive

    Details
    +++ OK, passed 100 tests.
  • is antisymmetric

    Details
    +++ OK, passed 100 tests.
  • implements Eq and Ord correspondingly

    Details
    +++ OK, passed 100 tests.

JSON encoding of Party

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/Party.json

  • has alice, bob, carol sorted

Hydra.Options

Hydra Node RunOptions

  • validateRunOptions: using more than 5 parties should error out

  • validateRunOptions: loaded cardano keys needs to match with the hydra keys length

  • parses with default values

  • parses --host option given valid IPv4 and IPv6 addresses

  • parses --port option given valid port number

  • parses --peer <host>:<port> option

  • does parse --peer given ipv6 addresses

  • parses --monitoring-port option given valid port number

  • flag --version returns version with base version from cabal

  • parses --hydra-verification-key option as a filepath

  • parses --hydra-signing-key option as a filepath

  • parses --testnet-magic option as a number

  • parses --mainnet option

  • parses --contestation-period option as a number of seconds

  • parses --mainnet flag

  • parses --node-socket as a filepath

  • parses --cardano-signing-key option as a filepath

  • parses --cardano-verification-key option as a filepath

  • parses --ledger-protocol-parameters-file as a filepath

  • parses --start-chain-from as a pair of slot number and block header hash

  • parses --start-chain-from 0 as starting from genesis

  • parses --hydra-scripts-tx-id as a tx id

    Details
    +++ OK, passed 100 tests.
  • switches to offline chain when using --initial-utxo

JSON encoding of RunOptions

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/RunOptions.json

gen-hydra-keys sub-command

  • should be able to parse gen-hydra-keys sub-command
  • should parse gen-hydra-keys without the output-file flag using default file name

offline sub-command

  • does parse with defaults
  • does parse --ledger-genesis
  • does parse --initial-utxo

publish-scripts sub-command

  • does not parse without any options

  • does not parse with some missing option (1)

  • does not parse with some missing option (2)

  • does not parse with some missing option (3)

  • should parse using testnet and all options

  • should parse using mainnet and all options

  • roundtrip parsing & printing

    Details
    +++ OK, passed 100 tests.

Hydra.Node.Run

  • throws exception given options are invalid

Hydra.Node.InputQueue

  • adds sequential id to all enqueued items

    Details
    +++ OK, passed 100 tests.

Hydra.Node

checkHeadState

  • accepts configuration consistent with HeadState
  • throws exception given contestation period differs
  • throws exception given parties differ
  • log error given configuration mismatches head state

stepHydraNode

  • events are sent to all sinks

  • event ids are strictly monotonic

    Details
    +++ OK, passed 100 tests.
  • can continue after re-hydration

  • emits a single ReqSn and AckSn as leader, even after multiple ReqTxs

  • rotates snapshot leaders

  • processes out-of-order AckSn

  • notifies client when postTx throws PostTxError

  • signs snapshot even if it has seen conflicting transactions

hydrate

  • loads events from source into all sinks

    Details
    +++ OK, passed 100 tests.
  • event ids are consistent

    Details
    +++ OK, passed 100 tests.
  • fails if one sink fails

    Details
    +++ OK, passed 100 tests.
  • checks head state

    Details
    +++ OK, passed 100 tests.

Hydra.Network.Reliability

sending messages

  • broadcast messages to the network assigning a sequential id

    Details
    +++ OK, passed 100 tests.
  • stress test networking layer

    Details
    +++ OK, passed 5000 tests.

    Messages from Alice to Bob (5000 in total):
    32.46% < 10
    20.18% < 20
    13.16% < 30
    10.68% < 40
    8.24% < 50
    5.56% < 60
    4.58% < 70
    2.98% < 80
    1.60% < 90
    0.56% < 100

    Messages from Bob to Alice (5000 in total):
    33.04% < 10
    19.52% < 20
    13.42% < 30
    10.44% < 40
    7.58% < 50
    6.00% < 60
    5.10% < 70
    2.66% < 80
    1.86% < 90
    0.38% < 100
  • broadcast updates counter from peers

  • appends messages to disk and can load them back

receiving messages

  • forward received messages

  • do not drop messages with same ids from different peers

  • Ignores messages with malformed acks

  • drops already received messages

    Details
    +++ OK, passed 100 tests:
    65% 0
    27% 1
    5% 2
    3% 3

Hydra.Network.Heartbeat

  • sends a heartbeat message with local host after 500 ms
  • sends Connected when Ping received from other peer
  • sends Connected when any message received from other party
  • do not send Connected on subsequent messages from already Connected party
  • sends Disconnected given no messages has been received from known party within twice heartbeat delay
  • stop sending heartbeat message given action sends a message
  • restart sending heartbeat messages given last message sent is older than heartbeat delay

Hydra.Network.Authenticate

  • pass the authenticated messages around
  • drop message coming from unknown party
  • drop message coming from party with wrong signature
  • authenticate the message to broadcast
  • logs dropped messages

Serialization

  • can roundtrip CBOR encoding/decoding of Signed Hydra Message

    Details
    +++ OK, passed 100 tests.

JSON encoding of AuthLog

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/AuthLog.json

Hydra.Network

configureMessagePersistence

  • throws ParameterMismatch when configuring given number of acks does not match number of parties

Serialisation

  • can roundtrip CBOR encoding/decoding of Hydra Message

    Details
    +++ OK, passed 100 tests.

JSON encoding of (Message SimpleTx)

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/Message SimpleTx.json

Ouroboros Network

  • broadcasts messages to single connected peer
  • broadcasts messages between 3 connected peers

Hydra.Model.MockChain

  • works with valid transaction

    Details
    +++ OK, passed 100 tests.

Hydra.Model

  • model should not generate 0 Ada UTxO

    Details
    +++ OK, passed 10000 tests.
  • model generates consistent traces

    Details
    +++ OK, passed 10000 tests.
  • implementation respects model

    Details
    +++ OK, passed 100 tests.

    Action polarity (716 in total):
    100.0% +

    Actions (716 in total):
    34.6% +NewTx
    21.9% +Commit
    13.1% +Seed
    12.3% +Init
    5.2% +Abort
    4.5% +Close
    4.5% +Fanout
    3.9% +RollbackAndForward

    Transitions (716 in total):
    37.7% Open -> Open
    15.8% Initial -> Initial
    13.1% Start -> Idle
    12.3% Idle -> Initial
    6.1% Initial -> Open
    5.2% Initial -> Final
    4.5% Closed -> Final
    4.5% Open -> Closed
    0.8% Closed -> Closed
  • check conflict-free liveness

    Details
    +++ OK, passed 100 tests.

    Action polarity (773 in total):
    100.0% +

    Actions (773 in total):
    29.4% +NewTx
    17.3% +Commit
    12.9% +StopTheWorld
    12.0% +Seed
    11.3% +Init
    4.7% +Abort
    3.9% +Close
    3.8% +Fanout
    3.0% +RollbackAndForward
    0.9% +ObserveConfirmedTx
    0.9% +Wait

    Transitions (773 in total):
    34.7% Open -> Open
    14.4% Initial -> Initial
    12.0% Start -> Idle
    11.3% Idle -> Initial
    8.4% Final -> Final
    4.8% Initial -> Open
    4.7% Initial -> Final
    3.9% Open -> Closed
    3.8% Closed -> Final
    0.9% Start -> Start
    0.8% Idle -> Idle
    0.5% Closed -> Closed
  • check head opens if all participants commit

    Details
    +++ OK, passed 100 tests.

    Action polarity (726 in total):
    100.0% +

    Actions (726 in total):
    44.9% +Commit
    13.8% +Init
    13.8% +ObserveHeadIsOpen
    13.8% +Seed
    13.8% +Wait

    Transitions (726 in total):
    31.1% Initial -> Initial
    27.5% Open -> Open
    13.8% Idle -> Initial
    13.8% Initial -> Open
    13.8% Start -> Idle
  • fanout contains whole confirmed UTxO

    Details
    +++ OK, passed 100 tests.

    Action polarity (787 in total):
    100.0% +

    Actions (787 in total):
    28.8% +NewTx
    17.0% +Commit
    12.7% +StopTheWorld
    11.8% +Seed
    11.1% +Init
    4.7% +Close
    4.6% +Abort
    4.6% +Fanout
    2.9% +RollbackAndForward
    0.9% +ObserveConfirmedTx
    0.9% +Wait

    Transitions (787 in total):
    33.2% Open -> Open
    14.1% Initial -> Initial
    11.8% Start -> Idle
    11.1% Idle -> Initial
    9.1% Final -> Final
    4.7% Initial -> Open
    4.7% Open -> Closed
    4.6% Closed -> Final
    4.6% Initial -> Final
    0.9% Start -> Start
    0.8% Idle -> Idle
    0.5% Closed -> Closed
  • toRealUTxO is distributive

    Details
    +++ OK, passed 100 tests.
  • toTxOuts is distributive

    Details
    +++ OK, passed 100 tests.
  • parties contest to wrong closed snapshot

    Details
    +++ OK, passed 100 tests.

    Action polarity (1326 in total):
    100.00% +

    Actions (1326 in total):
    24.59% +Commit
    15.08% +Wait
    7.54% +CloseWithInitialSnapshot
    7.54% +Fanout
    7.54% +Init
    7.54% +NewTx
    7.54% +ObserveConfirmedTx
    7.54% +ObserveHeadIsOpen
    7.54% +Seed
    7.54% +StopTheWorld

    Transitions (1326 in total):
    37.71% Open -> Open
    17.04% Initial -> Initial
    7.54% Closed -> Final
    7.54% Final -> Final
    7.54% Idle -> Initial
    7.54% Initial -> Open
    7.54% Open -> Closed
    7.54% Start -> Idle

Hydra.Logging.Monitoring

  • provides prometheus metrics from traces

Hydra.Logging

  • dumps logs to stdout in JSON with timestamp

  • Validates logs.yaml schema

    Details
    +++ OK, passed 1 test.
  • Schema covers all defined log entries

    Details
    +++ OK, passed 100 tests.

Hydra.Ledger.Simple

  • validates only correctly built transactions

    Details
    +++ OK, passed 100 tests.

Hydra.Ledger.Cardano.Time

  • roundtrip slotNoToUTCTime and slotNoFromUTCTime

    Details
    +++ OK, passed 100 tests.
  • slotNoFromUTCTime works for any time

    Details
    +++ OK, passed 100 tests:
    53% before system start
    45% after system start
    2% equal to system start

Hydra.Ledger.Cardano

Generators

  • arbitrary @TxIn is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.
  • arbitrary @TxId is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.
  • arbitrary @(VerificationKey PaymentKey) is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.
  • arbitrary @(Hash PaymentKey) is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.
  • genUTxOAlonzo does not generate collapsing values

    Details
    +++ OK, passed 100 tests.
  • genUTxOAdaOnlyOfSize does not generate collapsing values

    Details
    +++ OK, passed 100 tests.
  • genUTxOFor is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.
  • genOneUTxOFor is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.

genValue

  • produces realistic values

    Details
    +++ OK, passed 100 tests.

genOutput

  • has enough lovelace to cover assets

    Details
    +++ OK, passed 100 tests.

genTxOut

  • does generate good values

    Details
    +++ OK, passed 100 tests:
    65% has datum
    55% has multiple assets
    53% is VK output
    47% is Script output
    45% has only ADA

applyTransactions

  • works with valid transaction

    Details
    +++ OK, passed 100 tests.
  • works with valid transaction deserialised from JSON

    Details
    +++ OK, passed 100 tests.

Tx

JSON encoding of (ReasonablySized (Tx BabbageEra))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (Tx BabbageEra).json

  • Same TxId before/after JSON encoding

    Details
    +++ OK, passed 100 tests.
  • Same TxId as TxBody after JSON decoding

    Details
    +++ OK, passed 100 tests.
  • Roundtrip to and from Ledger

    Details
    +++ OK, passed 100 tests.
  • Roundtrip CBOR encoding

    Details
    +++ OK, passed 100 tests.
  • JSON encoding of Tx according to schema

    Details
    +++ OK, passed 5 tests.

ProtocolParameters

  • Roundtrip JSON encoding

    Details
    +++ OK, passed 100 tests.

UTxO

JSON encoding of (UTxO' (TxOut CtxUTxO BabbageEra))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/UTxO' (TxOut CtxUTxO BabbageEra).json

  • JSON encoding of UTxO according to schema

    Details
    +++ OK, passed 1 test.
  • parses a specific UTxO

  • Roundtrip to and from Api

    Details
    +++ OK, passed 100 tests.

JSON encoding of AssetName

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/AssetName.json

Hydra.JSONSchema

prop_validateJSONSchema

  • works with api.yaml and UTCTime

    Details
    +++ OK, passed 1 test.

validateJSON withJsonSpecifications

  • works using identity selector and Null input
  • fails on non-existing schema file
  • fails with missing tool
  • selects a sub-schema correctly
  • produces helpful errors
  • resolves refs

Hydra.HeadLogicSnapshot

On AckSn

  • sends ReqSn when leader and there are seen transactions
  • does NOT send ReqSn when we are the leader but there are NO seen transactions
  • does NOT send ReqSn when we are NOT the leader but there are seen transactions
  • updates seenSnapshot state when sending ReqSn

On ReqTx

  • always emit ReqSn given head has 1 member

    Details
    +++ OK, passed 100 tests.
  • sends ReqSn when leader and no snapshot in flight

  • does NOT send ReqSn when we are NOT the leader even if no snapshot in flight

  • does NOT send ReqSn when we are the leader but snapshot in flight

  • updates seenSnapshot state when sending ReqSn

Generic Snapshot property

  • there's always a leader for every snapshot number

    Details
    +++ OK, passed 100 tests; 21 discarded.

Hydra.HeadLogic

Coordinated Head Protocol using real Tx

  • any tx with expiring upper validity range gets pruned

    Details
    +++ OK, passed 100 tests.

Coordinated Head Protocol

  • reports if a requested tx is expired
  • waits if a requested tx is not (yet) applicable
  • confirms snapshot given it receives AckSn from all parties

Tracks Transaction Ids

  • keeps transactions in allTxs given it receives a ReqTx

  • removes transactions in allTxs given it receives a ReqSn

  • removes transactions from allTxs when included in a acked snapshot even when emitting a ReqSn

  • rejects last AckSn if one signature was from a different snapshot

  • rejects last AckSn if one signature was from a different key

  • rejects last AckSn if one signature was from a completely different message

  • rejects last AckSn if already received signature from this party

  • waits if we receive a snapshot with transaction not applicable on previous snapshot

  • waits if we receive a snapshot with unseen transactions

  • waits if we receive an AckSn for an unseen snapshot

  • rejects if we receive a too far future snapshot

  • waits if we receive a future snapshot while collecting signatures

  • acks signed snapshot from the constant leader

  • does not ack snapshots from non-leaders

  • rejects too-old snapshots

  • rejects too-old snapshots when collecting signatures

  • rejects too-new snapshots from the leader

  • rejects overlapping snapshot requests from the leader

  • ignores in-flight ReqTx when closed

  • everyone does collect on last commit after collect com

  • cannot observe abort after collect com

  • cannot observe collect com after abort

  • notifies user on head closing and when passing the contestation deadline

  • contests when detecting close with old snapshot

  • re-contests when detecting contest with old snapshot

  • ignores unrelated initTx

    Details
    +++ OK, passed 100 tests.
  • ignores abortTx of another head

    Details
    +++ OK, passed 100 tests.
  • ignores collectComTx of another head

    Details
    +++ OK, passed 100 tests.
  • ignores closeTx of another head

    Details
    +++ OK, passed 100 tests.
  • ignores contestTx of another head

    Details
    +++ OK, passed 100 tests.
  • ignores fanoutTx of another head

    Details
    +++ OK, passed 100 tests.

Hydra.FireForget

  • client can send 'Hail Hydra!' to server

Hydra.Events.FileBased

eventPairFromPersistenceIncremental

  • can handle continuous events

    Details
    +++ OK, passed 100 tests.
  • can handle non-continuous events

    Details
    +++ OK, passed 100 tests.
  • can handle duplicate events

    Details
    +++ OK, passed 100 tests.
  • can bootstrap from plain StateChanged events

    Details
    +++ OK, passed 100 tests.

Hydra.Crypto

MultiSignature

  • is sensitive to order

    Details
    +++ OK, passed 100 tests; 58 discarded.
  • aggregate/verifyMultiSignature roundtrip

    Details
    +++ OK, passed 100 tests.
  • aggregateInOrder/verifyMultiSignature roundtrip

    Details
    +++ OK, passed 100 tests; 16 discarded.
  • verifyMultiSignature fails when signature is missing

    Details
    +++ OK, passed 100 tests; 81 discarded.
  • does not validate multisig if less keys given

    Details
    +++ OK, passed 100 tests; 24 discarded (5% empty).

Signature

  • show includes escaped hex

  • can sign arbitrary messages

    Details
    +++ OK, passed 100 tests; 33 discarded.
  • sign/verify roundtrip

    Details
    +++ OK, passed 100 tests.

VerificationKey

  • show includes escaped hex

JSON encoding of (VerificationKey HydraKey)

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/VerificationKey HydraKey.json

SigningKey

  • show includes escaped hex

  • can be generated when seed exceeds the max seed size for algorithm

  • can be generated

    Details
    +++ OK, passed 100 tests; 31 discarded.
  • arbitrary @(SigningKey HydraKey) is reasonably collision resistant

    Details
    +++ OK, passed 100000 tests.

Hydra.ContestationPeriod

fromNominalDiffTime

  • works for diff times > 0

    Details
    +++ OK, passed 100 tests.
  • fails for diff times <= 0

    Details
    +++ OK, passed 100 tests.
  • rounds to 1 second

    Details
    +++ OK, passed 100 tests.

Hydra.Chain.Direct.Wallet

newTinyWallet

  • initialises wallet by querying UTxO

    Details
    +++ OK, passed 100 tests.
  • re-queries UTxO from the tip, even on reset

    Details
    +++ OK, passed 100 tests.

coverFee

  • sets min utxo values

    Details
    +++ OK, passed 100 tests.
  • balances transaction with fees

    Details
    +++ OK, passed 100 tests.
  • prefers largest utxo

    Details
    +++ OK, passed 100 tests.

applyTxs

  • only reduces the UTXO set when no address is ours

    Details
    +++ OK, passed 100 tests.
  • Seen inputs are consumed and not in the resulting UTXO

    Details
    +++ OK, passed 100 tests.

genTxsSpending / genUTxO

  • are well-suited for testing

    Details
    +++ OK, passed 100 tests:
    40% has dependent txs
    26% has no tx that are ours

Hydra.Chain.Direct.Tx

collectComTx

  • cover fee correctly handles redeemers

    Details
    +++ OK, passed 60 tests:
    93% Script(s) execution failed
    7% No fuel UTxO found

observeHeadTx

  • All valid transitions for all possible states can be observed.

    Details
    +++ OK, passed 100 tests.

    ChainTransition (100 in total):
    17% Close
    16% Collect
    15% Fanout
    14% Commit
    14% Init
    12% Abort
    12% Contest

HeadId (cardano)

  • headIdToPolicyId . mkHeadId === id

    Details
    +++ OK, passed 100 tests.
  • curencySymbolToHeadId . headIdToCurrencySymbol === id

    Details
    +++ OK, passed 100 tests.

HeadSeed (cardano)

  • headSeedToTxIn . txInToHeadSeed === id

    Details
    +++ OK, passed 100 tests.

Hydra.Chain.Direct.TimeHandle

  • can roundtrip currentPointInTime

    Details
    +++ OK, passed 100 tests.
  • should convert slot within latest/current era

Hydra.Chain.Direct.State

acceptance

  • can close & fanout every collected head

    Details
    +++ OK, passed 100 tests:
    58% collect, close and fanout passed
    42% collect failed already

fanout

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    53% Fanout size: 40-58
    29% Fanout size: 10-40
    17% Fanout size: 1-10
    1% Fanout size: 0

    49% 6kB
    26% 4kB
    25% 5kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests:
    53% Fanout size: 40-58
    29% Fanout size: 10-40
    17% Fanout size: 1-10
    1% Fanout size: 0

contest

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests (100% 1kB).

    Close point (slot) (100 in total):
    100% > 0

    Contestation period (100 in total):
    18% one month
    16% one day
    15% > k blocks
    14% one week
    13% k blocks on mainnet
    12% < k blocks
    12% one year
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests.

    Close point (slot) (100 in total):
    100% > 0

    Contestation period (100 in total):
    18% one month
    16% one day
    15% > k blocks
    14% one week
    13% k blocks on mainnet
    12% < k blocks
    12% one year

close

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    89% ConfirmedSnapshot
    11% InitialSnapshot

    89% 1kB
    11% 0kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests:
    89% ConfirmedSnapshot
    11% InitialSnapshot

collectCom

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    95% 1kB
    5% 0kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests.

abort

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    72% Abort after some (but not all) commits
    17% Abort immediately, after 0 commits
    11% Abort after all commits

    90% 4kB
    10% 5kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests:
    72% Abort after some (but not all) commits
    17% Abort immediately, after 0 commits
    11% Abort after all commits
  • can create valid abort transactions for any observed head

    Details
    +++ OK, passed 100 tests.

commit

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    92% Non-empty commit
    8% Empty commit

    100% 0kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests:
    92% Non-empty commit
    8% Empty commit
  • only proper head is observed

    Details
    +++ OK, passed 100 tests:
    92% Non-empty commit
    8% Empty commit
  • consumes all inputs that are committed

    Details
    +++ OK, passed 100 tests:
    92% Non-empty commit
    8% Empty commit
  • can only be applied / observed once

    Details
    +++ OK, passed 100 tests:
    92% Non-empty commit
    8% Empty commit
  • reject committing outputs with byron addresses

    Details
    +++ OK, passed 100 tests.
  • reject committing outputs with reference scripts

    Details
    +++ OK, passed 100 tests.
  • reject Commits with more than maxMainnetLovelace Lovelace

    Details
    +++ OK, passed 100 tests.

init

  • transaction size is below 16kB

    Details
    +++ OK, passed 100 tests:
    100% 2+ parties

    67% 5kB
    33% 4kB
  • validates within maxTxExecutionUnits

    Details
    +++ OK, passed 100 tests (100% 2+ parties).
  • only proper head is observed

    Details
    +++ OK, passed 100 tests (100% NotAHeadPolicy).

observeTx

  • All valid transitions for all possible states can be observed.

    Details
    +++ OK, passed 100 tests.

    ChainTransition (100 in total):
    17% Close
    16% Collect
    15% Fanout
    14% Commit
    14% Init
    12% Abort
    12% Contest

Plutus.PubKeyHash

JSON encoding of PubKeyHash

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/PubKeyHash.json

ChainState

JSON encoding of ChainState

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ChainState.json

Hydra.Chain.Direct.ScriptRegistry

  • newScriptRegistry (registryUTxO r) === Just r

    Details
    +++ OK, passed 100 tests.

Hydra.Chain.Direct.Handlers

LocalChainState

  • can resume from chain state

    Details
    +++ OK, passed 100 tests:
    25% Rollback 2 blocks
    16% Rollback 5 blocks
    15% Rollback 4 blocks
    13% Rollback 3 blocks
    13% Rollback 6 blocks
    10% Rollback 1 blocks
    8% Rollback 0 blocks

chainSyncHandler

  • roll forward results in Tick events

    Details
    +++ OK, passed 100 tests.
  • roll forward fails with outdated TimeHandle

    Details
    +++ OK, passed 100 tests.
  • observes transactions onRollForward

    Details
    +++ OK, passed 100 tests:
    21% Collect
    18% Fanout
    14% Commit
    13% Init
    12% Abort
    12% Close
    10% Contest
  • rollbacks state onRollBackward

    Details
    +++ OK, passed 100 tests:
    16% Rollback to: ChainSlot 0 / 5
    11% Rollback to: ChainSlot 0 / 6
    10% Rollback to: ChainSlot 1 / 2
    9% Rollback to: ChainSlot 0 / 3
    8% Rollback to: ChainSlot 0 / 4
    6% Rollback to: ChainSlot 0 / 2
    4% Rollback to: ChainSlot 4 / 4
    4% Rollback to: ChainSlot 4 / 6
    3% Rollback to: ChainSlot 1 / 3
    3% Rollback to: ChainSlot 1 / 4
    3% Rollback to: ChainSlot 2 / 3
    3% Rollback to: ChainSlot 2 / 4
    3% Rollback to: ChainSlot 2 / 5
    2% Rollback to: ChainSlot 1 / 6
    2% Rollback to: ChainSlot 3 / 3
    2% Rollback to: ChainSlot 3 / 4
    2% Rollback to: ChainSlot 3 / 5
    2% Rollback to: ChainSlot 3 / 6
    2% Rollback to: ChainSlot 4 / 5
    2% Rollback to: ChainSlot 5 / 5
    2% Rollback to: ChainSlot 6 / 6
    1% Rollback to: ChainSlot 1 / 5

Hydra.Chain.Direct.Contract

Fanout

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 100 tests.

    FanoutMutation (100 in total):
    28% MutateThreadTokenQuantity
    26% MutateAddUnexpectedOutput
    24% MutateValidityBeforeDeadline
    22% MutateChangeOutputValue

Contest

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 200 tests.

    ContestMutation (200 in total):
    8.0% MutatePartiesInOutput
    8.0% NotContinueContract
    6.0% MutateInputContesters
    5.5% MutateContestUTxOHash
    5.5% MutateContesters
    5.5% NotUpdateDeadlineAlthoughItShould
    5.0% ContestFromDifferentHead
    5.0% MutateRequiredSigner
    5.0% MutateTokenMintingOrBurning
    5.0% MutateValueInOutput
    4.5% MutateHeadIdInOutput
    4.5% MutateOutputContestationPeriod
    4.5% MutateSignatureButNotSnapshotNumber
    4.5% MutateToNonNewerSnapshot
    4.5% SnapshotNotSignedByAllParties
    4.0% MutateMultipleRequiredSigner
    4.0% MutateNoRequiredSigner
    4.0% MutateSnapshotNumberButNotSignature
    3.5% MutateValidityPastDeadline
    3.5% PushDeadlineAlthoughItShouldNot

CloseInitial

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 400 tests.

    CloseInitialMutation (400 in total):
    100.0% MutateCloseContestationDeadline'

Close

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 200 tests.

    CloseMutation (200 in total):
    8.0% MutateContesters
    8.0% NotContinueContract
    6.0% MutateContestationPeriod
    5.5% MutateInfiniteLowerBound
    5.5% MutateRequiredSigner
    5.5% MutateValidityInterval
    5.0% MutateCloseUTxOHash
    5.0% MutateContestationDeadline
    5.0% MutateInfiniteUpperBound
    5.0% SnapshotNotSignedByAllParties
    4.5% MutateNoRequiredSigner
    4.5% MutateSignatureButNotSnapshotNumber
    4.5% MutateSnapshotNumberButNotSignature
    4.5% MutateTokenMintingOrBurning
    4.5% MutateValueInOutput
    4.0% MutateHeadIdInOutput
    4.0% MutatePartiesInOutput
    4.0% MutateSnapshotNumberToLessThanEqualZero
    3.5% CloseFromDifferentHead
    3.5% MutateMultipleRequiredSigner

CollectCom

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 200 tests.

    CollectComMutation (200 in total):
    16.0% MutateTokenMintingOrBurning
    12.5% MutateOpenUTxOHash
    12.0% MutateCommitToInitial
    12.0% NotContinueContract
    10.5% ExtractSomeValue
    10.5% RemoveSTFromOutput
    9.5% MutateHeadId
    9.5% MutateNumberOfParties
    7.5% MutateRequiredSigner

Commit

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 100 tests.

    CommitMutation (100 in total):
    15% MutateTokenMintingOrBurning
    13% MutateCommittedAddress
    13% MutateCommittedValue
    13% NonContinuousHeadId
    13% RecordAllCommittedUTxO
    11% MutateCommitOutputValue
    11% MutateRequiredSigner
    11% UsePTFromDifferentHead

Abort

  • is healthy

    Details
    +++ OK, passed 100 tests.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 200 tests.

    AbortMutation (200 in total):
    12.5% UseInputFromOtherHead
    10.0% ExtractValue
    9.5% DoNotBurnSTInitial
    9.0% DoNotBurnST
    9.0% DropOneCommitOutput
    8.5% BurnOneTokenMore
    8.0% MutateParties
    6.5% DropCollectedInput
    6.5% MutateUseDifferentHeadToAbort
    6.0% MutateThreadTokenQuantity
    5.0% MintOnAbort
    5.0% ReorderCommitOutputs
    4.5% MutateRequiredSigner

Init

  • is healthy

    Details
    +++ OK, passed 1 test.
  • does not survive random adversarial mutations

    Details
    +++ OK, passed 100 tests.

    InitMutation (100 in total):
    15% MutateSeedInDatum
    13% MintTooManyTokens
    13% MutateDropInitialOutput
    13% MutateDropSeedInput
    13% MutateInitialOutputValue
    11% MutateAddAnotherPT
    11% MutateHeadIdInDatum
    11% MutateHeadIdInInitialDatum

Serializing commits

  • deserializeCommit . serializeCommit === id

    Details
    +++ OK, passed 100 tests.

TxOut hashing

  • OffChain.hashUTxO == OnChain.hashTxOuts (on sorted tx outs)

    Details
    +++ OK, passed 20 tests.
  • OnChain.hashPreSerializedCommits == OnChain.hashTxOuts (on sorted tx outs)

    Details
    +++ OK, passed 20 tests.
  • does care about ordering of TxOut

    Details
    +++ OK, passed 20 tests; 26 discarded.

Signature validator

  • verifies single signature produced off-chain

    Details
    +++ OK, passed 100 tests.
  • verifies snapshot multi-signature for list of parties and signatures

    Details
    +++ OK, passed 100 tests.

Hydra.Behavior

rolling back & forward does not make the node crash

  • does work for rollbacks past init
  • does work for rollbacks past open

Hydra Node Logging

  • traces processing of events
  • traces handling of effects

Two participant Head

  • only opens the head after all nodes committed
  • can abort and re-open a head when one party has not committed
  • cannot abort head when commits have been collected
  • ignores head initialization of other head
  • outputs committed utxo when client requests it

in an open head

  • sees the head closed by other nodes

  • valid new transactions are seen by all parties

  • valid new transactions get snapshotted

  • snapshots are created as long as transactions to snapshot exist

  • depending transactions stay pending and are confirmed in order

  • depending transactions expire if not applicable in time

  • sending two conflicting transactions should lead one being confirmed and one expired

  • outputs utxo from confirmed snapshot when client requests it

  • can be finalized by all parties after contestation period

  • contest automatically when detecting closing with old snapshot

Single participant Head

  • accepts Init command
  • accepts Commit after successful Init
  • can close an open head
  • does not fanout automatically
  • does finalize head after contestation period upon command

Sanity tests of test suite

  • does not delay for real

Hydra.API.ServerOutput

JSON encoding of (ReasonablySized (ServerOutput (Tx BabbageEra)))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (ServerOutput (Tx BabbageEra)).json

JSON encoding of (ReasonablySized (ServerOutput SimpleTx))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (ServerOutput SimpleTx).json

  • matches JSON schema

    Details
    +++ OK, passed 1 test.

JSON encoding of (ReasonablySized (TimedServerOutput (Tx BabbageEra)))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (TimedServerOutput (Tx BabbageEra)).json

Hydra.API.Server

  • should fail on port in use

  • greets

  • Greetings should contain the hydra-node version

  • sends sendOutput to all connected clients

  • sends all sendOutput history to all connected clients after a restart

  • echoes history (past outputs) to client upon reconnection

    Details
    +++ OK, passed 100 tests:
    90% more than one message when reconnecting
    8% no message when reconnecting
    2% only one message when reconnecting
  • does not echo history if client says no

    Details
    +++ OK, passed 100 tests:
    90% more than one message when reconnecting
    8% no message when reconnecting
    2% only one message when reconnecting
  • removes UTXO from snapshot when clients request it

  • sequence numbers are continuous

    Details
    +++ OK, passed 100 tests.
  • displays correctly headStatus and snapshotUtxo in a Greeting message

  • greets with correct head status and snapshot utxo after restart

  • sends an error when input cannot be decoded

Hydra.API.HTTPServer

JSON encoding of (ReasonablySized TransactionSubmitted)

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized TransactionSubmitted.json

JSON encoding of (ReasonablySized (SubmitTxRequest (Tx BabbageEra)))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (SubmitTxRequest (Tx BabbageEra)).json

JSON encoding of (ReasonablySized DraftCommitTxRequest)

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized DraftCommitTxRequest.json

JSON encoding of (ReasonablySized DraftCommitTxResponse)

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized DraftCommitTxResponse.json

  • Validate /commit publish api schema

    Details
    +++ OK, passed 1 test.
  • Validate /commit subscribe api schema

    Details
    +++ OK, passed 1 test.
  • Validate /cardano-transaction publish api schema

    Details
    +++ OK, passed 1 test.
  • Validate /cardano-transaction subscribe api schema

    Details
    +++ OK, passed 1 test.

SubmitTxRequest accepted tx formats

  • accepts json encoded transaction

    Details
    +++ OK, passed 100 tests.
  • accepts transaction encoded as TextEnvelope

    Details
    +++ OK, passed 100 tests.

API should respond correctly

GET /protocol-parameters

  • matches schema
  • responds given parameters

Hydra.API.ClientInput

FromJSON (ValidatedTx era)

  • accepts transactions produced via cardano-cli

    Details
    +++ OK, passed 100 tests.

JSON encoding of (ReasonablySized (ClientInput (Tx BabbageEra)))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (ClientInput (Tx BabbageEra)).json

JSON encoding of (ReasonablySized (ClientInput SimpleTx))

  • allows to encode values with aeson and read them back

    Details
    +++ OK, passed 100 tests.
  • produces the same JSON as is found in golden/ReasonablySized (ClientInput SimpleTx).json