Skip to content

[WIP] Getting to a demoable "full" circuit #4

Draft
juanmardefago wants to merge 2 commits intomaoueh/feature/sds-pluginfrom
juanmardefago/consumer-sidecar-post-metering
Draft

[WIP] Getting to a demoable "full" circuit #4
juanmardefago wants to merge 2 commits intomaoueh/feature/sds-pluginfrom
juanmardefago/consumer-sidecar-post-metering

Conversation

@juanmardefago
Copy link
Contributor

No description provided.

- Wire consumer ReportUsage to provider PaymentSession stream (handle rav_request → rav_submission, allow cost omission when gateway configured, close stream on EndSession)

- Enforce provider-side underpay protection: reject/STOP if submitted RAV < current + server-computed usage delta (stream + SubmitRAV)

- Propagate session close: provider ends session when PaymentSession closes (EOF/cancel)

- Add integration tests for consumer wiring, underpay rejection, and close propagation; stabilize integration TestMain cleanup to avoid devenv port collisions

- Update backlog: mark SDS-034/035/036 done
- Add 'sds demo setup' to prepare devenv on-chain state (mint/approve/deposit escrow, provision/register provider, authorize signer) and print copy/paste commands

- Add 'sds demo flow' harness to run Init → ReportUsage loop → EndSession and verify the provider session becomes inactive

- Wire new commands under 'sds demo' and mark SDS-037/SDS-031 done in backlog
@maoueh
Copy link
Contributor

maoueh commented Feb 24, 2026

I think sadly you might have gone too fast here. I needed to do a full refactoring and many many changes, hopefully Codex will be able to go back on its feet.

I decided to create a sds sink run ..., this is a Data Service aware substreams run equivalent. I realized this could be a good "easy" way to bring some "default" sink (like the sql one for example plan to have under substreams sink sql at some point.

Anyway, my branch is now merged, happy to discuss further on Slack or over a call as needed.

@maoueh
Copy link
Contributor

maoueh commented Feb 24, 2026

For example, locally you should be able:

# Terminal 1
reflex -c .reflex

# Terminal 2
./devel/sds_sink run common@v0.1.0 map_clocks -s -1

Feel free to refactor how sds sink run is hooked exactly, I haven't fully looked at the architecture on that front.

@juanmardefago
Copy link
Contributor Author

I think sadly you might have gone too fast here. I needed to do a full refactoring and many many changes, hopefully Codex will be able to go back on its feet.

I decided to create a sds sink run ..., this is a Data Service aware substreams run equivalent. I realized this could be a good "easy" way to bring some "default" sink (like the sql one for example plan to have under substreams sink sql at some point.

Anyway, my branch is now merged, happy to discuss further on Slack or over a call as needed.

No worries! I was expecting some more changes in the plugins but didn't want to block you so I started planning/implementing the remaining steps to get to a workable demo (while taking as an assumption that the plugin would work eventually).

I'll probably see if I can simply reuse the current work, or worst case scenario just re-use the planning steps if possible and rebuild it from scratch.

I'll take a look at the refactored code tomorrow and continue from there! Thanks for the headsup!

@maoueh
Copy link
Contributor

maoueh commented Feb 24, 2026

FYI, I'm not planning on changing anything else this week, at least nothing that should have global impact.

My next steps is to replace the GlobalRepository in memory implementation by a persistent version so data will be available across restart and then create some tools to redeem RAVs and check state on chain to ensure operation are working as expected.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants