Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR 35: Rosetta API Support #7492

Merged
merged 95 commits into from
Nov 6, 2020
Merged

ADR 35: Rosetta API Support #7492

merged 95 commits into from
Nov 6, 2020

Conversation

jgimeno
Copy link
Contributor

@jgimeno jgimeno commented Oct 9, 2020

Description

Related PR: #7602


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

aaronc
aaronc previously requested changes Oct 9, 2020
docs/architecture/adr-030-rosetta-api-support.md Outdated Show resolved Hide resolved
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This generally looks okay, but would be useful to have a little more context on what adapters look like themselves.

Comment on lines +130 to +134
func NewNetwork(options Options) service.Network {
cosmosClient := cosmos.NewClient(fmt.Sprintf("http://%s", options.CosmosEndpoint))
tendermintClient := tendermint.NewClient(fmt.Sprintf("http://%s", options.TendermintEndpoint))

return service.Network{
Copy link
Member

Choose a reason for hiding this comment

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

This diverges from the constructor defined above

Copy link
Contributor

Choose a reason for hiding this comment

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

@jgimeno bump

Copy link
Contributor

Choose a reason for hiding this comment

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

@aaronc True that, yet this is an example, i.e. the actual code would diverge slightly between 0.39 and 0.40 - as described in the comment above: each Cosmos SDK release series will have version specific implementations of Network and Adapter, as well as a NewNetwork constructor.

For instance, that's the signature of this very constructor for Stargate:

NewNetwork(cdc codec.BinaryMarshaler, options Options) service.Network

The constructor's signature for Launchpad follows:

NewNetwork(cdc *codec.Codec, options Options) service.Network

I hope this helps.

Comment on lines +140 to +148
Adapter: newAdapter(
cosmosClient,
tendermintClient,
properties{
Blockchain: options.Blockchain,
Network: options.Network,
OfflineMode: options.OfflineMode,
},
),
Copy link
Member

Choose a reason for hiding this comment

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

Is there an example of the adapter that should be linked to in this ADR for reference?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jgimeno bump

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can use the one for launchpad, but is in a branch and not merged yet. Is that ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, go ahead @jgimeno. Use a permalink

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func newAdapter(cdc *codec.Codec, cosmos SdkClient, tendermint TendermintClient, options properties) rosetta.Adapter {

This is the adapter constructor in the launchpad implementation, but the implementation itself is based in several files.

Copy link
Contributor

Choose a reason for hiding this comment

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

The team is finalising the Stargate's Adapter implementation. I think we can show some simplified code example here?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does not have to be complete - this is an ADR after all, not a code walkthrough. Either some pseudo code or a code snippet should it.

@aaronc aaronc dismissed their stale review October 30, 2020 20:32

commented again

@alessio
Copy link
Contributor

alessio commented Nov 4, 2020

@jgimeno looks like we have a few valid points from @aaronc to address, then this should be good to go 👍

aaronc
aaronc previously requested changes Nov 6, 2020
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

LGTM. But please add to this ADR to the README! @alessio free to dismiss my change request once that's done.

@alessio
Copy link
Contributor

alessio commented Nov 6, 2020

@aaronc README.md updated. Hence dismissing your review. Thanks!

@alessio alessio dismissed aaronc’s stale review November 6, 2020 10:23

Request acknowledged and executed.

@alessio alessio merged commit 4d833f9 into master Nov 6, 2020
@alessio alessio deleted the jonathan/rosetta-adr branch November 6, 2020 10:39
@sahith-narahari sahith-narahari mentioned this pull request Nov 26, 2020
9 tasks
alessio pushed a commit that referenced this pull request Jan 21, 2021
Ref: #7492

Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Frojdi Dymylja <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
Co-authored-by: Federico Kunze <[email protected]>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Ref: cosmos#7492

Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Frojdi Dymylja <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
Co-authored-by: Federico Kunze <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: ADR An issue or PR relating to an architectural decision record
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants