Skip to content

Conversation

jtobin
Copy link
Member

@jtobin jtobin commented Aug 25, 2025

Adds some structure to price oracle error codes, along with some custom handling for them. In particular, a code of '1' now corresponds to an 'unsupported asset' error, which, considered a 'public' error, is forwarded in the customizable message field of the reject messages sent to peers. An error with any other code continues, at present, to be treated as an unspecified error.

Resolves #1749, #1326.

(This is a refinement over the closed #1751, which forwarded errors indiscriminately.)

@jtobin jtobin requested review from GeorgeTsagk and ffranr August 25, 2025 11:28
@jtobin jtobin added error handling RFQ Work relating to TAP channel Request For Quote (RFQ). labels Aug 25, 2025
@jtobin jtobin force-pushed the oracle-error-codes branch from 0a5e9ab to 6bdb36a Compare August 25, 2025 11:35
@coveralls
Copy link

coveralls commented Aug 25, 2025

Pull Request Test Coverage Report for Build 17268575857

Details

  • 1 of 99 (1.01%) changed or added relevant lines in 4 files are covered.
  • 84 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.06%) to 56.558%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rfqmsg/reject.go 0 6 0.0%
rfq/oracle.go 0 12 0.0%
taprpc/priceoraclerpc/price_oracle.pb.go 1 23 4.35%
rfq/negotiator.go 0 58 0.0%
Files with Coverage Reduction New Missed Lines %
address/mock.go 2 96.2%
asset/group_key.go 2 72.15%
mssmt/compacted_tree.go 2 79.49%
tapdb/assets_common.go 2 78.72%
tapdb/sqlc/transfers.sql.go 2 82.65%
tapdb/sqlc/universe.sql.go 2 75.78%
tapchannel/aux_leaf_signer.go 3 43.43%
rfqmsg/records.go 4 70.8%
rpcserver.go 4 61.03%
tapdb/universe.go 4 81.64%
Totals Coverage Status
Change from base Build 17140538774: -0.06%
Covered Lines: 60774
Relevant Lines: 107454

💛 - Coveralls

@jtobin jtobin requested a review from ffranr August 28, 2025 15:47
@levmi levmi moved this from 🆕 New to 🏗 In progress in Taproot-Assets Project Board Sep 4, 2025
@levmi levmi moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Sep 11, 2025
Copy link
Contributor

@ffranr ffranr left a comment

Choose a reason for hiding this comment

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

I've taken another look through this.

IMO needs commit squash and then we can review the set of commits which will be merged.

@levmi levmi added this to the v0.8 milestone Sep 25, 2025
darioAnongba and others added 13 commits October 10, 2025 15:26
…-rpc-macaroonwhitelist

Improve `MacaroonWhitelist` Structure and Permission Granularity
Adds the 'UnspecifiedRejectCode' and 'UnavailableRejectCode' consts to
represent the two protocol-defined rejection error codes of 0 and 1,
respectively.

The 'NewRejectErr' utility produces a RejectErr with the
UnspecifiedRejectCode code, but pairs it with a custom error message.
Defines an OracleErrorCode type representing error codes returned by a
price oracle, and updates proto definitions accordingly.
Marshalls oracle error codes received over-the-wire into OracleErrorCode
values, which are returned in oracle error responses.
Adds a 'QueryError' type for capturing the error resulting from a price
oracle query. These errors are used to construct quote reject messages.
Adds a flag (defaulting to false) that indicates that the error returned
by a price oracle should be considered public, and can be safely
forwarded to peers. Updates proto definitions accordingly.
@jtobin jtobin force-pushed the oracle-error-codes branch from 5eaf8a9 to a164c40 Compare October 16, 2025 01:44
@jtobin jtobin changed the base branch from main to 0-8-0-staging October 16, 2025 01:44
@lightninglabs-deploy
Copy link

@jtobin, remember to re-request review from reviewers when ready

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

Labels

error handling RFQ Work relating to TAP channel Request For Quote (RFQ).

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

[feature]: structured error codes for price oracles

7 participants