Skip to content

Conversation

@fbac
Copy link
Collaborator

@fbac fbac commented Aug 15, 2025

  • Add all the current protocol errors and a way of translating the code.
  • Some files are renamed to force golang style snake case.

@fbac fbac requested a review from a team as a code owner August 15, 2025 14:08
@graphite-app
Copy link

graphite-app bot commented Aug 15, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@macroscopeapp
Copy link

macroscopeapp bot commented Aug 15, 2025

Add onchain errors dictionary and change blockchain.ExecuteTransaction to return ProtocolError with decoded revert reasons, enabling blockchain.RatesAdmin.AddRates to detect no-op updates

  • Introduce ProtocolError and BlockchainError types with IsNoChange() and formatted rendering in errors.go.
  • Wrap transaction execution failures using NewBlockchainError and return ProtocolError from blockchain.ExecuteTransaction in client.go.
  • Add a selector-to-signature map for protocol revert reasons and extraction via regex in errors.go.
  • Use IsNoChange() in blockchain.RatesAdmin.AddRates and adjust logging in rates_admin.go.
  • Add package comments and minor doc punctuation in interface.go.
  • Rename files to snake_case without content changes, e.g., blockchain_publisher.go, registry_admin.go, reports_manager.go.

📍Where to Start

Start with blockchain.ExecuteTransaction in client.go, then review NewBlockchainError and ProtocolError in errors.go, and finally see usage in blockchain.RatesAdmin.AddRates in rates_admin.go.


Macroscope summarized ed97c2e.

@fbac fbac closed this Aug 19, 2025
@fbac fbac reopened this Aug 19, 2025
@fbac fbac marked this pull request as draft August 25, 2025 15:15
@fbac fbac force-pushed the 08-15-blockchain_goodies branch from 8c0c288 to 3f50c68 Compare August 29, 2025 13:09
@fbac fbac force-pushed the 08-15-blockchain_goodies branch from 3f50c68 to beec365 Compare August 29, 2025 13:51
@fbac fbac requested a review from mkysel August 29, 2025 16:49
@fbac fbac marked this pull request as ready for review August 29, 2025 16:49
@fbac fbac merged commit d5697c4 into main Sep 2, 2025
10 checks passed
@fbac fbac deleted the 08-15-blockchain_goodies branch September 2, 2025 13:33
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.

3 participants