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
Implement Rosetta RPC #2738
Comments
@frol shouldn't it be P0? |
I left some room for the “on fire” P0 items. |
Checking in on this since we scoped it for < 1 week. Are we ready to hand back to Coinbase? |
Sorry, we are not. I am behind the schedule due to the relocation back home from Argentina. |
How is this going? We're trying to get a timeline from them but this integration is actually still the blocker. |
Any update here? |
The implementation is there, but Rosetta checker is not happy yet. I am currently resolving the mismatches between my understanding vs Rosetta expectations (working with Patrick from Coinbase on these). |
Moving to Phase 2. Will re-address when we get there. |
Q:
A:
@bowenwang1996 @nearmax @SkidanovAlex Implementation-wise, it is absolutely possible to attach the actions from the parent block instead of the current one, but I wonder how we communicate this mismatch with Explorer and the rest of the tooling... I can add any data into the metadata attached to the response, so I can have an extra field like |
The problem that we have is that our transactions is complete only when all of its receipts have completed, and they are all gradually executed through the span of several blocks and not just in the last block. So I suggest: included_in_block_height, completed_in_block_height. WDYT?
… On Jul 13, 2020, at 2:48 PM, Vlad Frolov ***@***.***> wrote:
Rosetta is very tightly coupled to the principle that “the block where a transaction shows up is where it is executed/applied”. I created an issue to improve our documentation here.
We ran into a similar modeling concern with Filecoin (who also has this executed in X + 1 abstraction) and our guidance was to include transactions in the blocks where they were executed/applied, not in the block where it originally showed up (before it was executed).
@bowenwang1996 <https://github.com/bowenwang1996> @nearmax <https://github.com/nearmax> @SkidanovAlex <https://github.com/SkidanovAlex> Implementation-wise, it is absolutely possible to attach the actions from the parent block instead of the current one, but I wonder how we communicate this mismatch with Explorer and the rest of the tooling... I can add any data into the metadata attached to the response, so I can have an extra field like included_in_block_height and executed_in_block_height. Does this sound reasonable to you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#2738 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AILKVB43PC7RRAS7ZYOGBITR3N6J3ANCNFSM4NMO3NOA>.
|
This is not correct. Transactions included in block X are executed when we apply block X. I see two potential confusions that might lead to your conclusion above:
|
Could you define what is "application of block X", and when according to the protocol it happens?
I would use light client to define when information is available. Information is available when it provably exists (no need for finality, since we can state that certain information provably exists but it was not globally agreed upon yet). Information that transaction was included is available at block X and information that this transaction has outcome Z is available at block X+1. |
I think it is a bit hard to formally define it. Informally, for a node the application of the block consists mainly of the following two things:
From the protocol point of view, it happens when a node receives the block and have all the relevant information to apply it (chunk parts if the node is a block/chunk producer or simply cares about some shard). We can also separate the application of a block from application of a chunk, but I intend to think that considering them together as one process makes more sense. |
Well, let's solve the specific problem with Rosetta. Rosetta watches for the transactions and receipts (all merged into a single entity "transaction" for Rosetta); once it observes a transaction, it wants to fetch information about the accounts involved in the transaction and fails to do that when we have a CreateAccount action, which only get executed with the receipt. So far it seems that our transactions should not expose actions (maybe expose them in free-form metadata). (BTW, Rosetta seem to want us to split a single TRANSFER action into two "operations": TRANSFER -10N from Alice & TRANSFER +10N to Bob, and also include the fees and rewards expressed in their terms of "operation", but we don't create any transaction for rewards...) |
Why does it matter? Is there also a concept of action in Rosetta? |
Small update to bring up some knowledge about Rosetta RPC core focus: Rosetta RPC was mainly designed to expose "balance-changing" events on blockchains. Thus, @evgenykuzyakov provided us with a complete list of balance-changing events in NEAR protocol:
|
Links to Rosetta docs relevant to account balances:
I think we can distinguish 3 types of balances:
Rosetta model with balance checks and sub-accounts complicates our implementation because you need to compute |
I don't see any workaround unless we give up and hide the UPD: Well, we still have transfers with every single transaction to pay the gas usage, so it is not that worse 🤷♂️ |
Removing from Phase 2, since it is not related. |
Resolves #2738 The spec is: https://raw.githubusercontent.com/coinbase/rosetta-specifications/master/api.json (you can view it on https://petstore.swagger.io/) [README](https://github.com/nearprotocol/nearcore/blob/feature/rosetta-api/chain/rosetta-rpc/README.md) This implementation is battle-tested and checked by Coinbase using automated tooling (rosetta-cli)
Construction API is not implemented yet. |
Resolves #2738 The spec is: https://raw.githubusercontent.com/coinbase/rosetta-specifications/master/api.json (you can view it on https://petstore.swagger.io/) [README](https://github.com/nearprotocol/nearcore/blob/feature/rosetta-api/chain/rosetta-rpc/README.md) This implementation is battle-tested and checked by Coinbase using automated tooling (rosetta-cli)
Resolves #2738 The spec is: https://raw.githubusercontent.com/coinbase/rosetta-specifications/master/api.json (you can view it on https://petstore.swagger.io/) [README](https://github.com/nearprotocol/nearcore/blob/feature/rosetta-api/chain/rosetta-rpc/README.md) This implementation is battle-tested and checked by Coinbase using automated tooling (rosetta-cli)
*Resolves #2738* * [x] define the endpoint interfaces (endpoints, models, requests validation) * [x] end-to-end API flow (most of the endpoints operate as expected) * [x] operations -> NEAR actions mapping (the sender account id can be messed up, needs an adjustment in the design) * [x] NEAR actions -> operations mapping for `/construction/parse` * [x] test operations <-> NEAR actions bijection (test is not passing, yet) * [x] upgrade to Rosetta 1.4.4
*Resolves #2738* * [x] define the endpoint interfaces (endpoints, models, requests validation) * [x] end-to-end API flow (most of the endpoints operate as expected) * [x] operations -> NEAR actions mapping (the sender account id can be messed up, needs an adjustment in the design) * [x] NEAR actions -> operations mapping for `/construction/parse` * [x] test operations <-> NEAR actions bijection (test is not passing, yet) * [x] upgrade to Rosetta 1.4.4
This is a high-priority request from a partner.
Rosetta is a public API spec defined to be a common denominator for blockchain projects.
As per the discussion (find some pieced below), we are going to build Rosetta RPC alongside with JSON RPC into nearcore under a feature-flag.
Rosetta Docs
Verify the API compliance with:
rosetta-cli check --server-url=<node>
@frol:
@ilblackdragon:
The text was updated successfully, but these errors were encountered: