Releases: trufflesuite/ganache-cli-archive
v6.4.4-beta.0 - ✨ Mystery Flavor ✨
Highlights
How to Upgrade
Changelog
Related Releases
We're moving to a beta
› latest
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
Forked transactions have been fixed before, but the previous fix didn't get all the bugs, and the fix before that had to be reverted due to unwanted side effects. We've created a monster. The fix is back, back again, tell a friend!
We've also add support for binary data over websockets, updated eth-sig-util to fix a global variable leak, and fixed some other bugs, too!
In case you missed it, we're holding TruffleCon 2019 August 2 - 4 at Microsoft's campus in Redmond, WA! And it'll be awesome. You should be there.
How to Upgrade
Upgrade to the latest beta version of ganache-cli by running:
npm
npm uninstall -g ganache-cli
npm install -g ganache-cli@beta
yarn
yarn global remove ganache-cli
yarn global add ganache-cli@beta
Changelog
Bug Fixes
- Hopefully fixed source maps (#645)
- Fix forked transaction trace storage (again) so it doesn't crash anymore (trufflesuite/ganache#420) – @davidmurdoch
- Handle binary websocket messages (trufflesuite/ganache#410) – @davidmurdoch
- Gas estimation: make sure we always return a
lowestIndex
for a range (trufflesuite/ganache#421) – @davidmurdoch & @nicholasjpaterno - Fix getBlockTransactionCountByNumberFormat so it returns the right format (trufflesuite/ganache#414) – @davidmurdoch
Maintenance
- Update eth-sig-util to fix global variable leak (trufflesuite/ganache#415) – @davidmurdoch
Related Releases
💖 The Truffle Team
v6.4.3 - Forking Bugs ⋔🐞
Highlights
How to Upgrade
Changelog
Related Releases
We're moving to a beta
› latest
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
Forked transactions have been fixed before, but the previous fix had to be reverted due to unwanted side effects. The fix is back now, and is hopefully side-effect free this time!
We've also fixed some other bugs, improved documentation, and did a little maintenance, too.
How to Upgrade
Upgrade to the latest version of ganache-cli by running:
npm
npm uninstall ganache-cli
npm install ganache-cli@latest
yarn
yarn remove ganache-cli
yarn add ganache-cli@latest
Changelog
Bug Fixes
- Fix forked transaction trace storage so it returns the correct data and doesn't modify the root trie (trufflesuite/ganache#398) – @davidmurdoch
- Add guard for undefined connection (trufflesuite/ganache#385) – @olaf89
- Fix crash and nonce mismatch when tracing a transaction on a forked chain (trufflesuite/ganache#396) – @davidmurdoch & @nicholasjpaterno
- Fix invalid snapshot revert hanging when the shapshot id doesn't exist (trufflesuite/ganache#387) – @davidmurdoch
Maintenance
- Improve
findPath
callback inkeyExists
(trufflesuite/ganache#378) – @nicholasjpaterno - Update
compileAndDeploy.js
, usejoin
for path's incompile
(trufflesuite/ganache#379) – @nicholasjpaterno
Documentation
- Update
allowUnlimitedContractSize
documentation (trufflesuite/ganache#393) – @nicholasjpaterno - Update
evm_revert
documentation (trufflesuite/ganache#389) – @nicholasjpaterno
Related Releases
💖 The Truffle Team
v6.4.3-beta.0 - Forking Bugs ⋔🐞
Highlights
How to Upgrade
Changelog
Related Releases
Quick bug-fix beta release here. We're moving to a beta
› latest
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
Forked transactions have been fixed before, but the previous fix had to be reverted due to unwanted side effects. The fix is back now, and is hopefully side-effect free this time!
We've also fixed some other bugs, improved documentation, and did a little maintenance, too.
How to Upgrade
Upgrade to the beta version of ganache-cli by running:
npm
npm uninstall ganache-cli
npm install ganache-cli@beta
yarn
yarn remove ganache-cli
yarn add ganache-cli@beta
Changelog
Bug Fixes
- Fix forked transaction trace storage so it returns the correct data and doesn't modify the root trie (trufflesuite/ganache#398) – @davidmurdoch
- Add guard for undefined connection (trufflesuite/ganache#385) – @olaf89
- Fix crash and nonce mismatch when tracing a transaction on a forked chain (trufflesuite/ganache#396) – @davidmurdoch & @nicholasjpaterno
- Fix invalid snapshot revert hanging when the shapshot id doesn't exist (trufflesuite/ganache#387) – @davidmurdoch
Maintenance
- Improve
findPath
callback inkeyExists
(trufflesuite/ganache#378) – @nicholasjpaterno - Update
compileAndDeploy.js
, usejoin
for path's incompile
(trufflesuite/ganache#379) – @nicholasjpaterno
Documentation
- Update
allowUnlimitedContractSize
documentation (trufflesuite/ganache#393) – @nicholasjpaterno - Update
evm_revert
documentation (trufflesuite/ganache#389) – @nicholasjpaterno
Related Releases
💖 The Truffle Team
v6.4.2 - Gas Exactimation 📏
Highlights
How to Upgrade
Changelog
Related Releases
A long-standing issue with Ganache has been the fact that we haven't returned EIP-114 compliant gas estimations, AKA the "1/64ths rule". This caused our gas estimates to be too low in cases where a transaction executed opcodes that are subject to this EIP. This in turn was the cause of many frustrations, especially in situations where tools would use gas estimations in transactions without allowing the user to intercept or change the transaction's supplied gas
.
Highlights
EIP-114 mandates that certain stackdepth-creating opcodes withhold 1/64th of remaining gas from the stack they create. This has two non-obvious effects:
- The gas required for a successful transaction can be greater than the actual gas spent. This is similar to how gas refunds behave.
- The extra gas required for a successful transaction varies depending on the transaction's initial
gas
amount!
Let's say we want to run the following example transaction (note: this transaction is nonsensical and is intended only to illustrate the 1/64ths rule):
DEPTH | OPCODE | OP FEE |
---|---|---|
0 | PUSH1 | 3 |
0 | CALL | 700 |
1 | ADD | 3 |
1 | EXPENSIVE | 10000 |
1 | RETURN | 0 |
0 | POP | 2 |
0 | STOP | 0 |
Total Gas: | 10708 |
This transaction would cost exactly 10708 gas
. However, if you attempted to run this transaction by supplying only 10708 gas
it would fail with an "out of gas"
exception when it gets to the EXPENSIVE
opcode!
The reason for this failure is that the opcode CALL
is subject to EIP-114. Here's a breakdown of how this gas is used:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10708 | 3 | |
0 | CALL | 10705 | 700 | 156 |
1 | ADD | 9849 | 3 | |
1 | EXPENSIVE | 9846 | 10000 | |
REVERT | OOG |
Instead of 10005
gas available (10705
gas available − 700
op fee) at the ADD
opcode,
only 9849
is actually available due to the "withheld" 1/64th: 10005 − FLOOR( 10005 ⁄ 64 ) = 9849
; we are now 154
gas short!
All we need to do now is increase our supplied gas
by 154
, right? Let's see what happens now:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10862 | 3 | |
0 | CALL | 10859 | 700 | 158 |
1 | ADD | 10001 | 3 | |
1 | EXPENSIVE | 9998 | 10000 | |
REVERT | OOG |
We still don't have enough gas! The amount withheld increased by 2
gas because the gas supplied to the transaction increased as well!
Because the 1/64ths rule gets applied to the gas remaining, which has increased since our first estimate, 2
more gas gets withheld, resulting in an OOG error!
Now, let's run the same transaction one more time, this time using the result of our new gas estimation algorithm:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10864 | 3 | |
0 | CALL | 10861 | 700 | 158 |
1 | ADD | 10003 | 3 | |
1 | EXPENSIVE | 10000 | 10000 | |
1 | RETURN | 0 | 0 | −158 |
0 | POP | 158 | 2 | |
0 | STOP | 156 | 0 | |
156 |
It works! Notice that 156
gas was unspent at the end of the transaction, but had we provided even 1
less gas the transaction would have resulted in an "out of gas"
exception at EXPENSIVE
opcode.
This series of simplified examples attempts to provide a high-level overview of the 1/64th gas estimation calculation. To correctly estimate gas on any contract, we must consider how the gas withheld at any nested stack depth/frame affects the gas needed outside of its execution context.
It's a tricky problem to solve. Some implementations of gas estimation after EIP-114 use interval halving (binary search) by running the transaction through the EVM until the gas estimation converges. This seemed like an unnecessarily CPU-intensive approach to the problem, and we set out to find a (theoretically) more performant, and perfectly accurate, way of estimating gas (which we now refer to as "gas exactimation" here at Truffle).
If you find that any of your transactions are running in to unexpected OOG errors please let us know by filing an issue.
We are especially proud of this algorithm, and we are even more proud of the brilliant minds that went into its creation. Thank you Nick Paterno (@nicholasjpaterno), Amal Sudama (@cds-amal), Chris Cowell (@ccowell), Mike Seese (@seesemichaelj), Benjamin Burns (@benjamincburns), and David Murdoch (@davidmurdoch) for all the work you've put in to this release!
We'll follow up with a detailed blog post on the algorithm itself in the coming weeks.
How to Upgrade
Upgrade to the latest version of ganache-cli by running:
npm
npm uninstall -g ganache-cli
npm install -g ganache-cli@latest
yarn
yarn global remove ganache-cli
yarn global add ganache-cli@latest
Changelog
Bug Fixes
- Gas Estimation (trufflesuite/ganache#292) – @nicholasjpaterno
Documentation
- Reformatted and rewrote our documentation (trufflesuite/ganache#348) – @nicholasjpaterno
Related Releases
💖 The Truffle Team
v6.4.2-beta.0 - Gas Exactimation 📏
Highlights
How to Upgrade
Changelog
Related Releases
A long-standing issue with Ganache has been the fact that we haven't returned EIP-114 compliant gas estimations, AKA the "1/64ths rule". This caused our gas estimates to be too low in cases where a transaction executed opcodes that are subject to this EIP. This in turn was the cause of many frustrations, especially in situations where tools would use gas estimations in transactions without allowing the user to intercept or change the transaction's supplied gas
.
Highlights
EIP-114 mandates that certain stackdepth-creating opcodes withhold 1/64th of remaining gas from the stack they create. This has two non-obvious effects:
- The gas required for a successful transaction can be greater than the actual gas spent. This is similar to how gas refunds behave.
- The extra gas required for a successful transaction varies depending on the transaction's initial
gas
amount!
Let's say we want to run the following example transaction (note: this transaction is nonsensical and is intended only to illustrate the 1/64ths rule):
DEPTH | OPCODE | OP FEE |
---|---|---|
0 | PUSH1 | 3 |
0 | CALL | 700 |
1 | ADD | 3 |
1 | EXPENSIVE | 10000 |
1 | RETURN | 0 |
0 | POP | 2 |
0 | STOP | 0 |
Total Gas: | 10708 |
This transaction would cost exactly 10708 gas
. However, if you attempted to run this transaction by supplying only 10708 gas
it would fail with an "out of gas"
exception when it gets to the EXPENSIVE
opcode!
The reason for this failure is that the opcode CALL
is subject to EIP-114. Here's a breakdown of how this gas is used:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10708 | 3 | |
0 | CALL | 10705 | 700 | 156 |
1 | ADD | 9849 | 3 | |
1 | EXPENSIVE | 9846 | 10000 | |
REVERT | OOG |
Instead of 10005
gas available (10705
gas available − 700
op fee) at the ADD
opcode,
only 9849
is actually available due to the "withheld" 1/64th: 10005 − FLOOR( 10005 ⁄ 64 ) = 9849
; we are now 154
gas short!
All we need to do now is increase our supplied gas
by 154
, right? Let's see what happens now:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10862 | 3 | |
0 | CALL | 10859 | 700 | 158 |
1 | ADD | 10001 | 3 | |
1 | EXPENSIVE | 9998 | 10000 | |
REVERT | OOG |
We still don't have enough gas! The amount withheld increased by 2
gas because the gas supplied to the transaction increased as well!
Because the 1/64ths rule gets applied to the gas remaining, which has increased since our first estimate, 2
more gas gets withheld, resulting in an OOG error!
Now, let's run the same transaction one more time, this time using the result of our new gas estimation algorithm:
DEPTH | OPCODE | GAS AVAILABLE | OP FEE | 1⁄64 WITHHELD |
---|---|---|---|---|
0 | PUSH1 | 10864 | 3 | |
0 | CALL | 10861 | 700 | 158 |
1 | ADD | 10003 | 3 | |
1 | EXPENSIVE | 10000 | 10000 | |
1 | RETURN | 0 | 0 | −158 |
0 | POP | 158 | 2 | |
0 | STOP | 156 | 0 | |
156 |
It works! Notice that 156
gas was unspent at the end of the transaction, but had we provided even 1
less gas the transaction would have resulted in an "out of gas"
exception at EXPENSIVE
opcode.
This series of simplified examples attempts to provide a high-level overview of the 1/64th gas estimation calculation. To correctly estimate gas on any contract, we must consider how the gas withheld at any nested stack depth/frame affects the gas needed outside of its execution context.
It's a tricky problem to solve. Some implementations of gas estimation after EIP-114 use interval halving (binary search) by running the transaction through the EVM until the gas estimation converges. This seemed like an unnecessarily CPU-intensive approach to the problem, and we set out to find a (theoretically) more performant, and perfectly accurate, way of estimating gas (which we now refer to as "gas exactimation" here at Truffle).
Our new gas estimation algorithm is being released as a beta in order to get real-world metrics on its accuracy as well as to prove some assumptions we've made about the EVM behavior. It's possible the algorithm still has crash-inducing bugs or could even return estimates that are too low.
If you find that any of your transactions are running in to unexpected OOG errors please let us know by filing an issue.
We are especially proud of this algorithm, and we are even more proud of the brilliant minds that went into its creation. Thank you Nick Paterno (@nicholasjpaterno), Amal Sudama (@cds-amal), Chris Cowell (@ccowell), Mike Seese (@seesemichaelj), Benjamin Burns (@benjamincburns), and David Murdoch (@davidmurdoch) for all the work you've put in to this release!
We'll follow up with a detailed blog post on the algorithm itself in the coming weeks.
How to Upgrade
Upgrade to the beta version of ganache-cli by running:
npm
npm uninstall -g ganache-cli
npm install -g ganache-cli@beta
yarn
yarn global remove ganache-cli
yarn global add ganache-cli@beta
Changelog
Bug Fixes
- Gas Estimation (trufflesuite/ganache#292) – @nicholasjpaterno
Documentation
- Reformatted and rewrote our documentation (trufflesuite/ganache#348) – @nicholasjpaterno
Related Releases
💖 The Truffle Team
v6.4.1 - Hot Fix 🔥
Release Highlights
Fixes an issue where a ganache-core
websocket server may crash when closing the server connection while eth_unsubscribe
calls are still in flight. PR: trufflesuite/ganache#347
Related Releases
v6.4.0 - Petersburg fork & More! ⋔
v6.4.0 - Petersburg fork & More! ⋔
The Petersburg hardfork is scheduled to go live on mainnet on block number 7,280,000, estimated to occur on February 28th. This hardfork removes the reentrancy attack vector introduced in the Constantinople hardfork (which also goes live on mainnet on block 7,280,000). This release includes [email protected]
which includes support for the Petersburg hardfork. Also: bug fixes!
Release Highlights
The default hardfork
option (-k
or --hardfork
on the command line) in ganache-cli
and ganache-core
is now petersburg
. We also fixed lots of bugs and paid off some technical debt!
New Features:
- Upgrade to ganache-core 2.5.1 to add support for the Petersburg fork (/trufflesuite/ganache#323, 11228a1, and #629).
Bug Fixes:
This release also contains some bug fixes!
- Make sure
miner_start
andminer_stop
are asynchronous (/trufflesuite/ganache#322) - Fix bug for transaction receipts with multiple transactions in one block (/trufflesuite/ganache#268)
- Handle invalid block numbers in
eth_getTransactionCount
(/trufflesuite/ganache#291) - Return correct transaction and receipt trie roots (/trufflesuite/ganache#231 and /trufflesuite/ganache#331)
- Fix contract storage access issue when using snapshot and revert (/trufflesuite/ganache#329)
- Fix bug when accessing storage state in
debug_traceTransaction
(/trufflesuite/ganache#330) - Fix regression causing
fork_block_number
option to be ignored (/trufflesuite/ganache#342)
Maintenance and Testing:
- Refactor gas tests (/trufflesuite/ganache#289)
- Enable process listeners for uncaught exceptions in tests (/trufflesuite/ganache#301)
- Remove extra test run from coverall support (/trufflesuite/ganache#299)
- Update lodash (/trufflesuite/ganache#303)
- Add tests for external library function calls (/trufflesuite/ganache#225)
- Improve websocket test coverage (/trufflesuite/ganache#310)
- Update ethers test and ethers.js in package.json so the tests work again (/trufflesuite/ganache#345)
Documentation:
- Clarify
evm_snapshot
behavior inREADME.md
(#615)
More steady releases to come in the future so keep on filing issues and submitting PRs!
💖 The Truffle Team
Related Releases
v6.3.0 - C̶o̶n̶s̶t̶a̶n̶t̶i̶n̶o̶p̶l̶e̶ 🌿
v6.3.0 - C̶o̶n̶s̶t̶a̶n̶t̶i̶n̶o̶p̶l̶e̶ 🌿
Let's talk about that constantinople
bug that was discovered in the 11th hour, shall we? We are proud to have created software that played a roll in the discovery of the attack and love the way the community of builders (and buidlers!) worked together to postpone the hardfork and come up with a solution!
This release contains the original Constantinople hardfork implementation and is now the default hardfork in ganache-cli.
It is safe and recommended to test your contracts using the default "constantinople"
hardfork available in this release of ganache-cli. The only expected difference between the hardfork in this release and the proposed Petersburg hardfork is that some transactions under Petersburg will cost more in gas due to the removal of the vulnerable EIP.
Release Highlights
Implements EIP-1013, Hardfork: Constantinople behind a new flag, hardfork
. Valid values are currently "byzantium"
and "constantinople"
. The default value is "constantinople"
.
This version contains the Constantinople hardfork implementation as it was originally intended by EIP-1013. This hardfork did not go live on Mainnet as planned due to a reentrancy attack discovered by ChainSecurity.
We are expecting a variant of Constantinople, currently named Petersburg, with the reentrancy attack vector removed to go live on Mainnet a few weeks from now (EIP PR: ethereum/EIPs#1716). The proposed change from the original Constantinople hardfork is to remove the offending EIP, EIP-1283.
New Features:
- Constantinople support (trufflesuite/ganache#274)
- Expose database directory for easy lookup (trufflesuite/ganache#271)
Bug Fixes:
This release also contains some bug fixes!
- Make sure
eth_call
,eth_estimateGas
, anddebug_traceTransaction
can't modify state or the state cache (trufflesuite/ganache@e9a54a4) - Don't allow subscription attempts over HTTP (trufflesuite/ganache#252)
- Ensure block numbers specified after
latest
match other EVM implementations (trufflesuite/ganache#228) - Allow dynamic responses in CORS requests (trufflesuite/ganache#226)
- Allow CORS requests to access cookies (ganache-cli doesn't set cookies, but web3 still requires access to them in some browsers) (trufflesuite/ganache@9633943, trufflesuite/ganache@71cc77f)
- Fix pending transactions responses to conform to the JSON-RPC spec (trufflesuite/ganache#227)
Documentation:
- Clarify
accounts
usage in options (#616)
More steady releases to come in the future so keep on filing issues and submitting PRs!
💖 The Truffle Team
Related Releases
v6.4.0-eip1283.0 - Constantinople w/ EIP 1283 Removed
This version contains an experimental build of the ethereumjs-vm with EIP-1283 changes removed.
This version adds a new hardfork option constantinople-1283-removed
. The default hardfork in this experimental build is constantinople-1283-removed
.
Installation
This is a tagged release specifically for the Ethereum protocol development community. you'll need to specify the specific version of this release when installing. To do this, run npm install -g [email protected]
or via tagged release npm install -g ganache-cli@eip1283
and not the usual command npm install -g ganache-cli
To use the docker build: docker run -d -p 8545:8545 trufflesuite/ganache-cli:eip1283
v6.3.0-beta.0 - Constantinople 🏟
Release Highlights 🐈
- Updates to [email protected] which adds support for EIP-1013, Harfork: Constantinople behind a new flag,
hardfork
. Valid values are currently"byzantium"
and"constantinople"
. The default value remains"byzantium"
; the release version of 6.3.0 is slated to be released with"constantinople"
as the default value.