in3 icon indicating copy to clipboard operation
in3 copied to clipboard

Error: `malformed request` when jsonrpc id is a string

Open Muhammad-Altabba opened this issue 2 years ago • 1 comments

Steps to reproduce

Using in3 as an HTTP provider to send a JSON request to that uses Uuid for the jsonrpc id.

Using web3.js version 4.0.1-alpha.1:

// use the In3Client as Http-Provider for web3.js
const web3 = new Web3(
	new In3Client({
		proof: 'standard',
		signatureCount: 1,
		requestCount: 2,
		chainId: 'mainnet',
	}).createWeb3Provider(),
);

// get the last block number
const block = await web3.eth.getBlockNumber();
console.log(block);

Expected behavior

To accept a string for the Json Rpc id. According the the specification https://www.jsonrpc.org/specification

id An identifier established by the Client that MUST contain a String, Number, or NULL value if included....

Actual behavior

Got the error:

Error malformed request fetching request {"id":"33ad76b8-5a51-488b-9880-7227668e95cf","method":"eth_blockNumber","params":[],"jsonrpc":"2.0"} from http://rpc.bc-labs.dev/mainnet

System configuration

Incubed version

3.3.3

Request

{"id":"33ad76b8-5a51-488b-9880-7227668e95cf","method":"eth_blockNumber","params":[],"jsonrpc":"2.0"}

Incubed Configuration

Using in3 with web3.js version 4.0.1-alpha.1

Chain

Tested with mainchain. But is supposed to exist regardless of the chain.

Muhammad-Altabba avatar Nov 23 '22 12:11 Muhammad-Altabba

Hello Muhammad (long time man). Thank you for reporting. We are prioritizing this.

leonardotc avatar Nov 24 '22 10:11 leonardotc