-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(cli): add espresso-reader #150
Draft
endersonmaia
wants to merge
8
commits into
feature/cli-run-v2
Choose a base branch
from
feature/add-espresso-reader-to-cli
base: feature/cli-run-v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
97ec234
feat(cli): add espresso-reader
endersonmaia 14123e7
fixup! feat(cli): add espresso-reader
endersonmaia c661176
fixup! feat(cli): add espresso-reader
endersonmaia e52af8a
fixup! feat(cli): add espresso-reader
endersonmaia 1a2c635
fixup! feat(cli): add espresso-reader
endersonmaia 78886ad
fixup! feat(cli): add espresso-reader
endersonmaia 3e22f4e
chore(cli): bump cartesi/sdk to 0.12.0-alpha.6
endersonmaia fda0e28
fixup! fixup! feat(cli): add espresso-reader
endersonmaia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
services: | ||
anvil: | ||
image: cartesi/sdk:0.12.0-alpha.5 | ||
image: cartesi/sdk:0.12.0-alpha.6 | ||
command: | ||
[ | ||
"devnet", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rollups-espresso-reader does a weird thing: it publishes two endpoints
/nonce
and/submit
on a port configurable with env ESPRESSO_SERVICE_ENDPOINT (default I think is 8080). We'd need to expose these too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about this format?
/espresso/reader/nonce
/espresso/reader/submit
If the developer interaction if gonna be focused on those endpoints, we could even hide everything from
espresso-dev-node
and only publish those at/espresso/submit
and/espresso/nonce
, also.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miltonjonat I sent a fixup where you can access those endpoints at:
http://localhost:8080/espresso/reader/nonce
http://localhost:8080/espresso/reader/submit
Please, let me know if it works!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, these endpoints are currently conveniences for the Espresso integration, and strictly speaking they could (or should?) be part of another component separate from the reader itself. So, no, I wouldn't use "reader" there.
Frankly, I think it's also quite odd to put it under "espresso" in this context, because that "espresso" there is meant to be the (local) Espresso Network, while these are endpoints on the Node itself.
Tbh, the idea here was also that the Node would provide
/nonce
and/submit
functionalities as something more universal (i.e., to also be used when integrated with Avail, Celestia, etc). And that clients wouldn't even know which alt-DA was being used by the app/node.TL;DR, I'd use http://localhost:8080/nonce and http://localhost:8080/submit directly; or we could come up with a nice namespace for convenience endpoints of this kind (maybe http://localhost:8080/tx/nonce?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand there is no unified way to send a transaction. anvil expects ethereum transactions as specified by eth_sendTransaction, espresso expects a transaction object, avail has its own spec.
So having a single
/nonce
and/submit
at the root of the service, regardless the configured DA, with various formats will be extremely confusing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm exposing those espresso-dev-node ports to the host to test if thins are working, but they should be removed on the final version of this PR togethers with the
/espresso
endpoints for the proxy.About the
/nonce
and/submit
endpoints from the espresso-reader, I need a definition so I can apply in this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this differently. With Paio, we standardized an EIP-712 structure to be used when submitting tx's. This structure includes the target chainId and app address, nonce, and envisions payment info too. Avail and Celestia integrations would use this via Paio, and we adopted it for the Espresso integration as well (Espresso itself doesn't have any spec on the payload you submit, which doesn't even need to be signed atm). The idea is that you would use
/nonce
and/submit
for all L2 tx submissions (i.e., that use Paio / alt-DA), while of course clients would still send direct L1 Eth tx's via the InputBox for L1->L2 messages.Now, another interesting discussion would be to provide a standard Eth JSON-RPC API on the Node for these L2 tx's. I'd like that, but I don't know how viable it is. It would be part of that redesign discussion for all this architecture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, one path what would be very adherent to the current architecture would be something like
L2tx
, leading to http://localhost:8080/L2tx/nonce and http://localhost:8080/L2tx/submit (I suggestedtx
above, but I admit thatL2tx
would be more precise)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you going to use a single format for DAs with different requirements?
I.e. how do you define the namespace in case of Espresso?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current design, the client/user does not inform any DA-specific parameters in the payload it submits. Whatever is required to submit to the alt-DA configured for the application should be given by DA-specific parameters defined upon deployment of the app, and stored as on-chain app configuration. The Node will fetch that from the application contract (it's currently defined as an ABI encoded method+parameters), and thus know how to handle tx submission when
/submit
is called.