-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature: Mesh API Implementation #1021
Conversation
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.
Looking good! I'm half way through this review, so going to drop the comments I have so far -- all very minor.
I've yet to review the handlers
and common.rs
in full.
@@ -118,12 +119,14 @@ public final class RadixNodeModule extends AbstractModule { | |||
private static final int DEFAULT_ENGINE_STATE_API_PORT = 3336; | |||
private static final int DEFAULT_SYSTEM_API_PORT = 3334; | |||
private static final int DEFAULT_PROMETHEUS_API_PORT = 3335; | |||
private static final int DEFAULT_MESH_API_PORT = 3337; |
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.
Just a thought - we may need to talk to devops about getting this port hooked up in the babylon-nginx
image.
core/src/test/java/com/radixdlt/api/mesh_api/MeshApiMempoolEndpointsTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/com/radixdlt/api/mesh_api/MeshApiMempoolEndpointsTest.java
Show resolved
Hide resolved
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.
Some further comments. I can't approve as github thinks it's my PR!
Nearly all the comments are minor consistency / code location / naming improvements.
let fee_balance_change = fee_balance_changes | ||
.entry(global_ancestor_address) | ||
.or_insert_with(Decimal::zero); | ||
*fee_balance_change = fee_balance_change.sub_or_panic(*paid_fee_amount_xrd); |
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 assume paid_fee_amount_xrd
must be negative :D
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.
Not sure if I get this.
Whole method was copied from Core API
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.
Don't worry - this was just an unimportant observation.
I was a little surprised we were subtracting values, and expecting a positive balance coming out. But I assume paid_fee_amount_xrd
must be negative.
core-rust/mesh-api-server/src/mesh_api/handlers/network_options.rs
Outdated
Show resolved
Hide resolved
core-rust/mesh-api-server/src/mesh_api/handlers/construction_parse.rs
Outdated
Show resolved
Hide resolved
core-rust/mesh-api-server/src/mesh_api/handlers/construction_parse.rs
Outdated
Show resolved
Hide resolved
core-rust/mesh-api-server/src/mesh_api/handlers/construction_parse.rs
Outdated
Show resolved
Hide resolved
ecca0d7
to
9c481a0
Compare
aed5c8b
to
9e03a3b
Compare
ledger_header: &LedgerStateSummary, | ||
) -> Result<models::BlockIdentifier, MappingError> { | ||
to_mesh_api_block_identifier_from_state_version(ledger_header.state_version) | ||
to_mesh_api_block_identifier_from_state_version(database, ledger_header.state_version) |
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.
MINOR - In this case, we don't need to do a database read, because we have ledger_header.state_version
and ledger_header.ledger_hashes
:).
I'd perhaps expect a to_mesh_api_block_identifier(state_version: StateVersion, ledger_hashes: &LedgerHashes)
which to_mesh_api_block_identifier_from_ledger_header
can call directly, and to_mesh_api_block_identifier_from_state_version
can call via the transaction_identifiers
read.
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.
Wil fix it in next PR
core-rust/mesh-api-server/src/mesh_api/handlers/construction_payloads.rs
Show resolved
Hide resolved
@@ -1,3 +1,5 @@ | |||
api.mesh.enabled=$RADIXDLT_MESH_API_ENABLED |
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.
Can we put this just above api.mesh.port
?
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.
Was really confused when you initially asked to put it in the first line 🤣
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.
Latest changes LGTM
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.
Approve on @dhedey's behalf
Quality Gate passedIssues Measures |
Summary
This PR implements the Mesh API for Radix.
Details
Data API
Withdraw
andDeposit
operations onlyConstruction API
All endpoints have been implemented and only single signer/sender is supported.
Withdraw
andDeposit
operations onlyTesting
We've added the
mesh-cli
test suites to CI.