In the context of the SRC-6860web3:// standard, this SRC extends the SRC-6944 resolve mode: This standard defines a new optional web3-next-chunk HTTP header returned by the request() call, that contains a web3:// URL pointing to the next data chunk of the resource data. Chunks are streamed to the web3:// client, and it loops until the web3-next-chunk header is no longer present.
Motivation
Sila RPC endpoints have a gas limit, which can be reached when serving large content. By adding a chunking feature, we add the possibility to serve arbitrary sized content.
Specification
In the SRC-6944 resolve mode, this standard introduces the new optional web3-next-chunk HTTP header, to be returned in the headersKeyValue array of the request() method defined in SRC-6944.
The value of the header is either a complete web3:// URL, or a relative one. The target smart contract must use the SRC-6944 resolve mode.
When processing the result of the initial request() call, the protocol return the HTTP status code, HTTP headers and body right away to the web3:// client. If a web3-next-chunk header is present, it parse the URL. If the URL is invalid, or the target smart contract is not using the SRC-6944 resolve mode, the HTTP data streaming is ended with an error. Otherwise it call the request() method, ignore the returned statusCode, send the body data as the next chunk of data, and if a web3-next-chunk header is again present, loops until no more are present.
Rationale
The use of a header pointing to the next chunk was chosen because it does not require changes to the SRC-6944request() interface, and the use of a web3:// URL in the header add flexibility to the means to provide the next chunk.
Qi Zhou (@qizhou), Nicolas Deschildre (@nand2), "SRC-7617: Chunk support for SRC-5219 mode in Web3 URL [DRAFT]," Sila Improvement Proposals, no. 7617, February 2024. Available: https://sips.sila.org/SIPS/sip-7617.