diff --git a/openapi.json b/openapi.json index 42514a47fc1..c30359ae94f 100644 --- a/openapi.json +++ b/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.0", "info": { "title": "NEAR Protocol JSON RPC API", - "version": "1.2.15" + "version": "1.3.22" }, "paths": { "/EXPERIMENTAL_call_function": { @@ -173,6 +173,62 @@ } } }, + "/EXPERIMENTAL_light_client_chunk_execution_proof": { + "post": { + "description": "Returns a proof that a chunk's certified execution roots are committed by the chain, verifiable against a trusted light client head.", + "operationId": "EXPERIMENTAL_light_client_chunk_execution_proof", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcRequest_for_EXPERIMENTAL_light_client_chunk_execution_proof" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcResponse_for_RpcLightClientChunkExecutionProofResponse_and_RpcLightClientProofError" + } + } + } + } + } + } + }, + "/EXPERIMENTAL_light_client_execution_outcome_proof": { + "post": { + "description": "Returns a transaction or receipt execution outcome together with its proof against the chunk's certified outcome root, verifiable against a trusted light client head.", + "operationId": "EXPERIMENTAL_light_client_execution_outcome_proof", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcRequest_for_EXPERIMENTAL_light_client_execution_outcome_proof" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcResponse_for_RpcLightClientExecutionOutcomeProofResponse_and_RpcLightClientProofError" + } + } + } + } + } + } + }, "/EXPERIMENTAL_light_client_proof": { "post": { "description": "Returns the proofs for a transaction execution.", @@ -201,6 +257,34 @@ } } }, + "/EXPERIMENTAL_light_client_state_proof": { + "post": { + "description": "Returns a value from a shard's state together with its trie proof against the chunk's certified state root, verifiable against a trusted light client head.", + "operationId": "EXPERIMENTAL_light_client_state_proof", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcRequest_for_EXPERIMENTAL_light_client_state_proof" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcResponse_for_RpcLightClientStateProofResponse_and_RpcLightClientProofError" + } + } + } + } + } + } + }, "/EXPERIMENTAL_maintenance_windows": { "post": { "description": "[Deprecated] Returns the future windows for maintenance in current epoch for the specified account. In the maintenance windows, the node will not be block producer or chunk producer. Consider using maintenance_windows instead.", @@ -343,7 +427,7 @@ }, "/EXPERIMENTAL_tx_status": { "post": { - "description": "Queries status of a transaction by hash, returning the final transaction result and details of all receipts.", + "description": "[Deprecated] Queries status of a transaction by hash, returning the final transaction result and details of all receipts. Consider using `tx_status` instead.", "operationId": "EXPERIMENTAL_tx_status", "requestBody": { "content": { @@ -1041,6 +1125,34 @@ } } }, + "/tx_status": { + "post": { + "description": "Queries status of a transaction by hash, returning the final transaction result and details of all receipts.", + "operationId": "tx_status", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcRequest_for_tx_status" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JsonRpcResponse_for_RpcTransactionResponse_and_RpcTransactionError" + } + } + } + } + } + } + }, "/validators": { "post": { "description": "Queries active validators on the network. Returns details and the state of validation on the blockchain.", @@ -2400,6 +2512,36 @@ "TotalPromiseInputSizeExceeded" ], "type": "object" + }, + { + "additionalProperties": false, + "description": "The receipt recorded more storage proof than\n`per_receipt_storage_proof_size_limit` allows.", + "properties": { + "ReceiptStorageProofSizeExceeded": { + "properties": { + "limit": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "limit" + ], + "type": "object" + } + }, + "required": [ + "ReceiptStorageProofSizeExceeded" + ], + "type": "object" + }, + { + "description": "The bytes of a `UniversalStateInit` action do not decode into a state init.\nAction validation rejects such an action before it runs, so this only fires\nif that check was bypassed.", + "enum": [ + "MalformedUniversalStateInit" + ], + "type": "string" } ] }, @@ -2780,6 +2922,30 @@ "WithdrawFromGasKey" ], "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "UniversalStateInit": { + "properties": { + "deposit": { + "$ref": "#/components/schemas/NearToken" + }, + "state_init": { + "$ref": "#/components/schemas/RawStateInit" + } + }, + "required": [ + "state_init", + "deposit" + ], + "type": "object" + } + }, + "required": [ + "UniversalStateInit" + ], + "type": "object" } ] }, @@ -3254,6 +3420,130 @@ "FunctionCallEmptyMethodName" ], "type": "string" + }, + { + "additionalProperties": false, + "description": "The receiver id of a `UniversalStateInit` action does not match the id\nderived from its state init.", + "properties": { + "InvalidUniversalStateInitReceiver": { + "properties": { + "derived_id": { + "$ref": "#/components/schemas/AccountId" + }, + "receiver_id": { + "$ref": "#/components/schemas/AccountId" + } + }, + "required": [ + "receiver_id", + "derived_id" + ], + "type": "object" + } + }, + "required": [ + "InvalidUniversalStateInitReceiver" + ], + "type": "object" + }, + { + "additionalProperties": false, + "description": "A storage key in a `UniversalStateInit` state init exceeds the limit.", + "properties": { + "UniversalStateInitKeyLengthExceeded": { + "properties": { + "length": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "limit": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "length", + "limit" + ], + "type": "object" + } + }, + "required": [ + "UniversalStateInitKeyLengthExceeded" + ], + "type": "object" + }, + { + "additionalProperties": false, + "description": "A storage value in a `UniversalStateInit` state init exceeds the limit.", + "properties": { + "UniversalStateInitValueLengthExceeded": { + "properties": { + "length": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "limit": { + "format": "uint64", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "length", + "limit" + ], + "type": "object" + } + }, + "required": [ + "UniversalStateInitValueLengthExceeded" + ], + "type": "object" + }, + { + "description": "The bytes in `RawStateInit` do not decode into `UniversalStateInit`.", + "enum": [ + "MalformedUniversalStateInit" + ], + "type": "string" + }, + { + "additionalProperties": false, + "description": "The transaction includes a feature that was removed at or before the\ncurrent protocol version. The counterpart of\n`UnsupportedProtocolFeature`, which covers features not yet available.", + "properties": { + "RemovedProtocolFeature": { + "properties": { + "protocol_feature": { + "type": "string" + }, + "version": { + "format": "uint32", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "protocol_feature", + "version" + ], + "type": "object" + } + }, + "required": [ + "RemovedProtocolFeature" + ], + "type": "object" + }, + { + "description": "A `WithdrawFromGasKey` action must not be nested inside a delegate action.", + "enum": [ + "WithdrawFromGasKeyNotAllowedInDelegate" + ], + "type": "string" } ] }, @@ -3874,16 +4164,86 @@ }, "type": "object" }, - "ChunkHash": { - "$ref": "#/components/schemas/CryptoHash" - }, - "ChunkHeaderView": { - "description": "Contains main info about the chunk.", + "ChunkExecutionProofView": { + "description": "Proof that a chunk's certified execution roots are committed by a spice block\nthat a light client can trust via its `light_client_head`.\n\n`roots_proof` recomputes the certifying block's `chunk_execution_root` from the leaf;\n`certifying_block_proof` places the certifying block into the head's block merkle tree.", "properties": { - "balance_burnt": { - "$ref": "#/components/schemas/NearToken" + "certifying_block_header_lite": { + "$ref": "#/components/schemas/LightClientBlockLiteView" }, - "bandwidth_requests": { + "certifying_block_proof": { + "items": { + "$ref": "#/components/schemas/MerklePathItem" + }, + "type": "array" + }, + "roots": { + "$ref": "#/components/schemas/ChunkExecutionRoots" + }, + "roots_proof": { + "items": { + "$ref": "#/components/schemas/MerklePathItem" + }, + "type": "array" + } + }, + "required": [ + "roots", + "roots_proof", + "certifying_block_header_lite", + "certifying_block_proof" + ], + "type": "object" + }, + "ChunkExecutionRoots": { + "description": "Merkle leaf committing to a single chunk's certified execution roots.\nThe `chunk_execution_root` in a spice block header is the merkle root over\nthese leaves, sorted by `chunk_id`.", + "oneOf": [ + { + "additionalProperties": false, + "properties": { + "V1": { + "$ref": "#/components/schemas/ChunkExecutionRootsV1" + } + }, + "required": [ + "V1" + ], + "type": "object" + } + ] + }, + "ChunkExecutionRootsV1": { + "properties": { + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" + }, + "outcome_root": { + "$ref": "#/components/schemas/CryptoHash" + }, + "outgoing_receipts_root": { + "$ref": "#/components/schemas/CryptoHash" + }, + "state_root": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "chunk_id", + "state_root", + "outcome_root", + "outgoing_receipts_root" + ], + "type": "object" + }, + "ChunkHash": { + "$ref": "#/components/schemas/CryptoHash" + }, + "ChunkHeaderView": { + "description": "Contains main info about the chunk.", + "properties": { + "balance_burnt": { + "$ref": "#/components/schemas/NearToken" + }, + "bandwidth_requests": { "anyOf": [ { "$ref": "#/components/schemas/BandwidthRequests" @@ -6932,6 +7292,22 @@ ], "description": "Cost per reading trie node from DB" }, + "universal_state_init_to_account_id_base": { + "allOf": [ + { + "$ref": "#/components/schemas/NearGas" + } + ], + "description": "Base cost of deriving a `0u` account id from a raw state init." + }, + "universal_state_init_to_account_id_byte": { + "allOf": [ + { + "$ref": "#/components/schemas/NearGas" + } + ], + "description": "Per byte of the raw state init." + }, "utf16_decoding_base": { "allOf": [ { @@ -8726,7 +9102,7 @@ "type": "string" }, { - "description": "Gas keys track nonces per index in dedicated storage, which a plain\naccess key nonce does not select, so a gas key must sign a `DelegateV2`\nwith a gas key nonce instead.", + "description": "A plain access key nonce does not select one of the gas key's nonces.\n`DelegateV2` was intended to carry a gas key nonce, however gas key\nmeta transactions are disabled. See `ProtocolFeature::RejectDelegateV2`.", "enum": [ "DelegateActionRequiresNonGasKey" ], @@ -9381,6 +9757,70 @@ "title": "JsonRpcRequest_for_EXPERIMENTAL_light_client_block_proof", "type": "object" }, + "JsonRpcRequest_for_EXPERIMENTAL_light_client_chunk_execution_proof": { + "properties": { + "id": { + "type": "string", + "default": "dontcare", + "description": "JSON-RPC request id. Auto-populated; can be any string." + }, + "jsonrpc": { + "type": "string", + "default": "2.0", + "enum": [ + "2.0" + ], + "description": "JSON-RPC protocol version. Always `2.0`." + }, + "method": { + "enum": [ + "EXPERIMENTAL_light_client_chunk_execution_proof" + ], + "type": "string" + }, + "params": { + "$ref": "#/components/schemas/RpcLightClientChunkExecutionProofRequest" + } + }, + "required": [ + "params", + "method" + ], + "title": "JsonRpcRequest_for_EXPERIMENTAL_light_client_chunk_execution_proof", + "type": "object" + }, + "JsonRpcRequest_for_EXPERIMENTAL_light_client_execution_outcome_proof": { + "properties": { + "id": { + "type": "string", + "default": "dontcare", + "description": "JSON-RPC request id. Auto-populated; can be any string." + }, + "jsonrpc": { + "type": "string", + "default": "2.0", + "enum": [ + "2.0" + ], + "description": "JSON-RPC protocol version. Always `2.0`." + }, + "method": { + "enum": [ + "EXPERIMENTAL_light_client_execution_outcome_proof" + ], + "type": "string" + }, + "params": { + "$ref": "#/components/schemas/RpcLightClientExecutionOutcomeProofRequest" + } + }, + "required": [ + "params", + "method" + ], + "title": "JsonRpcRequest_for_EXPERIMENTAL_light_client_execution_outcome_proof", + "type": "object" + }, "JsonRpcRequest_for_EXPERIMENTAL_light_client_proof": { "properties": { "id": { @@ -9413,6 +9853,38 @@ "title": "JsonRpcRequest_for_EXPERIMENTAL_light_client_proof", "type": "object" }, + "JsonRpcRequest_for_EXPERIMENTAL_light_client_state_proof": { + "properties": { + "id": { + "type": "string", + "default": "dontcare", + "description": "JSON-RPC request id. Auto-populated; can be any string." + }, + "jsonrpc": { + "type": "string", + "default": "2.0", + "enum": [ + "2.0" + ], + "description": "JSON-RPC protocol version. Always `2.0`." + }, + "method": { + "enum": [ + "EXPERIMENTAL_light_client_state_proof" + ], + "type": "string" + }, + "params": { + "$ref": "#/components/schemas/RpcLightClientStateProofRequest" + } + }, + "required": [ + "params", + "method" + ], + "title": "JsonRpcRequest_for_EXPERIMENTAL_light_client_state_proof", + "type": "object" + }, "JsonRpcRequest_for_EXPERIMENTAL_maintenance_windows": { "properties": { "id": { @@ -10373,6 +10845,38 @@ "title": "JsonRpcRequest_for_tx", "type": "object" }, + "JsonRpcRequest_for_tx_status": { + "properties": { + "id": { + "type": "string", + "default": "dontcare", + "description": "JSON-RPC request id. Auto-populated; can be any string." + }, + "jsonrpc": { + "type": "string", + "default": "2.0", + "enum": [ + "2.0" + ], + "description": "JSON-RPC protocol version. Always `2.0`." + }, + "method": { + "enum": [ + "tx_status" + ], + "type": "string" + }, + "params": { + "$ref": "#/components/schemas/RpcTransactionStatusRequest" + } + }, + "required": [ + "params", + "method" + ], + "title": "JsonRpcRequest_for_tx_status", + "type": "object" + }, "JsonRpcRequest_for_validators": { "properties": { "id": { @@ -10901,12 +11405,12 @@ "title": "JsonRpcResponse_for_RpcLightClientBlockProofResponse_and_RpcLightClientProofError", "type": "object" }, - "JsonRpcResponse_for_RpcLightClientExecutionProofResponse_and_RpcLightClientProofError": { + "JsonRpcResponse_for_RpcLightClientChunkExecutionProofResponse_and_RpcLightClientProofError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcLightClientExecutionProofResponse" + "$ref": "#/components/schemas/RpcLightClientChunkExecutionProofResponse" } }, "required": [ @@ -10938,15 +11442,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcLightClientExecutionProofResponse_and_RpcLightClientProofError", + "title": "JsonRpcResponse_for_RpcLightClientChunkExecutionProofResponse_and_RpcLightClientProofError", "type": "object" }, - "JsonRpcResponse_for_RpcLightClientNextBlockResponse_and_RpcLightClientNextBlockError": { + "JsonRpcResponse_for_RpcLightClientExecutionOutcomeProofResponse_and_RpcLightClientProofError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcLightClientNextBlockResponse" + "$ref": "#/components/schemas/RpcLightClientExecutionOutcomeProofResponse" } }, "required": [ @@ -10957,7 +11461,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcLightClientNextBlockError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcLightClientProofError" } }, "required": [ @@ -10978,15 +11482,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcLightClientNextBlockResponse_and_RpcLightClientNextBlockError", + "title": "JsonRpcResponse_for_RpcLightClientExecutionOutcomeProofResponse_and_RpcLightClientProofError", "type": "object" }, - "JsonRpcResponse_for_RpcNetworkInfoResponse_and_RpcNetworkInfoError": { + "JsonRpcResponse_for_RpcLightClientExecutionProofResponse_and_RpcLightClientProofError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcNetworkInfoResponse" + "$ref": "#/components/schemas/RpcLightClientExecutionProofResponse" } }, "required": [ @@ -10997,7 +11501,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcNetworkInfoError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcLightClientProofError" } }, "required": [ @@ -11018,15 +11522,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcNetworkInfoResponse_and_RpcNetworkInfoError", + "title": "JsonRpcResponse_for_RpcLightClientExecutionProofResponse_and_RpcLightClientProofError", "type": "object" }, - "JsonRpcResponse_for_RpcProtocolConfigResponse_and_RpcProtocolConfigError": { + "JsonRpcResponse_for_RpcLightClientNextBlockResponse_and_RpcLightClientNextBlockError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcProtocolConfigResponse" + "$ref": "#/components/schemas/RpcLightClientNextBlockResponse" } }, "required": [ @@ -11037,7 +11541,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcProtocolConfigError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcLightClientNextBlockError" } }, "required": [ @@ -11058,15 +11562,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcProtocolConfigResponse_and_RpcProtocolConfigError", + "title": "JsonRpcResponse_for_RpcLightClientNextBlockResponse_and_RpcLightClientNextBlockError", "type": "object" }, - "JsonRpcResponse_for_RpcQueryResponse_and_RpcQueryError": { + "JsonRpcResponse_for_RpcLightClientStateProofResponse_and_RpcLightClientProofError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcQueryResponse" + "$ref": "#/components/schemas/RpcLightClientStateProofResponse" } }, "required": [ @@ -11077,7 +11581,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcQueryError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcLightClientProofError" } }, "required": [ @@ -11098,15 +11602,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcQueryResponse_and_RpcQueryError", + "title": "JsonRpcResponse_for_RpcLightClientStateProofResponse_and_RpcLightClientProofError", "type": "object" }, - "JsonRpcResponse_for_RpcReceiptResponse_and_RpcReceiptError": { + "JsonRpcResponse_for_RpcNetworkInfoResponse_and_RpcNetworkInfoError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcReceiptResponse" + "$ref": "#/components/schemas/RpcNetworkInfoResponse" } }, "required": [ @@ -11117,7 +11621,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcReceiptError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcNetworkInfoError" } }, "required": [ @@ -11138,15 +11642,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcReceiptResponse_and_RpcReceiptError", + "title": "JsonRpcResponse_for_RpcNetworkInfoResponse_and_RpcNetworkInfoError", "type": "object" }, - "JsonRpcResponse_for_RpcReceiptToTxResponse_and_RpcReceiptToTxError": { + "JsonRpcResponse_for_RpcProtocolConfigResponse_and_RpcProtocolConfigError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcReceiptToTxResponse" + "$ref": "#/components/schemas/RpcProtocolConfigResponse" } }, "required": [ @@ -11157,7 +11661,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcReceiptToTxError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcProtocolConfigError" } }, "required": [ @@ -11178,15 +11682,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcReceiptToTxResponse_and_RpcReceiptToTxError", + "title": "JsonRpcResponse_for_RpcProtocolConfigResponse_and_RpcProtocolConfigError", "type": "object" }, - "JsonRpcResponse_for_RpcSplitStorageInfoResponse_and_RpcSplitStorageInfoError": { + "JsonRpcResponse_for_RpcQueryResponse_and_RpcQueryError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcSplitStorageInfoResponse" + "$ref": "#/components/schemas/RpcQueryResponse" } }, "required": [ @@ -11197,7 +11701,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcSplitStorageInfoError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcQueryError" } }, "required": [ @@ -11218,15 +11722,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcSplitStorageInfoResponse_and_RpcSplitStorageInfoError", + "title": "JsonRpcResponse_for_RpcQueryResponse_and_RpcQueryError", "type": "object" }, - "JsonRpcResponse_for_RpcStateChangesInBlockByTypeResponse_and_RpcStateChangesError": { + "JsonRpcResponse_for_RpcReceiptResponse_and_RpcReceiptError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcStateChangesInBlockByTypeResponse" + "$ref": "#/components/schemas/RpcReceiptResponse" } }, "required": [ @@ -11237,7 +11741,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcStateChangesError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcReceiptError" } }, "required": [ @@ -11258,15 +11762,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcStateChangesInBlockByTypeResponse_and_RpcStateChangesError", + "title": "JsonRpcResponse_for_RpcReceiptResponse_and_RpcReceiptError", "type": "object" }, - "JsonRpcResponse_for_RpcStateChangesInBlockResponse_and_RpcStateChangesError": { + "JsonRpcResponse_for_RpcReceiptToTxResponse_and_RpcReceiptToTxError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcStateChangesInBlockResponse" + "$ref": "#/components/schemas/RpcReceiptToTxResponse" } }, "required": [ @@ -11277,7 +11781,7 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcStateChangesError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcReceiptToTxError" } }, "required": [ @@ -11298,15 +11802,15 @@ "jsonrpc", "id" ], - "title": "JsonRpcResponse_for_RpcStateChangesInBlockResponse_and_RpcStateChangesError", + "title": "JsonRpcResponse_for_RpcReceiptToTxResponse_and_RpcReceiptToTxError", "type": "object" }, - "JsonRpcResponse_for_RpcStatusResponse_and_RpcStatusError": { + "JsonRpcResponse_for_RpcSplitStorageInfoResponse_and_RpcSplitStorageInfoError": { "oneOf": [ { "properties": { "result": { - "$ref": "#/components/schemas/RpcStatusResponse" + "$ref": "#/components/schemas/RpcSplitStorageInfoResponse" } }, "required": [ @@ -11317,7 +11821,127 @@ { "properties": { "error": { - "$ref": "#/components/schemas/ErrorWrapper_for_RpcStatusError" + "$ref": "#/components/schemas/ErrorWrapper_for_RpcSplitStorageInfoError" + } + }, + "required": [ + "error" + ], + "type": "object" + } + ], + "properties": { + "id": { + "type": "string" + }, + "jsonrpc": { + "type": "string" + } + }, + "required": [ + "jsonrpc", + "id" + ], + "title": "JsonRpcResponse_for_RpcSplitStorageInfoResponse_and_RpcSplitStorageInfoError", + "type": "object" + }, + "JsonRpcResponse_for_RpcStateChangesInBlockByTypeResponse_and_RpcStateChangesError": { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/components/schemas/RpcStateChangesInBlockByTypeResponse" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/components/schemas/ErrorWrapper_for_RpcStateChangesError" + } + }, + "required": [ + "error" + ], + "type": "object" + } + ], + "properties": { + "id": { + "type": "string" + }, + "jsonrpc": { + "type": "string" + } + }, + "required": [ + "jsonrpc", + "id" + ], + "title": "JsonRpcResponse_for_RpcStateChangesInBlockByTypeResponse_and_RpcStateChangesError", + "type": "object" + }, + "JsonRpcResponse_for_RpcStateChangesInBlockResponse_and_RpcStateChangesError": { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/components/schemas/RpcStateChangesInBlockResponse" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/components/schemas/ErrorWrapper_for_RpcStateChangesError" + } + }, + "required": [ + "error" + ], + "type": "object" + } + ], + "properties": { + "id": { + "type": "string" + }, + "jsonrpc": { + "type": "string" + } + }, + "required": [ + "jsonrpc", + "id" + ], + "title": "JsonRpcResponse_for_RpcStateChangesInBlockResponse_and_RpcStateChangesError", + "type": "object" + }, + "JsonRpcResponse_for_RpcStatusResponse_and_RpcStatusError": { + "oneOf": [ + { + "properties": { + "result": { + "$ref": "#/components/schemas/RpcStatusResponse" + } + }, + "required": [ + "result" + ], + "type": "object" + }, + { + "properties": { + "error": { + "$ref": "#/components/schemas/ErrorWrapper_for_RpcStatusError" } }, "required": [ @@ -12262,6 +12886,18 @@ "WithdrawFromGasKey" ], "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "UniversalStateInit": { + "$ref": "#/components/schemas/UniversalStateInitAction" + } + }, + "required": [ + "UniversalStateInit" + ], + "type": "object" } ] }, @@ -12573,6 +13209,10 @@ ], "type": "object" }, + "RawStateInit": { + "description": "Raw bytes containing borsh-serialized `UniversalStateInit`.\n\nThis is the protocol's view of a state init, not a mere transport wrapper: the\naccount ID is SHA3-256 over exactly these bytes. The typed form is a decoded\n*view* of them, used to install the state and to price the action, and it is\nnever re-serialized to derive an ID. Two encodings of the same logical value\nare two different accounts, which is deliberate: canonical encoding cannot be\nenforced end to end anyway, since contracts serialize their own nested state\ninside the opaque storage values.\n\nIt also lets an immutable contract pass through a `UniversalStateInit` version it\npredates: the bytes travel verbatim, so a version added after the contract was\ncompiled still works.\n\nBorsh-serializing `RawStateInit` writes a 4-byte length prefix before the\nbytes, which is how the `UniversalStateInit` action carries it as a field;\nover serde the bytes are base64. Neither is what the account ID hashes: that\nis `self.0` alone, never `borsh::to_vec(self)`.", + "type": "string" + }, "ReceiptEnumView": { "oneOf": [ { @@ -13592,6 +14232,17 @@ ], "description": "Duration to check for producing / skipping block." }, + "block_request_timeout": { + "description": "How long to wait for a state sync block request response", + "items": { + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "maxItems": 2, + "minItems": 2, + "type": "array" + }, "catchup_step_period": { "description": "Time between check to perform catchup.", "items": { @@ -13950,17 +14601,6 @@ ], "description": "Options for syncing state." }, - "state_sync_external_timeout": { - "description": "How long to wait for a state sync block request response", - "items": { - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "maxItems": 2, - "minItems": 2, - "type": "array" - }, "state_sync_p2p_timeout": { "description": "How long to wait for a response from p2p state sync", "items": { @@ -14275,6 +14915,106 @@ ], "type": "object" }, + "RpcLightClientChunkExecutionProofRequest": { + "properties": { + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" + }, + "light_client_head": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "chunk_id", + "light_client_head" + ], + "title": "RpcLightClientChunkExecutionProofRequest", + "type": "object" + }, + "RpcLightClientChunkExecutionProofResponse": { + "properties": { + "chunk_execution_proof": { + "$ref": "#/components/schemas/ChunkExecutionProofView" + } + }, + "required": [ + "chunk_execution_proof" + ], + "type": "object" + }, + "RpcLightClientExecutionOutcomeProofRequest": { + "oneOf": [ + { + "properties": { + "sender_id": { + "$ref": "#/components/schemas/AccountId" + }, + "transaction_hash": { + "$ref": "#/components/schemas/CryptoHash" + }, + "type": { + "enum": [ + "transaction" + ], + "type": "string" + } + }, + "required": [ + "type", + "transaction_hash", + "sender_id" + ], + "type": "object" + }, + { + "properties": { + "receipt_id": { + "$ref": "#/components/schemas/CryptoHash" + }, + "receiver_id": { + "$ref": "#/components/schemas/AccountId" + }, + "type": { + "enum": [ + "receipt" + ], + "type": "string" + } + }, + "required": [ + "type", + "receipt_id", + "receiver_id" + ], + "type": "object" + } + ], + "properties": { + "light_client_head": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "light_client_head" + ], + "title": "RpcLightClientExecutionOutcomeProofRequest", + "type": "object" + }, + "RpcLightClientExecutionOutcomeProofResponse": { + "properties": { + "chunk_execution_proof": { + "$ref": "#/components/schemas/ChunkExecutionProofView" + }, + "outcome_proof": { + "$ref": "#/components/schemas/ExecutionOutcomeWithIdView" + } + }, + "required": [ + "chunk_execution_proof", + "outcome_proof" + ], + "type": "object" + }, "RpcLightClientExecutionProofRequest": { "oneOf": [ { @@ -14417,13 +15157,207 @@ } }, "required": [ - "epoch_id" + "epoch_id" + ], + "type": "object" + }, + "name": { + "enum": [ + "EPOCH_OUT_OF_BOUNDS" + ], + "type": "string" + } + }, + "required": [ + "name", + "info" + ], + "type": "object" + } + ] + }, + "RpcLightClientNextBlockRequest": { + "properties": { + "last_block_hash": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "last_block_hash" + ], + "title": "RpcLightClientNextBlockRequest", + "type": "object" + }, + "RpcLightClientNextBlockResponse": { + "description": "A state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient).", + "properties": { + "approvals_after_next": { + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Signature" + }, + { + "enum": [ + null + ], + "nullable": true + } + ] + }, + "type": "array" + }, + "inner_lite": { + "allOf": [ + { + "$ref": "#/components/schemas/BlockHeaderInnerLiteView" + } + ], + "description": "Inner part of the block header that gets hashed, split into two parts, one that is sent\n to light clients, and the rest" + }, + "inner_rest_hash": { + "$ref": "#/components/schemas/CryptoHash" + }, + "next_block_inner_hash": { + "$ref": "#/components/schemas/CryptoHash" + }, + "next_bps": { + "items": { + "$ref": "#/components/schemas/ValidatorStakeView" + }, + "nullable": true, + "type": "array" + }, + "prev_block_hash": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "type": "object" + }, + "RpcLightClientProofError": { + "oneOf": [ + { + "properties": { + "info": { + "type": "object" + }, + "name": { + "enum": [ + "UNKNOWN_BLOCK" + ], + "type": "string" + } + }, + "required": [ + "name", + "info" + ], + "type": "object" + }, + { + "properties": { + "info": { + "properties": { + "execution_outcome_shard_id": { + "$ref": "#/components/schemas/ShardId" + }, + "number_or_shards": { + "format": "uint", + "minimum": 0, + "type": "integer" + } + }, + "required": [ + "number_or_shards", + "execution_outcome_shard_id" + ], + "type": "object" + }, + "name": { + "enum": [ + "INCONSISTENT_STATE" + ], + "type": "string" + } + }, + "required": [ + "name", + "info" + ], + "type": "object" + }, + { + "properties": { + "info": { + "properties": { + "transaction_or_receipt_id": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "transaction_or_receipt_id" + ], + "type": "object" + }, + "name": { + "enum": [ + "NOT_CONFIRMED" + ], + "type": "string" + } + }, + "required": [ + "name", + "info" + ], + "type": "object" + }, + { + "properties": { + "info": { + "properties": { + "transaction_or_receipt_id": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "transaction_or_receipt_id" + ], + "type": "object" + }, + "name": { + "enum": [ + "UNKNOWN_TRANSACTION_OR_RECEIPT" + ], + "type": "string" + } + }, + "required": [ + "name", + "info" + ], + "type": "object" + }, + { + "properties": { + "info": { + "properties": { + "shard_id": { + "$ref": "#/components/schemas/ShardId" + }, + "transaction_or_receipt_id": { + "$ref": "#/components/schemas/CryptoHash" + } + }, + "required": [ + "transaction_or_receipt_id", + "shard_id" ], "type": "object" }, "name": { "enum": [ - "EPOCH_OUT_OF_BOUNDS" + "UNAVAILABLE_SHARD" ], "type": "string" } @@ -14433,77 +15367,23 @@ "info" ], "type": "object" - } - ] - }, - "RpcLightClientNextBlockRequest": { - "properties": { - "last_block_hash": { - "$ref": "#/components/schemas/CryptoHash" - } - }, - "required": [ - "last_block_hash" - ], - "title": "RpcLightClientNextBlockRequest", - "type": "object" - }, - "RpcLightClientNextBlockResponse": { - "description": "A state for the current head of a light client. More info [here](https://nomicon.io/ChainSpec/LightClient).", - "properties": { - "approvals_after_next": { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/Signature" - }, - { - "enum": [ - null - ], - "nullable": true - } - ] - }, - "type": "array" - }, - "inner_lite": { - "allOf": [ - { - "$ref": "#/components/schemas/BlockHeaderInnerLiteView" - } - ], - "description": "Inner part of the block header that gets hashed, split into two parts, one that is sent\n to light clients, and the rest" - }, - "inner_rest_hash": { - "$ref": "#/components/schemas/CryptoHash" - }, - "next_block_inner_hash": { - "$ref": "#/components/schemas/CryptoHash" - }, - "next_bps": { - "items": { - "$ref": "#/components/schemas/ValidatorStakeView" - }, - "nullable": true, - "type": "array" }, - "prev_block_hash": { - "$ref": "#/components/schemas/CryptoHash" - } - }, - "type": "object" - }, - "RpcLightClientProofError": { - "oneOf": [ { "properties": { "info": { + "properties": { + "shard_id": { + "$ref": "#/components/schemas/ShardId" + } + }, + "required": [ + "shard_id" + ], "type": "object" }, "name": { "enum": [ - "UNKNOWN_BLOCK" + "SHARD_NOT_TRACKED" ], "type": "string" } @@ -14518,24 +15398,26 @@ "properties": { "info": { "properties": { - "execution_outcome_shard_id": { + "account_id": { + "$ref": "#/components/schemas/AccountId" + }, + "account_shard_id": { "$ref": "#/components/schemas/ShardId" }, - "number_or_shards": { - "format": "uint", - "minimum": 0, - "type": "integer" + "requested_shard_id": { + "$ref": "#/components/schemas/ShardId" } }, "required": [ - "number_or_shards", - "execution_outcome_shard_id" + "account_id", + "account_shard_id", + "requested_shard_id" ], "type": "object" }, "name": { "enum": [ - "INCONSISTENT_STATE" + "TARGET_SHARD_MISMATCH" ], "type": "string" } @@ -14550,18 +15432,18 @@ "properties": { "info": { "properties": { - "transaction_or_receipt_id": { - "$ref": "#/components/schemas/CryptoHash" + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" } }, "required": [ - "transaction_or_receipt_id" + "chunk_id" ], "type": "object" }, "name": { "enum": [ - "NOT_CONFIRMED" + "STATE_NOT_AVAILABLE" ], "type": "string" } @@ -14576,18 +15458,18 @@ "properties": { "info": { "properties": { - "transaction_or_receipt_id": { - "$ref": "#/components/schemas/CryptoHash" + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" } }, "required": [ - "transaction_or_receipt_id" + "chunk_id" ], "type": "object" }, "name": { "enum": [ - "UNKNOWN_TRANSACTION_OR_RECEIPT" + "CHUNK_NOT_CERTIFIED" ], "type": "string" } @@ -14602,22 +15484,30 @@ "properties": { "info": { "properties": { - "shard_id": { - "$ref": "#/components/schemas/ShardId" + "certifying_block_height": { + "format": "uint64", + "minimum": 0, + "type": "integer" }, - "transaction_or_receipt_id": { - "$ref": "#/components/schemas/CryptoHash" + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" + }, + "head_height": { + "format": "uint64", + "minimum": 0, + "type": "integer" } }, "required": [ - "transaction_or_receipt_id", - "shard_id" + "chunk_id", + "certifying_block_height", + "head_height" ], "type": "object" }, "name": { "enum": [ - "UNAVAILABLE_SHARD" + "LIGHT_CLIENT_HEAD_TOO_OLD" ], "type": "string" } @@ -14656,6 +15546,41 @@ } ] }, + "RpcLightClientStateProofRequest": { + "properties": { + "chunk_id": { + "$ref": "#/components/schemas/SpiceChunkId" + }, + "light_client_head": { + "$ref": "#/components/schemas/CryptoHash" + }, + "target": { + "$ref": "#/components/schemas/StateProofTarget" + } + }, + "required": [ + "chunk_id", + "target", + "light_client_head" + ], + "title": "RpcLightClientStateProofRequest", + "type": "object" + }, + "RpcLightClientStateProofResponse": { + "properties": { + "chunk_execution_proof": { + "$ref": "#/components/schemas/ChunkExecutionProofView" + }, + "state_proof": { + "$ref": "#/components/schemas/StateProofView" + } + }, + "required": [ + "chunk_execution_proof", + "state_proof" + ], + "type": "object" + }, "RpcMaintenanceWindowsError": { "oneOf": [ { @@ -20405,6 +21330,22 @@ ], "type": "object" }, + "SpiceChunkId": { + "description": "In spice missing chunks and equivalent to empty chunks so block hash and shard id always\nuniquely identifies chunks.", + "properties": { + "block_hash": { + "$ref": "#/components/schemas/CryptoHash" + }, + "shard_id": { + "$ref": "#/components/schemas/ShardId" + } + }, + "required": [ + "block_hash", + "shard_id" + ], + "type": "object" + }, "StakeAction": { "description": "An action which stakes signer_id tokens and setup's validator public key", "properties": { @@ -21065,6 +22006,119 @@ ], "type": "object" }, + "StateProofTarget": { + "description": "Which piece of a shard's state a light-client state proof targets.\n\nAn account that runs a global contract has no local code, so `LocalContractCode` is\nabsent for it. `Account::contract()` says which case applies.", + "oneOf": [ + { + "properties": { + "account_id": { + "$ref": "#/components/schemas/AccountId" + }, + "target_type": { + "enum": [ + "account" + ], + "type": "string" + } + }, + "required": [ + "target_type", + "account_id" + ], + "type": "object" + }, + { + "properties": { + "account_id": { + "$ref": "#/components/schemas/AccountId" + }, + "target_type": { + "enum": [ + "local_contract_code" + ], + "type": "string" + } + }, + "required": [ + "target_type", + "account_id" + ], + "type": "object" + }, + { + "properties": { + "account_id": { + "$ref": "#/components/schemas/AccountId" + }, + "key": { + "$ref": "#/components/schemas/StoreKey" + }, + "target_type": { + "enum": [ + "contract_data" + ], + "type": "string" + } + }, + "required": [ + "target_type", + "account_id", + "key" + ], + "type": "object" + }, + { + "properties": { + "account_id": { + "$ref": "#/components/schemas/AccountId" + }, + "public_key": { + "$ref": "#/components/schemas/PublicKey" + }, + "target_type": { + "enum": [ + "access_key" + ], + "type": "string" + } + }, + "required": [ + "target_type", + "account_id", + "public_key" + ], + "type": "object" + } + ] + }, + "StateProofView": { + "description": "A value read from a shard's state, with the trie nodes that prove it against the\nchunk's `state_root`. An absent `value` is proved the same way.", + "properties": { + "nodes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "value": { + "anyOf": [ + { + "$ref": "#/components/schemas/StoreValue" + }, + { + "enum": [ + null + ], + "nullable": true + } + ] + } + }, + "required": [ + "nodes" + ], + "type": "object" + }, "StateSyncConfig": { "properties": { "concurrency": { @@ -21671,6 +22725,22 @@ ], "default": "EXECUTED_OPTIMISTIC" }, + "UniversalStateInitAction": { + "description": "Create a `0u` universal account from its state init. The receiver id must\nequal `derive_universal_account_id(state_init)`; the attached `deposit`\ncovers the new account's storage staking.\n\nThe state init travels as the bytes the producer serialized, because the\nreceiver id commits to exactly those bytes. The typed [`UniversalStateInit`]\nis a decoded view of them, used where the state has to be installed or priced.", + "properties": { + "deposit": { + "$ref": "#/components/schemas/NearToken" + }, + "state_init": { + "$ref": "#/components/schemas/RawStateInit" + } + }, + "required": [ + "state_init", + "deposit" + ], + "type": "object" + }, "UseGlobalContractAction": { "description": "Use global contract action", "properties": { @@ -21785,6 +22855,10 @@ ], "description": "See [VMConfig::storage_get_mode](crate::vm::Config::storage_get_mode)." }, + "universal_accounts": { + "description": "See [VMConfig::universal_accounts](crate::vm::Config::universal_accounts).", + "type": "boolean" + }, "vm_kind": { "allOf": [ {