-
Notifications
You must be signed in to change notification settings - Fork 86
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
Chain state in head state not updated on replayed observation #931
Labels
bug 🐛
Something isn't working
Comments
4 tasks
From my pov, it is not clear what is needed for this story. |
We started a draft branch ( |
We tried to reproduced the problem using this scenario but the persisted state seems to be fine. startChainFromReplayed :: FilePath -> Tracer IO EndToEndLog -> RunningNode -> TxId -> IO ()
startChainFromReplayed tmpDir tracer node@RunningNode{networkId, nodeSocket} hydraScriptsTxId = do
(aliceCardanoVk, _) <- keysFor Alice
let aliceSk = generateSigningKey "alice-timed"
let alice = deriveParty aliceSk
let contestationPeriod = UnsafeContestationPeriod 2
aliceChainConfig <- chainConfigFor Alice tmpDir nodeSocket [] contestationPeriod
(chainPointBeforeComit, committedUTxOByAlice, headId) <- withHydraNode tracer aliceChainConfig tmpDir 1 aliceSk [] [1] hydraScriptsTxId $ \n1 -> do
waitForNodesConnected tracer [n1]
let lovelaceBalanceValue = 100_000_000
-- Funds to be used as fuel by Hydra protocol transactions
seedFromFaucet_ node aliceCardanoVk lovelaceBalanceValue (contramap FromFaucet tracer)
send n1 $ input "Init" []
headId <- waitForAllMatch 10 [n1] $ headIsInitializingWith (Set.fromList [alice])
-- Get some UTXOs to commit to a head
(aliceExternalVk, aliceExternalSk) <- generate genKeyPair
committedUTxOByAlice <- seedFromFaucet node aliceExternalVk aliceCommittedToHead (contramap FromFaucet tracer)
chainPointBeforeComit <- queryTip networkId nodeSocket
requestCommitTx n1 committedUTxOByAlice <&> signTx aliceExternalSk >>= submitTx node
waitFor tracer 3 [n1] $ output "HeadIsOpen" ["utxo" .= committedUTxOByAlice, "headId" .= headId]
pure (chainPointBeforeComit, committedUTxOByAlice, headId)
let aliceChainConfigBeforeOpen = aliceChainConfig{startChainFrom = Just chainPointBeforeComit}
withHydraNode tracer aliceChainConfigBeforeOpen tmpDir 1 aliceSk [] [1] hydraScriptsTxId $ \n1 -> do
threadDelay 5
send n1 $ input "Close" []
waitMatch 3 n1 $ \v -> do
guard $ v ^? key "tag" == Just "HeadIsClosed"
stateContents <- readFileLBS $ tmpDir </> "state-1" </> "state"
putLBSLn stateContents This likely got fixed when implementing #913 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context & versions
Any current version,
master
Steps to reproduce
x+1
, check the persistedstate
, it should have anOpen
chain statehydra-node
to--start-chain-from
blockx
hydra-node
and checkstate
again as the node resynchronizes with the L1Actual behavior
The
chainState
is reset toIdle
and weirdly hasprevious
chain states attached.Expected behavior
The
chainState
isIdle
at first with noprevious
, and update accordingly as the chain component synchronizes with theL1
. Expect to see anOpen
chain state next to anOpen
head state in the end.Solution idea
In the
HeadLogic.update
function, we could be writing thechainState
also on any observation (if not matched and resulting in aheadState
transition already)The text was updated successfully, but these errors were encountered: