Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made ETHEREUM_NODE_ADD_TRANSCATION_REVERT_REASON flag work! #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

manu461
Copy link

@manu461 manu461 commented Feb 26, 2021

I was not able to get the revert-reason for the failing transactions in Kafka events, when I looked into the code, then I found that the true flag (value of ETHEREUM_NODE_ADD_TRANSCATION_REVERT_REASON) was not even getting propagated from the environment variable.

After debugging it thoroughly, and spending ~6 hours I found the fix.
internally ethereum.nodes[0].addTransactionRevertReason is being searched in the environment. So, Ideally, the flag should be ETHEREUM_NODES_0_ADD_TRANSACTION_REVERT_REASON (and not ETHEREUM_NODE_ADD_TRANSCATION_REVERT_REASON as mentioned in the official documentation).
Still, it didn't work by just changing the environment variable name, Finally, I had to refactor addTransactionRevertReason to add.transaction.revert.reason for it to work.

I have tested it on my local Ganache network and on the Quorum node. It was working like a charm.

revert_reason_working

Note: You have to make sure that you add this line of code.
web3.eth.handleRevert = true; before submitting any transaction to the ledger, for this feature to work.

@manu461 manu461 changed the title made ETHEREUM_NODE_ADD_TRANSCATION_REVERT_REASON flag work! :) made ETHEREUM_NODE_ADD_TRANSCATION_REVERT_REASON flag work! Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant