algod: Sunset v1 handlers#4847
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4847 +/- ##
==========================================
+ Coverage 53.31% 54.16% +0.84%
==========================================
Files 423 421 -2
Lines 53852 53044 -808
==========================================
+ Hits 28713 28731 +18
+ Misses 22854 22040 -814
+ Partials 2285 2273 -12
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| "type": "integer" | ||
| } | ||
| }, | ||
| "x-go-package": "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" |
There was a problem hiding this comment.
I'm not sure what this was being used for in the v2 /params path spec, but it looked unnecessary so I deleted it.
There was a problem hiding this comment.
I also looked and I'm unsure how x-go-package is used. In addition to general googling (e.g. https://swagger.io/specification/#specification-extensions), I reviewed these sources without finding a reference:
There was a problem hiding this comment.
As an additional sanity check, I confirmed Go SDK source code generation does not change.
There was a problem hiding this comment.
It looks like the generator does not use them either: https://github.com/algorand/generator/blob/master/src/main/java/com/algorand/sdkutils/generators/OpenApiParser.java#L129
winder
left a comment
There was a problem hiding this comment.
There is a bunch of code in router.go that adapts the handler library code into an echo register function. I suspect you can delete most of it.
It should also be possible to register a single handler for all endpoints that begin with /v2 instead of keeping all the existing routes.
I think this would also mean invalid v1 routes (e.g. The approach in this PR is:
I'm also open to returning the same error for all the v1 paths in favor of simplifying the routing here though. |
michaeldiamant
left a comment
There was a problem hiding this comment.
@algochoi Congrats on a net removal of 9,735 lines! ☕
Looks ready to me - Thanks for your effort across multiple PRs + tickets to help sunset algod v1 API in go-algorand.
Summary
This PR sunsets the v1 algod APIs.
Changes
http.StatusGone(410) response handler/versionsrouter.gov2clientin e2e runner Python scriptsswagger.jsonfile and generator scriptMakefileTest Plan
Router tests/Local node testing
Python SDK seems to handle the 410 error correctly. Circle CI Example.