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

Releases: trufflesuite/ganache

v7.0.0-beta.2

21 Dec 01:31
Compare
Choose a tag to compare
v7.0.0-beta.2 Pre-release
Pre-release

 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


Highlights

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


Breaking Changes

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


New Features

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

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


Fixes


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 reverted 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](https://github.c...

Read more

v7.0.0-beta.1

25 Nov 03:09
Compare
Choose a tag to compare
v7.0.0-beta.1 Pre-release
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


Highlights

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 ❤️

back to top

Fixes


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.

back to fixes

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!

back to fixes

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 🤯

back to fixes

back to top


New Features


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.

back to features

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.

back to features

back to top


Known Issues

  • 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

back to top


<img ...

Read more

v7.0.0-beta.0

19 Nov 23:19
Compare
Choose a tag to compare
v7.0.0-beta.0 Pre-release
Pre-release

 Highlights    New Features   Breaking Changes    Fixes    Known Issues   Future Plans 


This release is the first 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 releases and provided feedback! You have been immensely helpful!

And thanks again to contributors, mentors, and reviewers: @MicaiahReid, @gnidan, @cds-amal, and @haltman-at. And special thanks to our community members for reporting and commenting on issues fixed by this release: @domob1812, @NicsTr, @convexman, and @rainwater11!

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


Highlights

We've changed 70 files across 12 merged pull requests, tallying 2,616 additions and 65,747 deletions, since our last release. The high number of deletions is due to reverting our lock files back to v1, as we aren't yet confident in npm 7+'s stability.

This release fixes many bugs and adds some new features, but there is one that we are really excited about:

Free integrated archive data for Mainnet, Ropsten, Kovan, Rinkeby, and Görli!

You can now run your own fork of Ethereum's Mainnet with a simple command:

ganache --fork

which will automatically connect to a Mainnet Node with full Archive Data, for free! 🤯

Full announcement is below.

back to top

New Features

Other than the big Infura + Ganache integration feature mentioned above, we've also added a couple of smaller features that we hope will improve the development experience.



Integrate Infura into Ganache forking (#1513)

This is a big deal! You now have free access to Infura²'s archive data for Ethereum's Mainnet, Ropsten, Kovan, Rinkeby, and Görli networks built right into Ganache itself!

The command ganache --fork will fork Ethereum's Mainnet at the latest block number with access to full archive data.

ganache --fork

We currently don't impose restrictions outside of the default limits provided by Infura, but will monitor usage closely in order to limit abuse so we can continue to provide this resource to you for free.

You can also fork from Ropsten, Kovan, Rinkeby, and Görli:

$ ganache --fork ropsten
$ ganache --fork kovan
$ ganache --fork rinkeby
$ ganache --fork görli
$ ganache --fork goerli

If you prefer using Ganache's option namespaces you can use:

$ ganache --fork.network mainnet
$ ganache --fork.network ropsten
$ ganache --fork.network kovan
$ ganache --fork.network rinkeby
$ ganache --fork.network görli
$ ganache --fork.network goerli

You can also use this feature programmatically:

import Ganache from "ganache";

const server = Ganache.server({
  fork: {
    network: "mainnet"
  }
});
server.listen(8545, () => {
  const liveOptions = provider.getOptions();

  console.log("forked network: " + liveOptions.fork.network);
  console.log("forked at block: " + liveOptions.fork.blockNumber.toString());
  console.log("listening on 8545");
});

This feature is made possible by our close relationship with Infura.

Please let us know if you have problems, questions, or suggestions!

back to features

Add a wallet.passphrase Option (#1513)

This feature allows you to specify a passphrase that will be used for personal namespace commands (personal_unlockAccount, personal_sendTransaction, etc.) on all startup accounts. Before this feature, "" was the default (and only) password for startup accounts.

NOTE: Specifying the wallet.passphrase parameter does not lock accounts by default. The wallet.lock (previously wallet.secure) parameter can be used to lock accounts by default. If wallet.passphrase parameter is used without wallet.lock, the passphrase will still be used when personal_lockAccount is used.

back to features

Add evm_addAccount/evm_removeAccount RPC Methods (#1513)

The evm_addAccount method can be used to add any address to the personal namespace. Ganache will create a fake private key which will then used for all personal namespace commands sent using that added address. Here's an example of how to use this:

const address = "0x0000000000000000000000000000000000000000"; // let's send transactions from the zero address!
const transaction = {from: address};
const passphrase = "this is my passphrase";
// this will fail because we don't "know" the zero address
await assert.rejects(provider.send("personal_sendTransaction", [{ from: address }, passphrase] ));

const added = await provider.send("evm_addAccount", [address, passphrase] );
assert.equal(added, true) // but now we do!

// so now we can send transactions from the zero address!
const txHash = await provider.send("personal_sendTransaction", [{ from: address }, passphrase] ))

The evm_removeAccount method can be used to do just the opposite — it will remove an account from the personal namespace.

back to features

Add support for the "arrowGlacier" hardfork (#1524)

We updated ethereumjs-vm, and related packages, add added support for the "arrowGlacier" hardfork which is set to activate at block number 13,773,000 which is predicted to occur on December 8, 2021.

This hardfork introduces a single change: it pushes the difficulty bomb back several months. This doesn't affect Ganache, other than accepting the hardfork name in our options.

back to features

back to top


<img alt="Breaking Changes" width="auto" src="https://raw.g...

Read more

v7.0.0-alpha.2

13 Nov 02:23
Compare
Choose a tag to compare
v7.0.0-alpha.2 Pre-release
Pre-release

 Highlights    Breaking Changes    Fixes    New Features   Known Issues   Future Plans 


This release is the third alpha 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 releases and provided feedback! You have been immensely helpful!

And special thanks to contributors, mentors, and reviewers: @MicaiahReid, @gnidan, @cds-amal, and @haltman-at. And special thanks to our community members for reporting and commenting on issues fixed by this release: @aliveli186, @winksaville, @anvacaru, @wilwade, and @moda20!

Not: this is still an alpha release; even these 7.0.0 release notes are "alpha" and the information here is likely incomplete. There will be bugs and kinks to work out before we ship things off to beta, rc, then finally to latest. You absolutely should use this alpha release, but only to try it out and let us know where it breaks for you!

In other words: 🔥🐉 Here be dragons 🔥🐉️

To install globally run:

npm uninstall ganache-cli --global
npm install ganache@alpha --global


Highlights

We've changed 131 files across 18 merged pull requests, tallying 37,511 additions and 35,611 deletions, since our last release.

These changes bring:

  • Much faster forking performance! We've introduced two new caching layers that can reduce the run time of complex forking requests, like debug_traceTransaction, by over 30x!
  • Support for transaction traces over 1 GB in size
  • Pre-built Docker containers and GitHub packages
  • Dropped support for Node.js v10 (and v11)
  • Added support for Node.js v17
  • and more...

back to top

Breaking Changes

We've dropped support for Node.js v10 (and added v17) (#1519)

Node.js v10 reached its end of life in April of this year, and Truffle dropped support for it in October. Ganache is following suit in the v7.0.0 release.

This will simplify Ganache development and will result in smaller bundle sizes as we no longer need to transpile features available natively in Node v12 for Node v10.

back to top


Fixes

So. Many. Fixes.


Fixes various issues with EIP-1559 transactions (#1307)

Previously, a transaction's effectiveGasPrice was not stored in Ganache's database because, before London, this value was easy to calculate. After the introduction of the London hardfork defaulting to the previous gasPrice would cause a type-2 transaction to have a different effectiveGasPrice before and after saving to Ganache's database. Now, we store the effectiveGasPrice in the database so the correct gas price for each transaction type can be retrieved when fetching the transaction.

We also use the EIP-1559 transaction's gas fields for eth_call and accurately upgrade legacy type-0 transactions to type-2 transactions when certain data is omitted from the transaction.

back to fixes

Prevents a replaced, future-nonce transaction from being run alongside its replacement transaction (#1237)

It is possible to send a future-nonce transaction². You may also want to replace that future-nonce transaction. Before this fix, both the original and replacement future-nonce transaction would be executed. 😬

Previously, when an immediately executable transaction was received we'd check:

  1. do we have an executable transaction in the transaction pool from the same account?
  2. if so, does this new transaction have the same nonce as the one already in the pool?
  3. if so, is this new transaction's gas price better?
  4. if so, replace the previous transaction with this new one.

We now perform all of those same checks against the future-nonce transactions in the transaction pool, not just the executable transactions.

back to fixes

Ganache now works in the browser on Firefox, Microsoft Edge, and Safari (#1247)

🎉 YAY 🎉

back to fixes

Handle initialization errors and handle fallback rejections for server.listen (#1227)

When you run const server = Ganache.server() Ganache immediately begins initializing internal components, eagerly running dozens of asynchronous operations. But any one of these async operations could fail. Previously these failures would appear as an Unhandled Rejection.

We now handle these by delaying the exception until the call to server.listen is made. If the call to Ganache.server resulted in any initialization exceptions their rejection will be deferred until the callback or fulfillment of this listen call.

back to fixes

Stop returning baseFeePerGas on pre-London blocks (#1541)

When forking, a user may request a fork-point block that is before the London hardfork while London is actually activated in their Ganache instance. In Ganache v7 alpha.1, we'd return the block's baseFeePerGas before that field actually existed on mainnet because London was technically enabled in Ganache. Now, we keep better track whether the baseFeePerGas should be included or not.

back to fixes

Suppress annoying Windows startup warnings by using our [prebuilt bigint-b...

Read more

v7.0.0-alpha.1

21 Sep 18:21
Compare
Choose a tag to compare
v7.0.0-alpha.1 Pre-release
Pre-release

 Highlights    Breaking Changes    Fixes    New Features   Known Issues   Future Plans 


This release is the second alpha 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!

But first, this is still an alpha release; even these 7.0.0 release notes are "alpha" and the information here is likely incomplete. There will be bugs and kinks to work out before we ship things off to beta, rc, then finally to latest. You absolutely should use this alpha release, but only to try it out and let us know where it breaks for you!

In other words: 🔥🐉 Here be dragons 🔥🐉️

To install globally run:

npm uninstall ganache-cli --global
npm install ganache@alpha --global


Highlights

  • Added Berlin's EIP-2930 Access List Transactions

  • Added "london" hardfork support with EIP-1559 Fee Market Transactions

  • Added a new provider event system

back to top

Breaking Changes

The default hardfork has changed to "london"

We generally do not consider hardfork updates to be "breaking changes" in the semver sense, and they don't ever warrant a major version bump on their own. Regardless, we're listing the changes that are likely to cause your tests to fail here, instead of in the list of features, as it seems helpful to separate them out.

The London hardfork changes many things about the way Ethereum works, and many of these changes might cause your tests to break and fail. We've outlined the most common changes here:

Non-zero gas prices are not permitted

A side effect of the updating to London is that transactions can no longer be sent with a gasPrice of 0. The reason for this is that blocks automatically adjust the minimum gas price from one block to another. We'll be adding a feature flag to allow for zero-gasPrice transactions in the future. If you need zero-gasPrice transactions now you'll have to set the --hardfork flag to "berlin" or earlier.

Legacy transactions sent via eth_sendTransaction are automatically upgraded to "Type 2" (EIP-1559) transactions.

If you send a transaction with eth_sendTransaction and that transaction doesn't have a gasPrice field the transaction will be automatically "upgraded" to a type 2 transaction. Type 2 transactions will have many different fields for an identical legacy transaction sent pre-london.

// send a "legacy" transaction
const hash = await provider.request("eth_sendTransaction", [{ from }]); 
const tx = await provider.request("eth_getTransactionByHash", [hash]);
// The returned `type` field indicates it was updated to a type 2 transaction
assert.strictEqual(tx.type, "0x2");

New fields enabled by EIP-1559:

  • maxPriorityFeePerGas:
    • Gas price above the block's base gas price you'll pay the miner.
    • currently defaults to 0, but we'll likely change this before v7.0.0.
  • maxFeePerGas:
    • The maximum gas price you'll pay for the transaction.
    • For eth_sendTransaction, this value is defaulted to the maximum possible block base gas price over the next 3 blocks (the fee can theoretically increase by a maximum of 12.5% per block).
    • If the transaction cannot be included within the next 3 blocks it is possible it will be rejected for having a too-low maxFeePerGas value.

New fields enabled by the Berlin hardfork (EIP-2718, EIP-2930):

  • type: The type, currently "0x0" (Legacy), "0x1" (EIP-2930), or "0x2" (EIP-1559)
  • chainId: The chainId of the chain the transaction is intended for. If the chainId of the transaction doesn't match the chainId of the node the transaction will be rejected.
  • accessList: A list of addresses and storage keys that the transaction plans to access. Accesses outside the list are possible, but may be more expensive.

Changed fields:

  • hash
  • v - type 1 and type 2 transactions do not encode the chain ID here (EIP-155) and do not include the addition of the number 27.
  • r
  • s

Transactions are now ordered relative to the "current" block's baseFeePerGas

Because the gas fee a transaction might pay now depends on the block's baseFeePerGas transactions are re-sorted in the context of each new block. Transaction ordering is still deterministic (except in rare cases) but the order now depends on previous blocks.

back to top


Fixes

  • WebSocket connections are sometimes closed prematurely (#1097)
  • Zero address transactions are now always signed with the same (fake) key (#1117)
  • Signatures with r or s values containing leading 0s would result in incorrect transaction hashes

back to top


New Features

This alpha release brings you Berlin and London hardfork support as well as a new ganache event system.

Berlin's Access List Transactions (EIP-2930)

Access List Transactions enable support for specifying an accessList. The access list defines a list of addresses and storage keys that the transaction plans to access. Accesses outside the list are possible, but may be more expensive.

See the EIP-2930 for details.

London and its Fee Market Transactions (EIP-1559)

EIP-1559 builds upon EIP-2930 by specifying a new transaction type: "0x2", or just "type 2".

Read about what EIP-1559 is and how it is changing Ethereum.

Event system

In addition to EIP-1193's "message" event and the legacy "data" event, Ganache emits 3 additional events: "ganache:vm:tx:before", "ganache:vm:tx:step", and "ganache:vm:tx:after".

These events can be used to observe the lifecycle of any transaction executed via *sendTransaction, eth_call, debug_traceTransaction, or debug_storageRangeAt.

These share the event paradigm that Truffle uses, but without any of the wildcard handling, i.e., no "vm:*" support (for now).

Each of these events will emit a context object which is a unique object that can be used to identify a transaction over the course of its lifecycle. For example:

interface StepEvent {
  account: {
    nonce: bigint;
    balance: bigint;
    stateRoot: Buffer;
    codeHash: Buffer;
  };
  address: Buffer;
  codeAddress: Buffer;
  depth: number;
  gasLeft: bigint;
  gasRefund: bigint;
  memory: Buffer;
  memoryWordCount: bigint;
  opcode: {
    name: string;
    fee: number;
  };
  pc: number;
  returnStack: Buffer[];
  stack: Buffer[];
}
const contexts = new Map();
provider.on("ganache:vm:tx:before", (event: { context: {} }) => {
  contexts.set(event.context, []);
});
provider.on("ganache:vm:tx:step", (event: StepEvent) => {
  contexts.get(event.context).push(event.data);
});
provider.on("ganache:vm:tx:after", (event: { context: {} }) =...
Read more

v7.0.0-alpha.0

26 Aug 21:43
ganache@7.0.0-alpha.0
Compare
Choose a tag to compare
v7.0.0-alpha.0 Pre-release
Pre-release

 Highlights    Breaking Changes    Fixes    New Features   Known Issues   Future Plans 


This major release is the first alpha release of the new and improved Ganache v7.0.0. We've got a lot in store for you in this breaking-change release, so you'll definitely want to read on!

But first, this is an alpha release; even these 7.0.0 release notes are "alpha" and the information here is likely incomplete. There will be bugs and kinks to work out before we ship things off to beta, rc, then finally to latest. You absolutely should use this alpha release, but only to try it out and let us know where it breaks for you!

In other words: 🔥🐉 Here be dragons 🔥🐉️


Highlights

  • We broke Ganache… on purpose. 😅 This is a breaking change release, so you’ll want to pay close attention to these changes! (skip to the broken-stuff)

  • It's much faster and more memory efficient. We've seen truffle test execution times for real world repositories run in 1/3 the time. CLI initialization is ~300% faster. You can now run Ganache indefinitely without ever-increasing memory usage (with a few very rare exceptions¹ we consider to be bugs that will be fixed in a later release).

  • The ganache-core and ganache-cli packages you know and love have been (almost² completely rewritten from the ground up in TypeScript.

  • The ganache-core and ganache-cli npm packages have been merged into a single ganache package. We’ll continue to publish to the old core and cli npm packages for the time being, but you’ll want to switch over to the new ganache npm package soon, or you’ll start seeing a deprecation notice upon installation.

  • The ganache-core and ganache-cli GitHub repositories have been merged together and moved to ganache. Head over to the new repo and show it some love by smashing that ⭐ button!

  • The Docker container will be moving to https://hub.docker.com/r/trufflesuite/ganache

  • Ganache now works in the browser and we are working on building interactive browser-based documentation. We've built a prototype implementation and are working on optimizing and polishing the experience.

  • For the last year Ganache has been mostly maintained by one person (me). But now there are a whole two of us! We welcomed Micaiah Reid, formerly of Lockheed Martin, to the team in May! Go give him a follow!

  • Speaking of new team members… we're hiring! We’ve got tons of exciting work planned for the future of Ethereum developer tools. Come work with us on making Ethereum more accessible to more developers! Don’t know which positions to apply to? Feel free to reach out to anyone from our team to inquire more about working here at Truffle!

back to top

Breaking Changes

Many changes are "breaking", some more than others. We've organized the breaking changes into three categories:

The big ones

These changes are likely to cause you some trouble if you upgrade blindly. We've ordered them from most-likely to least-likely to cause problems:

🟀

We've renamed our packages

We've renamed *ganache-cli and ganache-core to ganache. You'll need to uninstall the old version before installing the new.

For a global installation uninstall ganache-cli before installing ganache:

$ npm uninstall ganache-cli --global
$ npm install ganache@alpha --global

For a local installation of ganache-cli and/or ganache-core:

$ npm uninstall ganache-core ganache-cli
$ npm install ganache@alpha

You can now use the new ganache (without the -cli suffix) on the command line:

$ ganache # use `npx ganache` if you installed locally

and via global or local install in your package.json scripts:

{
  "scripts": {
    "start-ganache": "ganache"
  }
}

Note: we've aliased ganache-cli to ganache, so you can continue using the ganache-cli command in your npm scripts and in your terminal.

The Docker container will be moving soon -- from https://hub.docker.com/r/trufflesuite/ganache-cli to https://hub.docker.com/r/trufflesuite/ganache.

back to list

Transaction hashes are now returned before the transaction receipt is available.

Previously, Ganache would allow this:

// BAD CODE THAT USED TO WORK
const provider = Ganache.provider();
const txHash = await provider.send("eth_sendTransaction", [transaction]);
const receipt = await provider.send("eth_getTransactionReceipt", [txHash]);
assert.notStrictEqual(receipt, null);

The problem is that this behavior is not representative of how Ethereum nodes behave in the real world; transactions take time to be mined after being accepted by the node. If you're already using Ethereum libraries like web3.js or ethers.js and connecting over WebSockets, you shouldn't have to worry about this change, as these libraries already handle the transaction lifecycle for you.

If you are using Truffle to run your tests you'll want to enable the websockets flag in your Truffle config:

// truffle-config.js
module.exports = {
  networks: {
    development: {
      host: "127.0.0.1",
      port: 8545,
      network_id: "*",
      websockets: true // ← add this
    },
    /* … */

_However, even with WebSockets enabled, some versions of these libraries, including truffle, do not always set up their subscription events fast enough. When this happens the client will miss the notification from Ganache and fall back to polling for changes (slow). We're working with librari...

Read more

v2.13.2 – Taco Tuesday 🌮

26 Aug 21:43
v2.13.2
ff312f6
Compare
Choose a tag to compare

 Highlights    How to Upgrade    Changelog    Related Releases 


We're moving to a betalatest release pipeline, where all non-hotfix changes are first released in a beta before being promoted to a stable release.

We'd love it if you'd start using the latest betas and let us know early and often if you find any bugs or regressions!

Highlights

v2.13.2 – Taco Tuesday 🌮

It's Tuesday. And you know what that means, don't you? Tacos! And tacos are delicious. And do you know what else is delicious? This release! It's got a couple of new bug fixes you'll want to check out, especially if you use the forking feature.

Bon appetit!


How to Upgrade

Upgrade to the latest version of ganache-core by running:

npm

npm uninstall ganache-core
npm install ganache-core@latest

yarn

yarn remove ganache-core
yarn add ganache-core@latest

Changelog

Fixes:

  • fix: add removed field to Log JSON (#651)
  • fix: storage value encoding in forked trie. (#658)
  • fix: handle failure to retrieve net_version when forking (#676)

Chores:

  • chore: update eth-sig-util to v3.0.0 (#711)

Related Releases

💖 The Truffle Team

v2.13.1 – Johnnycake Cobblers 2 🎂

28 Oct 01:09
v2.13.1
685b1d9
Compare
Choose a tag to compare

 Highlights    How to Upgrade    Changelog    Related Releases 


We're moving to a betalatest release pipeline, where all non-hotfix changes are first released in a beta before being promoted to a stable release.

We'd love it if you'd start using the latest betas and let us know early and often if you find any bugs or regressions!

Highlights

v2.13.1 – Johnnycake Cobblers 2 🎂

This release is exactly like the last one, but it works around an npm bug that causes installations to sometimes fail in Node v12 with npm v6. The rest of these notes are the same as the last release's.

Johnnycake Cobblers: another dessert with a weird name. Someone really should cook up all the release names we've used for us Trufflers to try one day! 😋

This release brings Node v14 compatibility and a new feature!


How to Upgrade

Upgrade to the latest version of ganache-core by running:

npm

npm uninstall ganache-core
npm install ganache-core@latest

yarn

yarn remove ganache-core
yarn add ganache-core@latest

Changelog

Features:

  • feat: add ability to use blockHash with eth_getLogs (#639) Thanks, @tynes!

Fixes:

  • fix: update merkle-patricia-tree to v3.0.0 to support Node v14 (#636)
  • fix: fix snapshots for forking (#627) Thanks, @seesemichaelj!
  • fix: remove dev dependencies from published package's shrinkwrap (#640)
  • fix: patch keccak to prevent Node v14 segfault (c26ba24)
  • fix: bundle patched version of keccak (c5e6db6)

Misc:

  • test: throw if test contracts fail compilation (#633)
  • chore: simply release process (#638)
  • test: increase infura test timeouts so they stop failing in CI (#642)
  • chore: update CI's Node version to 14.13.0 (#641)
  • try npm 7 to see if it can prune --production and shrinkwrap without creating an invalid shrinkwrap file (4b3f588)
  • update to npm v7.0.0-rc.0 (2af3122)
  • chore: fix prepublish script for npm 7 (b30a886)

Related Releases

💖 The Truffle Team

v2.13.0 – Johnnycake Cobblers 🎂

09 Oct 22:48
v2.13.0
61381e2
Compare
Choose a tag to compare

 Highlights    How to Upgrade    Changelog    Related Releases 


We're moving to a betalatest release pipeline, where all non-hotfix changes are first released in a beta before being promoted to a stable release.

We'd love it if you'd start using the latest betas and let us know early and often if you find any bugs or regressions!

Highlights

v2.13.0 – Johnnycake Cobblers

Johnnycake Cobblers: another dessert with a weird name. Someone really should cook up all the release names we've used for us Trufflers to try one day! 😋

This release brings Node v14 compatibility and a new feature!


How to Upgrade

Upgrade to the latest version of ganache-core by running:

npm

npm uninstall ganache-core
npm install ganache-core@latest

yarn

yarn remove ganache-core
yarn add ganache-core@latest

Changelog

Features:

  • feat: add ability to use blockHash with eth_getLogs (#639) Thanks, @tynes!

Fixes:

  • fix: update merkle-patricia-tree to v3.0.0 to support Node v14 (#636)
  • fix: fix snapshots for forking (#627) Thanks, @seesemichaelj!
  • fix: remove dev dependencies from published package's shrinkwrap (#640)
  • fix: patch keccak to prevent Node v14 segfault (c26ba24)
  • fix: bundle patched version of keccak (c5e6db6)

Misc:

  • test: throw if test contracts fail compilation (#633)
  • chore: simply release process (#638)
  • test: increase infura test timeouts so they stop failing in CI (#642)
  • chore: update CI's Node version to 14.13.0 (#641)
  • try npm 7 to see if it can prune --production and shrinkwrap without creating an invalid shrinkwrap file (4b3f588)
  • update to npm v7.0.0-rc.0 (2af3122)
  • chore: fix prepublish script for npm 7 (b30a886)

Related Releases

💖 The Truffle Team

v2.13.0-beta.0 – Johnnycake Cobblers 🎂

06 Oct 20:58
v2.13.0-beta.0
d7c31f9
Compare
Choose a tag to compare

 Highlights    How to Upgrade    Changelog    Related Releases 


We're moving to a betalatest release pipeline, where all non-hotfix changes are first released in a beta before being promoted to a stable release.

We'd love it if you'd start using the latest betas and let us know early and often if you find any bugs or regressions!

Highlights

v2.13.0-beta.0 – Johnnycake Cobblers

Johnnycake Cobblers: another dessert with a weird name. Someone really should cook up all the release names we've used for us Trufflers to try one day! 😋

This release brings Node v14 compatibility and a new feature!


How to Upgrade

Upgrade to the latest beta version of ganache-core by running:

npm

npm uninstall ganache-core
npm install ganache-core@beta

yarn

yarn remove ganache-core
yarn add ganache-core@beta

Changelog

Features:

  • feat: add ability to use blockHash with eth_getLogs (#639)

Fixes:

  • fix: remove dev dependencies from published package's shrinkwrap (#640)
  • fix: patch keccak to prevent node 14 segfault (c26ba24)

Misc:

  • test: increase infura test timeouts so they stop failing in CI (#642)
  • chore: update CI's node 14 version to 14.13.0 (#641)
  • trying npm 7 to see if it can prune --production and shrinkwrap without creating an invalid shrinkwrap file 4b3f588
  • update to npm v7.0.0-rc.0 2af3122
  • chore: fix prepublish script for npm 7 b30a886

Related Releases

💖 The Truffle Team