v7.0.0-beta.1
Pre-release
Highlights
Fixes
New Features
Known Issues
Future Plans
This release is the second beta release of the new and improved Ganache v7.0.0. You'll definitely want to catch up on the previous changes, if you haven't already, before reading on!
Thanks to everyone who tried out our previous alpha and beta releases and provided feedback! You have been immensely helpful!
Special thanks to Trufflers and community members for reporting and commenting on issues fixed by this release: @MicaiahReid, @0xGorilla, @MatthiasLohr, @0xng, and @FFdhorkin!
Note: this is a beta release; even these 7.0.0 release notes are "beta" and the information here is likely incomplete. There may still be bugs and kinks to work out before we ship things off to rc
, then finally to latest
. You absolutely should use this beta release, please do try it out and let us know if breaks for you!
To install globally run:
npm uninstall ganache-cli --global
npm install ganache@beta --global
We've changed 15 files across 6 merged pull requests, tallying 204 additions and 39 deletions, since our last beta release.
This release is a a bit light on the changes this time around. We wanted to get a quick release out before the team here at Truffle takes a few days off to be with family over the Thanksgiving holiday here in the USA.
This release contains some small bug fixes and a new config option. Do continue to open new issues and questions while we're away; we're loving the feedback, questions, and issues coming in from everyone trying out these releases ❤️
- Fixes how we handle replacement transactions
- Fix async request processing
- Don't return an error from miner_start if already started
Fix Transaction Replacement (#1650)
When a transaction is in the transaction pool, it can be replaced by sending another transaction with the same nonce and with an extra premium on the gas price. This priceBump
is a percentage that is set by a node and dictates how much that extra premium needs to be in order to replace an existing transaction.
Before this fix, Ganache would only replace transactions with gas price greater than the priceBump
percentage. So, when MetaMask or some other wallet's "cancel transaction" feature was used, which sets the replacement transaction's gas price to exactly priceBump
more than the original, Ganache would reject the replacement transaction as underpriced. With this fix, Ganache will replace transactions with gas price greater than or equal to the priceBump
percentage.
This fix also aligns us closer with how Geth handles replacement transactions after the introduction of EIP-1559 transactions. Previously, we would compare the effectiveGasPrice
of the existing and replacement transaction. The effectiveGasPrice
represents the lesser value between maxFeePerGas
and baseFeePerGas + maxPriorityFeePerGas
. If the replacement transaction's effectiveGasPrice
was greater than the existing transaction's effectiveGasPrice
by greater than priceBump
percent, we'd call it a valid replacement. Geth, however, requires that both the maxFeePerGas
and the maxPriorityFeePerGas
are greater in the replacement transaction, so we've updated ourselves to match.
Fix async request processing (#1592)
A misconfiguration of the default options on startup caused all requests to be executed sequentially. Thanks goes to @0xGorilla for finding this issue!
Don't return an error from miner_start if already started (#1632)
A quick and easy fix! When using legacyInstamine
mode miner_start
used to return an RPC error if the miner was already started. Now it doesn't 🤯
Add a miner.priceBump
Option (#1650)
The new --miner.priceBump
option allows you to specify the percentage increase in the gas price required to replace an existing transaction. For example, if --miner.priceBump=10
(the default) is used on startup and a transaction with maxFeePerGas = 100 GWEI
and maxPriorityFeePerGas = 1 GWEI
is waiting in the transaction pool to be mined, a transaction with maxFeePerGas >= 110 GWEI
and maxPriorityFeePerGas >= 1.1 GWEI
will be required to replace the existing transaction.
Add eth_maxPriorityFeePerGas
RPC Method (#1658)
Ganache now supports the eth_maxPriorityFeePerGas
RPC method. Currently, this defaults to returning 1 GWEI. In the future, we may adjust the behavior so it returns the current gas price minus the latest block's baseFeePerGas
.
evm_setAccountNonce
is race-conditiony (#1646)--miner.callGasLimit
implementation is wrong (#1645)eth_call
with fork is not always behaving as it should in alpha version (#1547)- Our TypeScript types aren't properly exported (#1412)
- We don't return a proper pending block (#772)
- Forking doesn't work in the browser
- Uncles aren't fully supported when forking
- Forking may fail in weird and unexpected ways. We need to "error better" here
- Node.js v12 outputs a µWS warning in the console
- Node.js v12 doesn't handle memory as well as 14+ and may crash computing very large
debug_traceTransaction
results - Our bundle size is larger than ideal
- Update the
eth_maxPriorityFeePerGas
RPC method to return as Geth does,eth_gasPrice - baseFeePerGas
. - Add support for the
eth_feeHistory
RPC method. - Support for enabling eligible draft EIPs before they are finalized or considered for inclusion in a hardfork.
- New hardfork support well in advance of the hardfork launch.
- Add an
eth_createAccessList
method. - Track test performance metrics over time.
- Track real world Ganache usage (opt-in and anonymized) to better tune performance and drive bug fixes and feature development.
- Track test coverage.
- Document how to use Ganache in the browser, and what limits it has.
evm_mine
will return the new blocks instead of just0x0
.- We've laid the groundwork for additional performance improvements. We expect to see an additional 2-5x speed up for typical testing work loads in the near future.
- Add new
evm_setCode
andevm_setStorageAt
RPC methods. - Make
evm_snapshot
ids globally unique (unpredictable instead of a counter). - Support
eth_getRawTransactionByHash
RPC method. - Support
debug_accountAt
RPC method. - Allow "mining" to be disabled on start up.
- Set CLI options via config file, package.json, or ENV vars.
- "Flavor" Plugins: We're building support for Layer 2 plugins into Ganache so we can start up and manage other chains. e.g., The
ganache filecoin
command will look for the@ganache/filecoin
package and start up a Filecoin and IPFS server. - Multi-chain configurations: you'll be able to start up your project's entire blockchain "ecosystem" from a single ganache command: e.g.,
ganache --flavor ethereum --flavor filecoin --flavor optimism
.- this is where defining your CLI options via JSON config will come in very handy!
- Create a CLI interactive/RELP mode.
- Enable a CLI daemon mode.
Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team