Skip to content

SigSubmission v2#16

Open
the-headless-ghost wants to merge 4 commits intomainfrom
edgr/sig-submission-v2
Open

SigSubmission v2#16
the-headless-ghost wants to merge 4 commits intomainfrom
edgr/sig-submission-v2

Conversation

@the-headless-ghost
Copy link
Member

@the-headless-ghost the-headless-ghost commented Jan 15, 2026

List of changes

Closes #13

Checklist

  • related issue
  • My changes generate no new warnings
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

coot and others added 4 commits January 28, 2026 10:07
Verify that `Sig` encoding produces a valid CBOR.
`SigSubmissionV2` protocol based on `ObjectDiffusion` from Peras.  The
client requests signatures while the server provides them (dual to
`TxSubmission`).  The patch provides:

* protocol definition and GADT wrappers
* CBOR codec
* cddl specification checked against the codec
* codec provides valid CBOR encoding (checked as a regular QC test
  rather than with the `cddl` tool)
@the-headless-ghost the-headless-ghost marked this pull request as ready for review January 28, 2026 02:19
@coot coot changed the title Edgr/sig submission v2 SigSubmission v2 Feb 11, 2026
Comment on lines +74 to +77
case initDelay of
TxSubmissionInitDelay delay -> threadDelay delay
NoTxSubmissionInitDelay -> return ()
inboundIdle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initial delay makes sense for tx-submission where the server/upstream downloads from the client/downstream. In that case, the server makes sure the client behaves for the timeout period before fetching any tx's. Here, the client connects and should start working immediately.

serverReqSigIds
-- if there are no unacknowledged sigids, the protocol requires sending
-- a blocking `MsgRequestSigIds` request. This is important, as otherwise
-- the client side wouldn't have a chance to terminate the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/client/server/?

Comment on lines +100 to +103
SigSubmissionOutbound (pure (client Seq.empty mempoolZeroIdx))
where
client :: StrictSeq (sigId, idx) -> idx -> OutboundStIdle sigId sig m ()
client !unackedSeq !lastIdx =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/client/server/

Comment on lines +199 to +200
let sigs = mapMaybe mempoolLookupTx sigIdxs'
client' = client unackedSeq lastIdx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment

Comment on lines +152 to +157
sigs <- atomically $
do
MempoolSnapshot{mempoolTxIdsAfter} <- mempoolGetSnapshot
let sigs = mempoolTxIdsAfter lastIdx
check (not $ null sigs)
pure (take (fromIntegral reqNo) sigs)
Copy link
Contributor

@crocodile-dentist crocodile-dentist Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a timeout here (< limit for SingSigIds SingBlocking) and return SendMsgReplyNoSigIds below to hand over the agency so the client can either close the connection or issue another blocking call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

SigSubmission node-to-node mini-protocol

3 participants