Skip to content

Commit

Permalink
Remove 'juliet' from the RPC sidecar (#289)
Browse files Browse the repository at this point in the history
* Thread payload via Framed tokio transport

* Remove juliet-related parameters from config

* Add binary port message timeout to config

* Add error handling in 'send_request'

* Fix typo

* Tests in sidecar no longer use juliet

* Clean-up

* Respect the request limit

* Update RPC schema

* Update speculative execution server schema

* Bring back reconnection loop

* Add separate timeout for client readiness

* Update RPC schema

* Update speculative execution server schema

* Point at git branch temporarily

---------

Co-authored-by: Jacek Malec <[email protected]>
  • Loading branch information
rafal-ch and jacek-casper authored Apr 29, 2024
1 parent c91da28 commit 42d1324
Show file tree
Hide file tree
Showing 11 changed files with 363 additions and 299 deletions.
35 changes: 26 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ members = [
anyhow = "1"
async-stream = "0.3.4"
async-trait = "0.1.77"
casper-types = { git = "https://github.com/casper-network/casper-node", branch = "feat-2.0" }
casper-binary-port = { git = "https://github.com/casper-network/casper-node", branch = "feat-2.0" }
casper-types = { git = "https://github.com/rafal-ch/casper-node", branch = "julietless_node_2" }
casper-binary-port = { git = "https://github.com/rafal-ch/casper-node", branch = "julietless_node_2" }
casper-event-sidecar = { path = "./event_sidecar", version = "1.0.0" }
casper-event-types = { path = "./types", version = "1.0.0" }
casper-rpc-sidecar = { path = "./rpc_sidecar", version = "1.0.0" }
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,7 @@ cors_origin = ''
[rpc_server.node_client]
address = '127.0.0.1:28101'
max_request_size_bytes = 4_194_304
max_response_size_bytes = 4_194_304
max_message_size_bytes = 4_194_304
request_limit = 3
request_buffer_size = 16
Expand Down Expand Up @@ -171,8 +170,7 @@ max_attempts = 30
* `speculative_exec_server.cors_origin` - Configures the CORS origin.

* `node_client.address` - Address of the Casper Node binary port
* `node_client.max_request_size_bytes` - Maximum request size to the binary port in bytes.
* `node_client.max_response_size_bytes` - Maximum response size from the binary port in bytes.
* `node_client.max_message_size_bytes` - Maximum binary port message size in bytes.
* `node_client.request_limit` - Maximum number of in-flight requests.
* `node_client.request_buffer_size` - Number of node requests that can be buffered.

Expand Down
10 changes: 6 additions & 4 deletions resources/example_configs/default_rpc_only_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ cors_origin = ''
[rpc_server.node_client]
# The address of the node to connect to.
address = '127.0.0.1:28104'
# Maximum size of a request in bytes.
max_request_size_bytes = 4_194_304
# Maximum size of a response in bytes.
max_response_size_bytes = 4_194_304
# Maximum size of a message in bytes.
max_message_size_bytes = 4_194_304
# Maximum number of in-flight node requests.
request_limit = 3
# Number of node requests that can be buffered.
request_buffer_size = 16
# Timeout for a node request in seconds.
message_timeout_secs = 30
# Timeout specifying how long to wait for binary port client to be available.
client_access_timeout_secs = 2

[rpc_server.node_client.exponential_backoff]
# The initial delay in milliseconds before the first retry.
Expand Down
113 changes: 68 additions & 45 deletions resources/test/rpc_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@
}
}
],
"size_estimate": 186,
"effects": [
{
"key": "account-hash-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb",
Expand Down Expand Up @@ -617,6 +618,7 @@
}
}
],
"size_estimate": 186,
"effects": [
{
"key": "account-hash-2c4a11c062a8a337bfc97e27fd66291caeb2c65865dcb5d3ef3759c4c97efecb",
Expand Down Expand Up @@ -3194,9 +3196,7 @@
"Reserved": {
"type": "object",
"required": [
"paid_amount",
"receipt",
"strike_price"
"receipt"
],
"properties": {
"receipt": {
Expand All @@ -3206,18 +3206,6 @@
"$ref": "#/components/schemas/Digest"
}
]
},
"paid_amount": {
"description": "Price paid in the past to reserve space in a future block.",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"strike_price": {
"description": "The gas price at the time of reservation.",
"type": "integer",
"format": "uint8",
"minimum": 0.0
}
},
"additionalProperties": false
Expand Down Expand Up @@ -4860,6 +4848,7 @@
"initiator",
"limit",
"payment",
"size_estimate",
"transfers"
],
"properties": {
Expand Down Expand Up @@ -4916,6 +4905,12 @@
"$ref": "#/components/schemas/Transfer"
}
},
"size_estimate": {
"description": "The size estimate of the transaction",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"effects": {
"description": "The effects of executing this transaction.",
"allOf": [
Expand Down Expand Up @@ -5464,6 +5459,19 @@
}
},
"additionalProperties": false
},
{
"description": "A reservation record.",
"type": "object",
"required": [
"Reservation"
],
"properties": {
"Reservation": {
"$ref": "#/components/schemas/ReservationKind"
}
},
"additionalProperties": false
}
]
},
Expand Down Expand Up @@ -5785,11 +5793,10 @@
},
"versions": {
"description": "All versions (enabled & disabled)",
"allOf": [
{
"$ref": "#/components/schemas/Array_of_ContractVersionAndHash"
}
]
"type": "array",
"items": {
"$ref": "#/components/schemas/ContractVersion"
}
},
"disabled_versions": {
"description": "Disabled versions",
Expand Down Expand Up @@ -5817,35 +5824,33 @@
}
}
},
"Array_of_ContractVersionAndHash": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ContractVersionAndHash"
}
},
"ContractVersionAndHash": {
"ContractVersion": {
"type": "object",
"required": [
"contract_entity_hash",
"contract_version_key"
"contract_hash",
"contract_version",
"protocol_version_major"
],
"properties": {
"contract_version_key": {
"allOf": [
{
"$ref": "#/components/schemas/ContractVersionKey"
}
]
"protocol_version_major": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"contract_entity_hash": {
"allOf": [
{
"$ref": "#/components/schemas/ContractHash"
}
]
"contract_version": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"contract_hash": {
"$ref": "#/components/schemas/ContractHash"
}
}
},
"ContractHash": {
"description": "The hash address of the contract",
"type": "string"
},
"ContractVersionKey": {
"description": "Major element of `ProtocolVersion` combined with `ContractVersion`.",
"type": "array",
Expand All @@ -5864,10 +5869,6 @@
"maxItems": 2,
"minItems": 2
},
"ContractHash": {
"description": "The hash address of the contract",
"type": "string"
},
"Array_of_NamedUserGroup": {
"type": "array",
"items": {
Expand Down Expand Up @@ -6331,6 +6332,28 @@
}
}
},
"ReservationKind": {
"description": "Container for bytes recording location, type and data for a gas reservation",
"type": "object",
"required": [
"receipt",
"reservation_data",
"reservation_kind"
],
"properties": {
"receipt": {
"$ref": "#/components/schemas/Digest"
},
"reservation_kind": {
"type": "integer",
"format": "uint8",
"minimum": 0.0
},
"reservation_data": {
"$ref": "#/components/schemas/Bytes"
}
}
},
"TransformError": {
"description": "Error type for applying and combining transforms.\n\nA `TypeMismatch` occurs when a transform cannot be applied because the types are not compatible (e.g. trying to add a number to a string).",
"oneOf": [
Expand Down
Loading

0 comments on commit 42d1324

Please sign in to comment.