Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

debug_traceTransaction, Invalid string length #3924

Open
seinmyung25 opened this issue Nov 18, 2022 · 8 comments
Open

debug_traceTransaction, Invalid string length #3924

seinmyung25 opened this issue Nov 18, 2022 · 8 comments

Comments

@seinmyung25
Copy link

i'm using ganache by brownie
ganache-cli --chain.vmErrorsOnRPCResponse true --wallet.totalAccounts 10 --hardfork istanbul --miner.blockGasLimit 12000000 --wallet.mnemonic brownie --server.port 8545 --wallet.defaultBalance 1000000000

node --version
v16.14.2
ganache --version
ganache v7.5.0 (@ganache/cli: 0.6.0, @ganache/core: 0.6.0)

brownie test error
brownie.exceptions.RPCRequestError: Invalid string length

correstponding ganache log

  Transaction: 0x13652715b80a821ff9e3945e2c8b059b0cfecec6fd4c65c6e0794348b2051146
  Gas usage: 467626
  Block number: 159
  Block time: Fri Nov 18 2022 17:01:45 GMT+0900 (Korean Standard Time)
  Runtime error: revert
  Revert reason: testing...

When i call an error transaction to eth_call, a revert message (testing...) in response.

@davidmurdoch
Copy link
Member

Are you able to provide complete reproduction steps?

@seinmyung25
Copy link
Author

error.tar.gz
This is the failed chain data snapshot(option --db).
please check transaction 0x13652715b80a821ff9e3945e2c8b059b0cfec6fd4c65c6e0794348b2051146.

@davidmurdoch
Copy link
Member

Thanks. I'll try to check it out tomorrow.

@davidmurdoch
Copy link
Member

Sorry, couldn't get to this today. I'll try again tomorrow! 😁

@seinmyung25
Copy link
Author

Do you have any update??.

@davidmurdoch
Copy link
Member

Sorry, I forgot to check back in on this! Looking now!

@davidmurdoch
Copy link
Member

davidmurdoch commented Dec 6, 2022

The threshold for chunked JSON streaming is 100000 debug struct logs, but this transaction only has ~38000! I'm experimenting with a way of automatically falling back to chunking if normal JSON.stringify fails due to this Invalid string length error, but getting this fix in a release likely won't happen for a couple of weeks, as we've got a huge backlog of PRs as it is.

If you are OK with building ganache yourself while you wait on us you can change the BUFFERIFY_THRESHOLD value in ./src/chains/ethereum/ethereum/src/connector.ts to something low, like 10000.

You only need Node.js installed to get it working.

You can run ganache in dev mode via npm run tsc && npm start -- --chain.vmErrorsOnRPCResponse=true --wallet.totalAccounts=10 --hardfork=istanbul --miner.blockGasLimit=12000000 --wallet.mnemonic=brownie --server.port=8545 --wallet.defaultBalance=1000000000 to start up the chain (notice the extra -- in the command after start: start -- --, it is important).

See https://github.com/trufflesuite/ganache/blob/develop/CONTRIBUTING.md for more information about building ganache (note: you won't need to use Node v12.0.0 for any of this).

@davidmurdoch
Copy link
Member

I've created a PR with a potential fix here: #3997 and an issue for a possible better long term solution here: #3998

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Stalled
Development

No branches or pull requests

2 participants