Skip to content

Commit 047af01

Browse files
authored
Merge branch 'develop' into chore/build-for-wasm32
2 parents 260a436 + c76743e commit 047af01

File tree

11 files changed

+933
-3
lines changed

11 files changed

+933
-3
lines changed

docs/rpc/openapi.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,3 +948,72 @@ paths:
948948
$ref: ./api/core-node/get-health-error.schema.json
949949
example:
950950
$ref: ./api/core-node/get-health-error.example.json
951+
952+
/v3/contracts/fast-call-read/{contract_address}/{contract_name}/{function_name}:
953+
post:
954+
summary: Call read-only function in fast mode (no cost and memory tracking)
955+
tags:
956+
- Smart Contracts
957+
operationId: fast_call_read_only_function
958+
description: |
959+
Call a read-only public function on a given smart contract without cost tracking.
960+
961+
**This API endpoint requires a basic Authorization header.**
962+
963+
The smart contract and function are specified using the URL path. The arguments and the simulated tx-sender are supplied via the POST body in the following JSON format:
964+
responses:
965+
"200":
966+
description: Success
967+
content:
968+
application/json:
969+
schema:
970+
$ref: ./api/contract/post-call-read-only-fn.schema.json
971+
examples:
972+
success:
973+
$ref: ./api/contract/post-call-read-only-fn-success.example.json
974+
fail:
975+
$ref: ./api/contract/post-call-read-only-fn-fail.example.json
976+
"400":
977+
description: Endpoint not enabled.
978+
"401":
979+
description: Unauthorized.
980+
"408":
981+
description: ExecutionTime expired.
982+
parameters:
983+
- name: contract_address
984+
in: path
985+
required: true
986+
description: Stacks address
987+
schema:
988+
type: string
989+
- name: contract_name
990+
in: path
991+
required: true
992+
description: Contract name
993+
schema:
994+
type: string
995+
- name: function_name
996+
in: path
997+
required: true
998+
description: Function name
999+
schema:
1000+
type: string
1001+
- name: tip
1002+
in: query
1003+
schema:
1004+
type: string
1005+
description: The Stacks chain tip to query from. If tip == latest, the query will be run from the latest
1006+
known tip (includes unconfirmed state).
1007+
required: false
1008+
requestBody:
1009+
description: map of arguments and the simulated tx-sender where sender is either a Contract identifier or a normal Stacks address, and arguments is an array of hex serialized Clarity values.
1010+
required: true
1011+
content:
1012+
application/json:
1013+
schema:
1014+
$ref: './entities/contracts/read-only-function-args.schema.json'
1015+
example:
1016+
sender: 'SP31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZW97B5P0.get-info'
1017+
arguments:
1018+
- '0x0011...'
1019+
- '0x00231...'

stackslib/src/config/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,6 +3719,13 @@ pub struct ConnectionOptionsFile {
37193719
/// @default: [`DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS`]
37203720
/// @units: seconds
37213721
pub block_proposal_max_age_secs: Option<u64>,
3722+
3723+
/// Maximum time (in seconds) that a readonly call in free cost tracking mode
3724+
/// can run before being interrupted
3725+
/// ---
3726+
/// @default: 30
3727+
/// @units: seconds
3728+
pub read_only_max_execution_time_secs: Option<u64>,
37223729
}
37233730

37243731
impl ConnectionOptionsFile {
@@ -3870,6 +3877,9 @@ impl ConnectionOptionsFile {
38703877
block_proposal_max_age_secs: self
38713878
.block_proposal_max_age_secs
38723879
.unwrap_or(DEFAULT_BLOCK_PROPOSAL_MAX_AGE_SECS),
3880+
read_only_max_execution_time_secs: self
3881+
.read_only_max_execution_time_secs
3882+
.unwrap_or(default.read_only_max_execution_time_secs),
38733883
..default
38743884
})
38753885
}

stackslib/src/net/api/callreadonly.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct CallReadOnlyResponse {
5959

6060
#[derive(Clone)]
6161
pub struct RPCCallReadOnlyRequestHandler {
62-
maximum_call_argument_size: u32,
62+
pub maximum_call_argument_size: u32,
6363
read_only_call_limit: ExecutionCost,
6464

6565
/// Runtime fields

0 commit comments

Comments
 (0)