Conversation
adithyaov
commented
Feb 26, 2026
- Test
| res <- Stream.uncons (streamBlocks metrics events cm points) | ||
| case res of | ||
| Nothing -> pure () | ||
| Just ((previousChainPt, Block _ sbe _), blkStream) -> void $ do |
There was a problem hiding this comment.
for_ might be an option here
| interestingScripts = | ||
| Map.restrictKeys cmScripts $ | ||
| Set.unions | ||
| [ getMintPolicies tx | ||
| , getInputScriptAddrs inpUtxoMap tx | ||
| , getCertifyingScriptHashes tx | ||
| , getRewardingScriptHashes tx | ||
| ] |
There was a problem hiding this comment.
Does this ever get computed again? Just wondering if it's worth having this just return the set and call not . null where the bool is needed.
There was a problem hiding this comment.
At the moment it is never computed again. We may want to change it later though depending on how it evolves.
| observeDuration metrics.mainLoop_consumeBlock_runtime $ do | ||
| case proveAlonzoEraOnwards sbe of | ||
| Nothing -> pure () | ||
| Just era -> withAlonzoEra era bh previousChainPt txList |
There was a problem hiding this comment.
Should we move the observeDuration inside the case statement? No point measuring the time for the Nothing case.
There was a problem hiding this comment.
We could do that. That said, the metric is called "mainLoop_consumeBlock_runtime"
| observeDuration metrics.mainLoop_consumeBlock_runtime $ do | ||
| case proveAlonzoEraOnwards sbe of | ||
| Nothing -> pure prevUtxoMap | ||
| Just era -> withAlonzoEra era bh prevUtxoMap previousChainPt txList |
| -- 1. The block has transactions that involve script executions | ||
| -- 2. These scripts have a non-empty intersection with the configured | ||
| -- scripts | ||
| when (not (null selectedTxs)) $ do |
There was a problem hiding this comment.
| when (not (null selectedTxs)) $ do | |
| unless (null selectedTxs) $ do |
There was a problem hiding this comment.
unless always confuses me for some reason.
| writeFile | ||
| (env_LOCAL_CONFIG_DIR </> "scripts.yaml") | ||
| [str| | ||
| running_mode: sync_initial_local_state |
There was a problem hiding this comment.
Personally I'd prefer PascalCase here, but not a big deal one way or the other. Just makes finding the appropriate code a bit easier when the enum and its representation are the same.
There was a problem hiding this comment.
I'll track this in an issue.