misc improvements and fixes#5
Merged
Merged
Conversation
- route: stamp RouterUpdated events with block.timestamp (not time.Now) so startup replay doesn't revive stale routers - route: skip periodic refresh when registeredAt==0 to respect explicit deregistration - route: derive event-monitor backtrack from sampled chain block time so the 7-day live-router window is covered on fast chains - server/webapi: rename ospWebapiDefaultPayTimeout -> ...Sec, bump 50 -> 600s (post-blocktime the unit silently shrank from blocks to seconds) - sdk: ResolveCondPayOnChain auto-deploys locally-registered VIRTUAL_CONTRACT conditions before submitting; removes the implicit 'call OnChainGetBooleanOutcome first' prerequisite - docs: drop stale regenerate-legacy-app-bindings.sh reference
- app: GetBooleanOutcome short-circuits to (false,false,nil) when isFinalized is false, matching PayResolver - celersdk: drop legacy BooleanCondition / SendTokenWithCondition / SendETHWithCondition / bc2c (no callers; SendConditionalPayment covers) - webapi: document block_duration as seconds in web_api.proto; inline the no-op paymentInfoFromClientPayment wrapper - cleanup comments and docs
There was a problem hiding this comment.
Pull request overview
This PR tightens time/timeout semantics and dispute-resolution behavior across the WebAPI, router controller, and SDK, with a focus on making on-chain interactions more robust (router refresh correctness; virtual-condition auto-deploy before on-chain resolve) and removing legacy SDK helpers.
Changes:
- Harden router refresh/event replay by deriving timestamps from the event’s block header and computing a chain-specific event backtrack window.
- Make on-chain conditional-pay resolution self-sufficient by auto-deploying locally-registered
VIRTUAL_CONTRACTconditions before submitting the resolve tx; update E2E coverage accordingly. - Raise the OSP WebAPI
SendTokendefault pay timeout and remove legacy SDK BooleanCondition helpers.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
webapi/proto/web_api.proto |
Clarifies block_duration semantics as unix-seconds (kept name for wire compatibility). |
webapi/api_server_test.go |
Updates regression test commentary for unknown session ID handling. |
webapi/api_server.go |
Drops legacy payment-info wrapper and routes directly to shared mapping. |
tools/scripts/README.md |
Simplifies generated-file header convention documentation. |
test/e2e/pay_dispute.go |
Updates dispute scenarios to validate SDK auto-deploy behavior for virtual conditions. |
server/osp_webapi_backend.go |
Increases default SendToken resolve-deadline window to 600s and clarifies naming/units. |
route/controller.go |
Adds ethclient dependency, uses canonical block timestamps for RouterUpdated events, and computes dynamic replay backtrack by sampled block time. |
cnode/cnode.go |
Wires ethclient into route controller construction. |
client/api.go |
Auto-deploys locally-registered virtual conditions before ResolveCondPayOnChain. |
celersdk/utils.go |
Removes legacy BooleanCondition conversion helper. |
celersdk/types.go |
Removes legacy BooleanCondition type. |
celersdk/pay.go |
Removes SendTokenWithCondition APIs and updates on-chain resolve docs for auto-deploy behavior. |
celersdk/appsession.go |
Updates SDK app-session module header comment to match trimmed surface area. |
app/appclient.go |
Adds EnsureAppChannelDeployed and short-circuits GetOutcome when IsFinalized is false. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
harden router refresh, fix pay-resolve / boolean-outcome edge cases, raise WebAPI default pay timeout, drop legacy SDK condition helpers