Highlights
Breaking Changes
New Features
Fixes
Known Issues
Future Plans
This release is the third beta release of the new and improved Ganache v7.0.0. You'll definitely want to catch up on the previous changes from the first and second beta, 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: @kevinweaver, @cds-amal, @gnidan, @eggplantzzz, @davidmurdoch, and @fedgiac!
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
(release candidate), 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 196 files across 15 merged pull requests, tallying 16,693 additions and 28,515 deletions, since our last beta release.
This release contains one small feature and a few bug fixes. Do continue to open new issues and questions; we're loving the feedback, questions, and issues coming in from everyone trying out these releases ❤️
back to top
Reject transactions with insufficient funds (#1842)
The ganache-cli v6 and ganache-core v2 packages used to allow transactions with a tx.gasLimit * tx.gasPrice + tx.value < account.balance
into the transaction pool. Ganache v7 will now immediately reject transactions that meet that condition with an "insufficient funds for gas * price + value" error message (with a code
of -32003
).
back to top
Export typescript types in published build (#1716 #1871)
Ganache is a TypeScript project, but all internal components are shipped in a bundle to improve installation time. While there are lots of tools to bundle JavaScript, the tools to bundle (or "rollup") these types aren't very mature and result in some strange types. We are now using ApiExtractor to generate our rollup types, as it works well for most of the types we need to export with one exception — it likes to rename types:
EthereumProvider_2
in the above image should be EthereumProvider
.
You'll find many other strangely named types in this version, as well as many types that aren't exported, but should be. Expect the types to change in future.
back to top
- We've removed the
chainId
frometh_sign
- Fixes default transaction values
- Stops altering state during
eth_estimateGas
calls - Fixes how we parse the
--chain.time
option in the CLI - Fixes insufficient balance error
- Prevent DEBUG env var from crashing ganache
- Permit using legacy fork.provider
- Fix version disparity between startup/
web3_clientVersion
We've removed the chainId
from eth_sign
(#1716)
We were previously including the chainId
when signing a message via eth_sign
but chainId
does not need to be included for message signatures created via eth_sign
. If you have any tests updated to work with a pre-release v7 that relied on the value returned by eth_sign
those tests may break due to this change.
back to fixes
Fix Transaction Defaults (#1730)
Before a transaction is mined, its value
and data
(aka input
) fields could possibly be undefined
. Once the transaction is mined (which, in most cases is immediately), the transaction data is serialized and those undefined
values are converted to 0x
, which is the desired value for both the value
and data
when the fields are omitted by the user.
If a transaction is sent with a future nonce, however, it isn't immediately mined. If that transaction is retrieved via eth_getTransactionByHash
, it has not yet been serialized. As such those two fields are undefined
and completely missing from the resulting transaction object. Now, we give default values of 0
for value
and 0x
for data
when those fields are missing from a transaction.
back to fixes
Stop Altering State on eth_estimateGas
(#1732)
Estimating a transaction's gas requires that the transaction is run on the EVM, but it shouldn't alter the state of the EVM permanently. This fix adds additional VM checkpoints
that are subsequently revert
ed to prevent the state from being altered.
back to fixes
Fix --chain.time
Parsing (#1731)
The --chain.time
startup option allows you to start Ganache with the EVM time set to the specified time. Previously, we weren't parsing this value correctly, causing startup to fail when this option was specified. Now, you can use this option to test your contracts in the past, present, or future!
back to fixes
Fix Insufficient Balance Error (#1661)
When eth_sendTransaction
is used to send a transaction from an account that doesn't have enough funds to pay for the transaction, the VM returns an error that requires a transaction.getSenderAddress().toString()
property. Previously, the transaction that Ganache supplied to the VM didn't have this property, resulting in a malformed error.
back to fixes
Prevent DEBUG env var from crashing Ganache (#1740)
An external dependency was using the DEBUG
environment variable in a way that would cause an exception within Ganache. We've removed the code that was causing the issue.
back to fixes
Update callGasLimit
to match geth's (#1829)
Our previous default callGasLimit
was Number.MAX_SAFE_INTEGER
, we've reduced this default to a more reasonable 50_000_000
, which matches Geth's current default limit.
back to fixes
Permit using legacy fork.provider
(#1737)
A bug prevented "legacy" providers (providers that don't implement EIP-1193's request
method) from working with Ganache v7 forking.
back to fixes
Fix version disparity between startup/web3_clientVersion
(#1780)
The web3_clientVersion
version was always one version behind the actual version.
back to fixes
back to top
evm_setAccountNonce
is race-conditiony (#1646)--miner.callGasLimit
implementation is wrong (#1645)eth_call
with fork is not always behaving as it should in beta version (#1547)- 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
back to top
- 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.
back to top
💖 The Truffle Team