Skip to content

Commit

Permalink
checkpoint: fix all hydra-node tests besides golden
Browse files Browse the repository at this point in the history
  • Loading branch information
cardenaso11 committed Feb 21, 2024
1 parent 59e74d1 commit 067edec
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 111 deletions.
351 changes: 351 additions & 0 deletions hydra-node/golden/HydraNodeLog SimpleTx.faulty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
{
"samples": [
{
"by": {
"vkey": "5091b47ecd2cec9fdefdcb8e62384c37d3562fd5e7491d1cf5eedfbd8f7d546a"
},
"eventId": 10388917,
"tag": "EndEvent"
},
{
"numberOfEvents": 8035383,
"tag": "LoadedState"
},
{
"numberOfEvents": 14314478,
"tag": "LoadedState"
},
{
"misconfigurationErrors": [
{
"numberOfParties": -17,
"tag": "SavedNetworkPartiesInconsistent"
},
{
"configuredParties": [],
"loadedParties": [
{
"vkey": "35c362a74fa1c7d61f3259b0485c9bf20b98f8615c752f2b7ca8523e93ae593d"
},
{
"vkey": "576a7cdfae307e6ebcaa563391aef3a5ae2766c05b8bf6794529b0c4058bf954"
},
{
"vkey": "987a7b2e08cb45295a5514be79b6a90f305b99b59cc2917bcd935aec27747c6b"
},
{
"vkey": "ed777a12aa1d2f1335f51323447ebeea49d6a28cf920da4e9e1c84a76e83bee0"
},
{
"vkey": "e204c00d95409007467fd10b737736f240ef5966ff1950766028eac9c1b4d3fa"
},
{
"vkey": "5dc1cfb602198946a7a2a68a89b78818ea34452a4505193387a00fb806951e0a"
},
{
"vkey": "888ff8f57ea2a8fbfe67dbe937d9a6e70d9f634e2825d3846c001b7b1ffe3794"
},
{
"vkey": "013ad4935d2966d8f884ce62ff260ae102a1412102ec6862da401ac4db1fda19"
},
{
"vkey": "bbaf4405c6e8ba1036d848ef871a9e4228c975b16486187e0ea60576c5a19a54"
},
{
"vkey": "71c9c7c9fe9558dd70459bd321f639a642065f4efe1e5414c06965fe216edb34"
},
{
"vkey": "925b5cc44180f3b5da3ce544a629d799897c6964da9c6968fded7a7474e82c11"
},
{
"vkey": "53e1593da258c25e2fadc76bb05bb602a47a074cb3f4b2cf779a9bf36ba6bf93"
},
{
"vkey": "e6b68d90e2955bc8885790850d0505539876f3d2eac3ab332e8553a735a4b611"
},
{
"vkey": "d37235a3145031771956f5f418a931febf2042d69fbe5968c667c2912c7c4b8d"
},
{
"vkey": "33f3e3ef587d9d7d091566267fb01f36ed6fc91ff58e2f89e884cb808ef8dda5"
},
{
"vkey": "ac567f2492192d9e498e50b5efca495656d28a2f997cbae403320b955a4aa2db"
}
],
"tag": "PartiesMismatch"
},
{
"configuredCp": 67884,
"loadedCp": 31536000,
"tag": "ContestationPeriodMismatch"
},
{
"configuredCp": 2592000,
"loadedCp": 31536000,
"tag": "ContestationPeriodMismatch"
},
{
"configuredCp": 61244,
"loadedCp": 2592000,
"tag": "ContestationPeriodMismatch"
},
{
"configuredParties": [
{
"vkey": "f8ae63194ed2aa13b1f0f5934792730d2db917babd5f319fdd6f498c3947db65"
},
{
"vkey": "3c5d45cebfa9adcd4cc1e2822f3056ec0d95c401357e7d11056d5ac4c9ce2ba5"
},
{
"vkey": "159e1791c58f97cf0e12ddc4de6c87d6cb3b174b0a64d479b2ec9c4bd72e528a"
},
{
"vkey": "61a364d3156f07890aa37a0138e158dfd24ea9252cfd98430648912ff5269191"
},
{
"vkey": "60cd4e5ce4cb5483d224df646e9705c65a62b378fc544998195a30d6394e2c55"
},
{
"vkey": "080d2e3f929cb77f9b978c7196efbd6af0c9744e8097376ea0fdf7f8dba3b173"
},
{
"vkey": "aff9e81d4e4d2d83ecef590a81b5fa0d5fee639034ef31a12d817ab5b202e38f"
},
{
"vkey": "8d3c45eebb08c45c22ba852dc9becc0d369aee7ce03e21745eeda7495eeef6d5"
},
{
"vkey": "5bb57a36a9bc82d575956d26d5c9bef7c9502b190b16a6a224424ede99406714"
},
{
"vkey": "0c554251649a189297c04b6408bfbafdb2bf688f560f2dd70940cf34f3b30c48"
},
{
"vkey": "d6e16d8d570c6aa8d7195180b8e4564b088fdcec08068e7bada6444614a3ac45"
},
{
"vkey": "94f960b00bd875548ea36212b378a5de182fc79bc954b447cf5c42ad83678aaa"
},
{
"vkey": "c6d95b9b9a5433455792cbd403cda6bb2327b36b63a1c4232dea1d2683223be3"
},
{
"vkey": "b63db96eeee1628d3de2b723a8a21c3390503357ddabe6fa01de0b0b4a568173"
}
],
"loadedParties": [
{
"vkey": "86948356a48027bb2b60207fcc6d9fbd2487cbdd824ec15817b130da799fee2e"
},
{
"vkey": "9eab13b0ca3933a196a88b31e06a83d17c5130c6051b54b67bc64fd7a952e4f6"
},
{
"vkey": "91d7746e83d79825fdb7a4f12d3ce66df81eaaed58d7ab8453891ee5cf111f6e"
},
{
"vkey": "477ff137b610868079286fcabad698598220d6c9f25f085014c41ca558351bd1"
},
{
"vkey": "dfad37c654724d29c2e97e6f43baf6b701dd1fdeb6caef0c438d357d28aa044d"
},
{
"vkey": "49f23217cfc237ec65a6d5d5a4778b264e9536c52cf58c61f4fe94374644f424"
},
{
"vkey": "8e9c1250af2db29ec97076dc5d87f181c3fdccbed40a502505e5e614f32b12ae"
},
{
"vkey": "ebf007f6d3d0c51be437171ce7f8647df10bd2c4cc00bc1547a0e2877d093798"
},
{
"vkey": "d1265f9046813cd2dbccab6359f838a4f238cdb8a18e358b16601048fe427fcc"
},
{
"vkey": "d410de44bb1ae6a07dc73c28311705b6c847080f24d7343feb4cd1338b20db39"
},
{
"vkey": "bd0a02537ac0500ce94bb535d32d5888eee0c3944ca9d969752b7b48c226534b"
},
{
"vkey": "92df1bfdabd212e0652d8c04a7dc76893f15b82eb1e2e0220ee5947ea7291bc1"
}
],
"tag": "PartiesMismatch"
},
{
"configuredCp": 15628,
"loadedCp": 2592000,
"tag": "ContestationPeriodMismatch"
},
{
"configuredCp": 2592000,
"loadedCp": 48896,
"tag": "ContestationPeriodMismatch"
},
{
"configuredParties": [
{
"vkey": "c2b22448690f60df10a370e0a40a4ba875729bfa4dbe1937509a3ba7a70865e9"
},
{
"vkey": "25c2a99f45f6270159f25c28f08a29e7a85153f2ccc067a86765560b4e3b2bd2"
},
{
"vkey": "84bcc60d362c84eae99865bc1529aa8de4687ee3ddf380e92fe769dfa1b9a057"
},
{
"vkey": "c0595595b61ef82fda46b3b0435ca65c78e67c45e079a713ce9e24c980b8f490"
},
{
"vkey": "227ec5e1ca0ed60be5ed01e813c0bfea85096d2aa63b632b4d8a588a5d8a415e"
},
{
"vkey": "dfdd682da7701ea5f7d40210025d9e8c2f1639881eaca5aaad17f8a7ba013847"
},
{
"vkey": "c6de0d0cd6d178d1b3e0097e41ba2a8f9e239ef5f9105a578e7d2ce1a0961283"
},
{
"vkey": "fa864661c909617656499dcc237628ad05da71b9b0d62189ce6bd47f1143cca6"
},
{
"vkey": "3af591943fbc10755f68154fd11644b4f499115ec194087ba5b26098049fea8d"
},
{
"vkey": "eabf3c43877b1108fe388c314c798f9042d53d11d8848d399d2d8f5e37361f9b"
},
{
"vkey": "cc1e4bc2c0ce0f79d4b46f0170a19d14847ebd3b50d05ca92a391f4e51577e83"
},
{
"vkey": "0f21f34dcb6e52ad303992c049c39b098f26a7ac4d618dab043ad99880dd80e2"
},
{
"vkey": "aca22ae0a3680bec366f5a4354c1a9e7ebdc224feba488b160b26fc5248c8cc4"
},
{
"vkey": "fa39043abb2a5ce4711d753125729f9f1d11b3b93dc27cc88ca8fb6f73b5271f"
},
{
"vkey": "13878b03d94e705bfcb503b1f527cba3ddd658c2c6b0ee1eb1da1ff24a583dec"
},
{
"vkey": "899863f3a8e9c31f659d0c4ac1e3ea33a618892d39248cc2f76cfcc41dd16912"
},
{
"vkey": "16a9f26236da26ead3a3337bccfe8f413a7318d5c7b2b5a493153b1bedb0e6b3"
},
{
"vkey": "4b7f6f799e24d91a66ab4deb96467441175648fbd91792ada7bb2e7994007828"
},
{
"vkey": "157c9a2a90903fb4d0098e604a34bb3c643c4f5dc4ce4ceaf93fc6200f1cb888"
},
{
"vkey": "7cd7b1f401af2d6a4634d40b8dc0146de0e1e8a2cef80e3cba41c49eb01d1a6f"
},
{
"vkey": "a03dd2798f2e7e94e70acadb17140fac3aab00cdd87470b061d7acc9f683c9a8"
},
{
"vkey": "37bd8716f8a8ef35983935fd5fa8d10ee1b59402a23d7bd86f86409ecd13c3bd"
},
{
"vkey": "026a95814f6abdfe929c3f3d62e9bfc3f89d74df34bd0a3d2836a59136334011"
}
],
"loadedParties": [
{
"vkey": "782a1be04ae7b2f951c421cc124526065c9a2cbc23c48067b81af1b445341f7d"
},
{
"vkey": "df178a1dddb964f47baa8dd1e84b9b13b591c00e9f8a5a252247c5dc253bfbb4"
},
{
"vkey": "a79b075d09468ccbc5bc204524e723c81ce32fabd66a5f9256ed39075839a790"
},
{
"vkey": "b919650eff866d831e62bbdf882991c10b9440ef1dcc1dcc2428a26d8f5b5dd8"
},
{
"vkey": "5ec6680de55d2a2f6045c6f52e6eb47047e73d7ad81b8c8679d42adf6c7e02b1"
},
{
"vkey": "54b47cc37f86945514626a937251759c4dd7e4066ebc8d274401952379a7cac6"
},
{
"vkey": "53df8f812267bb9b04699777a6ff1b6fd313a3e4a5829e819f6a2b523310704c"
},
{
"vkey": "14ddaf67c53862d4ad372d21306992ff8cbd46a5ce718a30b22e3dc1300c0f4c"
},
{
"vkey": "daf0f57351dbf8af9cf9be2a0cc2be17d3517cfb7f9165ecaa24cb86599f8b5d"
},
{
"vkey": "dcfc4a159ffe7f532208b49a998cb4d4416027e75640982433b88552fd906ccf"
},
{
"vkey": "8704a3d2327f1784fd344268389707cd1a52f71ff471994991d55a471269d466"
},
{
"vkey": "6753d20e068ad7d4da449e145f17991bc2135efb4b764bb8a140682c897afee1"
},
{
"vkey": "7f2a8812a7ab37ceada7b5c2cb833491384c1b65d29239a20c3b327af79fea64"
},
{
"vkey": "5b4d854a0ee7fa7075c96be0de21784871dd212a0a956bb2dda0697bdd6ab3e2"
},
{
"vkey": "47177b3eca9e95e9f04b9a4cccf8362c41b4cf747ffed6ba1fced372b42e319a"
},
{
"vkey": "83eedcc00b57c3634fc640b3d3c8f0a0696d89605f5007203cfd15ba32e7eda3"
},
{
"vkey": "a27fe3f494dd5fb7edd56d90a5d4039fa08728f4c8aec875c222e693eb9b9da7"
},
{
"vkey": "53c1c05bf738194647b90f503071d6c07ba26f3d6d1f8bbcc6cdadd3286e401f"
}
],
"tag": "PartiesMismatch"
}
],
"tag": "Misconfiguration"
},
{
"by": {
"vkey": "54e1373ff14d0013bc9130dbb2347dbaf5f9d93fe35109a69e39f08a4d7f7d1a"
},
"outcome": {
"left": {
"error": {
"otherHeadId": "998bc89929dbad113ea20e4d8598de99",
"ourHeadId": "e999d1a86b0d5baa5d615946e8dc7b77",
"tag": "NotOurHead"
},
"tag": "Error"
},
"right": {
"event": {
"chainState": {
"slot": 28
},
"contestationDeadline": "1864-04-23T09:23:44.209304653028Z",
"stateChangeID": 5664714,
"tag": "HeadClosed"
},
"tag": "StateChanged"
},
"tag": "Combined"
},
"tag": "LogicOutcome"
}
],
"seed": 1986430396
}
4 changes: 2 additions & 2 deletions hydra-node/src/Hydra/Persistence.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ createPersistence fp = do
data EventSource e m = EventSource {getEvents' :: FromJSON e => m [e]}
data EventSink e m = EventSink {putEvent' :: ToJSON e => e -> m ()}

type EventID = Word64

-- FIXME(Elaine): we have to figure out a better taxonomy/nomenclature for the events/statechange stuff
-- the eventID here is not the same as the eventID in Queued, that one is more fickle and influenced by non state change events
-- this one is only incremented when we have a new state change event
Expand All @@ -74,8 +76,6 @@ putEventToSinks sinks e = forM_ sinks (\sink -> putEvent' sink e)
putEventsToSinks :: forall m e. (Monad m, ToJSON e) => NonEmpty (EventSink e m) -> [e] -> m ()
putEventsToSinks sinks es = forM_ es (\e -> putEventToSinks sinks e)

-- FIXME(Elaine): neither this nor the opposite direction can handle re-submission properly without keeping track of the state separately in step/hydranode &
-- so this means removing the old persistence for the purpose of statechanged events is more urgent
eventPairFromPersistenceIncremental :: PersistenceIncremental a m -> (EventSource a m, EventSink a m)
eventPairFromPersistenceIncremental PersistenceIncremental{append, loadAll} =
let eventSource = EventSource{getEvents' = loadAll}
Expand Down
5 changes: 1 addition & 4 deletions hydra-node/test/Hydra/BehaviorSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,6 @@ createHydraNode ledger nodeState signingKey otherParties outputs outputHistory c
let (eventSource, eventSink) = eventPairFromPersistenceIncremental persistence
eventSinks = eventSink :| []

-- FIXME(Elaine): initialize last state change ID
let persistence = NewPersistenceIncremental{eventSource, eventSinks, lastStateChangeId = error "lastStateChangeId not implemented"}

connectNode chain $
HydraNode
{ eq
Expand All @@ -809,7 +806,7 @@ createHydraNode ledger nodeState signingKey otherParties outputs outputHistory c
, contestationPeriod = cp
, participants
}
, persistence
, persistence = (eventSource, eventSinks)
}
where
party = deriveParty signingKey
Expand Down
Loading

0 comments on commit 067edec

Please sign in to comment.