Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@artossystems/geth-trace-decoder
Advanced tools
Development for Ethereum is hard. The tools currently available to support our role as developers are still crude in many ways. They are all welcome and essential but we are still very far away of the development environments for more mature technologies.
In 2019, we have been spoiled for many years with IDEs, smart debuggers and other tools that are simply not yet available for Solidity development. Even the ecosystem itself is harsher: contracts have to be deployed in a public net in order to be properly tested; execution happens asynchronously, with an unspecified delay; and it is totally non-interactive: all the output we have comes down to a function reply or encoded transactions logs. We can debug transactions after the fact, but that is not always useful. And when a transaction reverts, we often get a cryptic message similar to Error: Transaction has been reverted by the EVM
where Geth ignores any message associated to the revert action, even if the programmer was kind enough to provide it in the first place.
Overall, it is difficult to understand what makes a contrat fail, and in contract calls that make several calls of their own, finding the cause for an error is frequently a hair-pulling exercise.
Enter the geth-trace-decoder.
We developed this tool to reduce the frustration of our debugging sessions. It takes the call trace of a transaction (successful or failing) and decodes it into a human-readable way, so that the user will be able to understand the whole sequence of calls until the transaction failed. This tool is not able to extract the error associated with a revert, but typically it will give all the information exactly until that point, including:
We hope this is useful for the community at large. It is our 'Thank you!' for all the people working to make Ethereum the platform of the future, to improve the productivity of developers in this eco-system, and to make it an easier environment to develop in.
This repo provides a library that you can use and an example formatter making use of those libraries to output the results to console. Feel free to produce other formatters more suitable to your needs, and let us know if you find our work useful, if you know how it could be improved and how you'd like to see it evolve in the future.
Thank you to ConsenSys for their abi-decoder
tool and the inspiration it gave us.
Happy coding!
From the root of this repository, run
npm install
const lib = require('@artossystems/geth-trace-decoder');
const processor = new lib.traceProcessor(your-contract-ABI-array);
const result = processor.decodeTrace(geth-transaction-debug-trace);
console.log(lib.consoleOutputFormatter.format(result));
The examples provided in demo.js
are very simple implementations to highlight the different use cases for this library. They are not production ready implementations.
demo_manualInput()
demo_knownAddresses()
demo_multipleContracts()
demo_customTypes()
demo_rinkeby()
demo_mainNet()
<YOUR TRANSACTION HASH>
with a recent transaction hash and update the RPC IP address used to connect to your node if required.demo_privateGethNode()
From publicDemo
run
node demo.js
FAQs
Call trace decoder for Geth
We found that @artossystems/geth-trace-decoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.