:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
Highlights
New Features
Miscellaneous
Changelog
Known Issues
Future Plans
It's been about a month and a half since our last release, and we've been busy! This release has a couple of minor improvements and a big feature, but we've got even more exciting things coming down the pipe, like stable support for the merge hardfork, genesis.json support, "flavor" plugins, "interactive" docs, and a Ganache UI update! We're ending the year strong and we'll be starting it even stronger <insert motivational poster here>.
Thank you to our PR contributors @tenthirtyone, @jeffsmale90, @emilyJLin95, and @micaiahreid. We'd also like to thank users that contributed to issues closed by the release @fvictorio, @kiview, @leofisG, @mabo-lh, @zhcppy, @ilyar, @lourenc, @mfornet, @kylezs, @TheArhaam, @anthanh, @GradeyCullins, @hacken-audits, @amandesai01, @rudewalt, and @parthlaw.
We use your feedback to plan our roadmap, so if you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a :+1: and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue or open a PR to fix an existing issue.
We've changed 17 files across 5 merged pull requests, tallying 1237 additions and 153 deletions, since our last release.
The release delivers a long-awaited and highly-requested feature: detach mode (starring Sandra Bullock, directed by Jeff Smale)!
Detach mode affords users the ability to start Ganache in the background with a simple flag: --detach
. Check out the details and example usage below.
detach
mode to the CLI (#3568)A common, and rather annoying pattern projects have needed to implement is:
ganache & sleep 5
# interact with localhost:8545 somehow
This set of commands starts Ganache in the background (using &
) and then waits a while (how much changes a lot from machine to machine) until it's ready.
Another inefficient workflow that Ganache has necessitated is maintaining a dedicated terminal just for running Ganache. This becomes extra annoying when you want to have different instances and flavors of Ganache running at the same time.
Ganache can do better...
Enter: Detach mode.
You can now start Ganache with the --detach
flag, which will cause it return to the console as soon as it is ready to receive requests, outputting a nickname for the instance that can later be used to stop
the instance.
The command ganache instances list
will show you all of the instances of Ganache running in Detach mode, and you can stop them with ganache instances stop <name>
.
$ ganache instances list
┌───────┬─────────────────────────┬──────────┬─────────┬────────────────┬────────┐
│ PID │ Name │ Flavor │ Version │ Host │ Uptime │
├───────┼─────────────────────────┼──────────┼─────────┼────────────────┼────────┤
│ 12182 │ salted_caramel_ganache │ ethereum │ 7.6.0 │ 127.0.0.1:8545 │ 4s │
├───────┼─────────────────────────┼──────────┼─────────┼────────────────┼────────┤
│ 53184 │ candied_caramel_truffle │ ethereum │ 7.6.0 │ 127.0.0.1:8546 │ 2m 56s │
└───────┴─────────────────────────┴──────────┴─────────┴────────────────┴────────┘
With the following command, you can start Ganache, run your tests, and stop Ganache when you are finished:
GANACHE=$(ganache --detach) && npm run test; ganache instances stop $GANACHE
Note that we use a ;
in the above example. This will ensure ganache instances stop $GANACHE
runs even if the tests fail.
Or, if you use PowerShell, you can do:
$GANACHE=ganache --detach; npm run test; ganache instances stop $GANACHE
We see Detach mode as the foundation for a new way of interacting with Ganache, and we plan on expanding the scope and features in upcoming releases. We'd love to hear your feedback on the feature, and your ideas on how to improve it. We'll be using the detach-mode
label to track ideas and issues; have a look through the existing ones and add your voice by commenting or :+1:, or open a new issue.
Fixes: #1001
eth_feeHistory
in RCP-METHODS.md
(#3840)
Just getting with the times by updating some GitHub Actions.
eth_feeHistory
in RCP-METHODS.md
(#3840)It does what it says on the label.
Clarifying how to run Ganache for usage on the CLI, as well as in programmatic usage.
smol change
eth_feeHistory
in RCP-METHODS.md
(@davidmurdoch)detach
mode to the CLI (@jeffsmale90)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
New Features
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
Back from Devcon and our ConsenSys retreat for another release!
Thank you to our contributors @omahs, @micaiahreid, @tenthirtyone, and @jeffsmale90 for your contributions to this release. We'd also like to thank issue contributors @gnidan, @mxork, @leroldary, @Inphi, @domalaq, @ChristianCoenen, @drortirosh, @seaona, @krzkaczor, and @aashborn.
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue, open a PR to fix an existing issue, or apply to join our team (we're hiring!) if you really want to get involved.
We've changed 32 files across 9 merged pull requests, tallying 1641 additions and 432 deletions, since our last release.
This release brings you the long-awaited eth_feeHistory
RPC endpoint. Check out the Infura docs on this method if you aren't already up to speed. Give it a try and let us know if you aren't fully gruntled with the feature or if you find any issues with its performance or implementation.
It also brings a few bug fixes, docs updates, and some internal improvements.
eth_feeHistory
JSON-RPC endpoint (#3351)Adds eth_feeHistory
to the JSON-RPC API. This endpoint returns gas used, baseFeePerGas, and effective reward by array of percentages accounting for gas used for a range of blocks.
Check out the Infura docs on this method if you aren't already up to speed.
Fixes: #1470
" "
after the HTTP/1.1 Response Status-Code (#3404)
This change logs a warning to the user that performance may be impacted if more than 100,000 accounts are created.
Fixes #736
" "
after the HTTP/1.1 Response Status-Code (#3404)This change brings Ganache into strict compliance with the HTTP/1.1 Status-Line specification. Nearly all established HTTP/1.1 response parsers handle HTTP/1.1 Status-Lines that omit the Status-Code trailing space character, but it doesn't hurt to follow the specification strictly.
This change fixes #3400
eth_call
interactive docs example (#3774)
Just fixing a typo in the CLI's --help
description for the --fork.username
option.
As described in the title, this change adds @MicaiahReid to the CODEOWNERS file for some files within Ganache.
This change adds basic tests ensuring the byteLength
argument passed to the RPC-JSON Data constructor and factory method are respected internally, and that they are overridden by the argument passed to toString()
and toBuffer()
.
Just fixing a typo in a test helper.
Just fixes some typos.
eth_call
interactive docs example (#3774)Our not-yet-published-but-available-for-use interactive JSON-RPC documentation had a bug in the example for eth_call
, which is resolved with this fix.
" "
after the HTTP/1.1 Response Status-Code (@davidmurdoch)eth_call
interactive docs example (@MicaiahReid)eth_feeHistory
JSON-RPC endpoint (@tenthirtyone)
debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
With the end of September we mark the successful joining of the original execution layer of Ethereum with its new Proof-Of-Stake consensus layer, the Beacon Chain, better known as The Merge. Congratulations to everyone who contributed to Ethereum's transition from Proof-of-Work to Proof-of-Stake.
To our users interested in trying post-merge features check out Ganache v7.4.4-alpha.0.
A special thank you to our external contributor @eltociear and contributor @jeffsmale90 for their contributions to this release.
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue, open a PR to fix an existing issue, or apply to join our team (we're hiring!) if you really want to get involved.
We've changed 8 files across 3 merged pull requests, tallying 119 additions and 49 deletions, since our last release.
This release removes zero-config forking support for deprecated testnets: Kovan, Rinkeby, and Ropsten test networks in anticipation of Infura deprecating these testnets from the Infura API on October 5th, 2022. Infura recommends users migrate to Goerli to test deployments.
evm_mine
with a timestamp
argument should reflect the change of time in subsequent blocks (#3531)Previously, calling evm_mine
with a timestamp
argument would result in a block with the specified timestamp, but subsequent blocks would have a timestamp that didn't reflect this change in time. This only occurred when miner.timestampIncrement
is unspecified or clock
.
const provider = ganache.provider();
await provider.request({ method: "evm_mine", params: ["0x1"] });
const { timestamp: firstTimestamp } = await provider.request({
method: "eth_getBlockByNumber",
params: ["latest", false],
});
// wait 1 second before mining the second block
await new Promise((resolve, reject) => setTimeout(resolve, 1000));
await provider.request({ method: "evm_mine", params: [] });
const { timestamp: secondTimestamp } = await provider.request({
method: "eth_getBlockByNumber",
params: ["latest", false],
});
console.log({
firstTimestamp,
secondTimestamp,
});
Will output something like:
{ firstTimestamp: '0x1', secondTimestamp: '0x5e0be0ff' }
Where secondTimestamp
is the current time in seconds, but should be 0x2
.
With this change, blocks mined after providing a timestamp
parameter to evm_mine
, will have timestamps that reflect the change in time.
Fixes: #3265
Removes zero-config forking support for deprecated testnets: Kovan, Ropsten, and Rinkeby.
Fixes #3706
Corrects missspelling of "signficant" to the more correct "significant".
evm_mine
with a timestamp
argument should reflect the change of time in subsequent blocks (@jeffsmale90)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
Fixes
Changelog
Known Issues
Future Plans
Jump below to our highlights to see notes about post-merge Ganache!
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue or open a PR to fix an existing issue.
We've changed 126 files across 3 merged pull requests, tallying 12,166 additions and 11,364 deletions, since our last release.
This release introduces support for the Merge! In preparation for the merge, our friends at ethereumjs were working hard on a huge new release with quite a few breaking changes. Because we rely so heavily on the work that ethereumjs does, these breaking changes impacted just about every nook and cranny of the Ganache code base. We wanted to get the merge features to our users as soon as possible, while also doing our due diligence to make sure the sweeping changes made by the ethereumjs upgrade don't affect Ganache's stability. With all that in mind, we have an alpha release out today with support for the Merge!
This introduces a few important changes and features that are worth explaining.
The only new feature that could potentially impact our users is the introduction of the finalized
and safe
block tags. These can be used with eth_getBlockByNumber
, or any other RPC method that receives a block tag:
const finalizeBlock = await provider.request({ method: "eth_getBlockByNumber", params: ["finalized", true] } );
const safeBlock = await provider.request({ method: "eth_getBlockByNumber", params: ["safe", true] } );
Note: These new block tags are aliases for the existing latest
block tag.
evm_mine
with a timestamp
argument should reflect the change of time in subsequent blocks (#3531)Previously, calling evm_mine
with a timestamp
argument would result in a block with the specified timestamp, but subsequent blocks would have a timestamp that didn't reflect this change in time. This only occurred when miner.timestampIncrement
is unspecified or clock
.
const provider = ganache.provider();
await provider.request({ method: "evm_mine", params: ["0x1"] });
const { timestamp: firstTimestamp } = await provider.request({
method: "eth_getBlockByNumber",
params: ["latest", false],
});
// wait 1 second before mining the second block
await new Promise((resolve, reject) => setTimeout(resolve, 1000));
await provider.request({ method: "evm_mine", params: [] });
const { timestamp: secondTimestamp } = await provider.request({
method: "eth_getBlockByNumber",
params: ["latest", false],
});
console.log({
firstTimestamp,
secondTimestamp,
});
Will output something like:
{ firstTimestamp: '0x1', secondTimestamp: '0x5e0be0ff' }
Where secondTimestamp
is the current time in seconds, but should be 0x2
.
With this change, blocks mined after providing a timestamp
parameter to evm_mine
, will have timestamps that reflect the change in time.
evm_mine
with a timestamp
argument should reflect the change of time in subsequent blocks (@jeffsmale90)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
As we close out the month of August where we focused most of our energy on removing tech debt from the Ganache codebase, we have a release with quite a few fixes, documentation updates, chores, and CI improvements. This, combined with the week that the whole team took off to rest, means that we should be ready for some serious momentum in the coming months! We have some great new features in the works and are excited to share them with you in the coming releases!
For this release, we'd like to thank our issue reporters (@VladLupashevskyi, @cds-amal) and PR openers (@jaketimothy, @l2ig). We really appreciate your contributions!
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue or open a PR to fix an existing issue if you really want to get involved.
We've changed 55 files across 12 merged pull requests, tallying 935 additions and 462 deletions, since our last release.
TransactionType.Legacy
(#3523)
provider.disconnect()
is called, Ganache should stop serving requests (#3433)
evm_setTime
doesn't work correctly with miner.timestampIncrement
(#3506)
eth_getStorageAt
(#3527)
TransactionType.Legacy
(#3523)This change, made by the great @jaketimothy, fixes a bug with Ganache where it would throw if an unknown transaction type is sent by a user. Now, Ganache will allow any transaction type and turn it into a Legacy transaction if the type is unknown. This fixes an issue (#3458) that many Arbitrum Nitro users have been facing. Thanks again, @jaketimothy!
provider.disconnect()
is called, Ganache should stop serving requests (#3433)Previously, when provider.disconnect()
was called, a lot of the internals of Ganache would be stopped, but just enough was kept alive to serve requests. This could stop consumers from shutting down cleanly.
Now all pending requests, and any new requests will be rejected with a helpful error.
For example, before this change, the following would successfully return the block number:
const provider = Ganache.provider();
await provider.disconnect();
const blockNumber = await provider.send("eth_blockNumber");
But now:
Error: Cannot process request, Ganache is disconnected.
Caveat: any request that has started to process, but not yet complete, may fail with an unexpected error. See #3499 for details.
evm_setTime
doesn't work correctly with miner.timestampIncrement
(#3506)When using miner.timestampIncrement
, calling evm_setTime
can result in unexpected values, and potentially with an error being thrown.
This is because the timeAdjustment
is applied to the previous blocktime, so this offset is applied for every block that is mined.
With the following example, the initial block is mined correctly, as is the first block after setting the time, but subsequent blocks will have a descending block time, until the value becomes negative.
const p = await getProvider({
miner: { timestampIncrement: 1 },
chain: { time: 10000 }
});
const mineAndShowBlock = async () => {
await p.send("evm_mine");
const { number, timestamp } = await p.send("eth_getBlockByNumber", [
"latest"
]);
console.log({ number, timestamp: Quantity.toNumber(timestamp) });
};
await mineAndShowBlock();
await p.send("evm_setTime", [5000]);
while (true) {
await mineAndShowBlock();
}
{ number: '0x1', timestamp: 11 }
{ number: '0x2', timestamp: 6 }
{ number: '0x3', timestamp: 1 }
Error: Cannot wrap a negative value as a json-rpc type
eth_getStorageAt
(#3527)eth_getStorageAt
was returning compact representations of data, e.g., "0x5"
instead of "0x0000000000000000000000000000000000000000000000000000000000000005"
. We now always return the padded whole 32 byte word.
assert.deepEqual
with assert.deepStrictEqual
(#3533)
grayGlacier
; update @ethereumjs/*
packages (#3534, #3629)
assert.deepEqual
with assert.deepStrictEqual
(#3533)This PR improves the consistency of our tests but replacing all assert.deepEqual
calss with assert.deepStrictEqual
. Thanks, @l2ig!
grayGlacier
; update @ethereumjs/*
packages (#3534, #3629)This change adds support for the grayGlacier
hardfork. This change also updates @ethereumjs/*
packages to their latest versions, which is what allows us to add the grayGlacier
hardfork (ganache --hardfork grayGlacier
). This hardfork does not change ganache behavior, other than make the hardfork name available.
We just thought it'd be useful to have a link to our website on our README :link:
This change adds a semantic.yml
file to configure how the Semantic-PRs app interacts with Ganache. This app will now require that all pull requests have a title with a conventional commit message.
Previously our automated release process would require successfully publishing to Docker to complete. Since publishing to Docker can sometimes be unreliable, this would occasionally cause the release to fail, meaning we'd have to manually fix our release process' commit history and publish to Docker.
This change moves the step to publish to Docker to its own action, which is run only if the actual release is fully successful. Because this is now a separate job in the release process, we can rerun that individual job if it fails.
Fixes #3546.
Pending resolution of #3616, forking > blocks > should get a block from the original chain
test is now skipped.
This change adds support for the sepolia testnet. You can now use Ganache's zero-config mainnet forking to fork the sepolia testnet. To do this, simply run ganache --fork sepolia
in your console.
TransactionType.Legacy
(@jaketimothy)assert.deepEqual
with assert.deepStrictEqual
(@l2ig)grayGlacier
; update @ethereumjs/*
packages (@davidmurdoch)provider.disconnect()
is called, Ganache should stop serving requests (@jeffsmale90)evm_setTime
doesn't work correctly with miner.timestampIncrement
(@jeffsmale90)eth_getStorageAt
(@davidmurdoch)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
This version was released with a bug caused by an invalid startup default. This version is deprecated and has been re-released with the fix in v7.4.3. Release notes are here: https://github.com/trufflesuite/ganache/releases/tag/v7.4.3
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
For the month of August, the Ganache team is laser-focused on crushing tech debt.
Pictured: the Ganache team, laser-focused and crushing tech debt.
As such, we're a bit light on "substantial" changes for this release. We're hoping this investment will pay dividends in the coming releases, though, so keep an eye out for more exciting features in upcoming releases! Many of our changes for this release were made by members of our awesome community of contributors, so we'd like to give a special thank you to @emilbayes, @robmcl4, @eltociear, and @l2ig. Thank you all so much!
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue or open a PR to fix an existing issue.
We've changed 24 files across 10 merged pull requests, tallying 82 additions and 50 deletions, since our last release.
eth_getWork
(#3349)
console.log
(#3466)
eth_getWork
(#3349)This PR was opened by @emilbayes and fixes the signature of our eth_getWork
RPC method. Thanks, @emilbayes!
This change fixes how our EIP-1559 transactions handle Access Lists, which were introduced in EIP-2930. Although our EIP-2930 transactions were correctly calculating gas costs, these calculations weren't being performed correctly for the EIP-1559 transactions. There were two issues here:
Thanks for this fix, @robmcl4!
console.log
(#3466)The Ganache options allow you to set a custom logger to handle any logging that Ganache does*. When using Ganache programatically, this can be done as follows:
const logger = {
log: (message?: any, ...optionalParams: any[]) => {
// whatever custom log stuff you want
}
};
const provider = Ganache.provider({
logging: { logger }
});
However, there were still a few hold-out console.log
s in our code, which logged directly to the console rather than the user-provided log function. This change fixes this issue.
*Pro Tip: You can actually update that logger
function while Ganache is running to temporarily change how you handle logs, if you're into that sort of thing.
INFURA_KEY
is exactly 32 lowercase hex characters (#3409)
assert.equal
with assert.strictEqual
in tests (#3508)
A recent addition to our CI tests that ensures we do not exceed our bundle size limit causes external contributor PRs to fail this check. The reason for the failure is because this check requires an environment secret that is not available to the GitHub Action Environment that runs external contributor pull requests. This change replaces the secret with a fake value that allows the test to run as if the real secret was supplied.
INFURA_KEY
is exactly 32 lowercase hex characters (#3409)Our build process checks if the INFURA_KEY
environment variable looks valid, but it was doing it wrong. It now actually checks for lowercase hex strings.
This is just a quick typo fix: entrys -> entries
. Thanks @eltociear
This change combined with this one caused the bundle-size-check to fail for all PRs. The INFURA_KEY env var was updated to work for all PRs, including external contributors, but it used an invalid character. The INFURA_KEY validation was incorrect, and the invalid key passed validation. Once the INFURA_KEY validation was fixed the invalid key was now failing validation, causing all PRs to fail the CI check. This change updated the INFURA_KEY so that it passes validation.
This change also just fixes some grammar:
From: "INFURA_KEY must 32 characters..."
To: "INFURA_KEY must **be** 32 characters..."
assert.equal
with assert.strictEqual
in tests (#3508)As part of our tech-debt month, we made an issue to update our tests to use assert.strictEqual
rather than assert.equal
. Within a day of making the issue, @l2ig picked it up and made this PR. Thanks, @l2ig!.
Housekeeping to update code TODOs with links to matching Issues.
eth_getWork
(@emilbayes)INFURA_KEY
is exactly 32 lowercase hex characters (@davidmurdoch)console.log
(@MicaiahReid)assert.equal
with assert.strictEqual
in tests (@l2ig)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccount*
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
New Features
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
It's been a little while since you've seen a Ganache release, but trust us, we're hard at work making Ganache better. Today we've got 2 new features, 2 bug fixes, and 11 miscellaneous internal changes to prove it :muscle:
We've changed 44 files across 16 merged pull requests, tallying 9431 additions and 172 deletions, since our last release.
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue, or open a PR to fix an existing issue.
And a huge thank you to all issue openers/commenters (@area, @facuspagnuolo, @saurik, @simon-jentzsch) and contributors (@jeffsmale90, @cds-amal, @davidmurdoch, @gnidan, @tenthirtyone) who were a part of making this release happen!
We've merged 16 Pull Requests for this release, and most of them were internal facing changes or small bug fixes you probably won't notice. However, there are two new features you'll really love!
Ganache joins Remix, Foundry, and Vyper in supporting Hardhat style console.log
statements from directly within Solidity!
We've implemented eth_getProof
which opens up the possibility to use Ganache together with Layer-2 blockchains, among other possibilities.
console.log
from Solidity (#3327, #3421)
eth_getProof
RPC method (#3199)
console.log
from Solidity (#3327, #3421)Ganache now supports console.log
in Solidity!
Ganache now understands the output of Vyper's print
statement and Hardhat's console.sol
library contract.
Details and how-tos will be written up in Truffle's upcoming console.log
release. So stay tuned for that!
If you want to try it out in your Truffle projects today you don't have to wait! Install our new package @ganache/console.log
(npm install @ganache/console.log
) then use it in your Solidity contracts as follows:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@ganache/console.log/console.sol";
contract GanacheCoin {
mapping (address => uint) balances;
constructor() {
balances[tx.origin] = 10000;
}
function sendCoin(address receiver, uint256 amount) public returns(bool sufficient) {
if (balances[msg.sender] >= amount) {
balances[msg.sender] -= amount;
balances[receiver] += amount;
console.log("send: %o coins to %o", amount, receiver);
return true;
} else {
return false;
}
}
}
Make sure you are using the latest version of Ganache (v7.4.0 or later) and you should then see console.log
output alongside the usual Ganache output! Example:
eth_getProof
RPC method (#3199)EIP-1186 proposes a new eth_getProof
RPC method, which returns a number of useful values, including hashes and proofs associated with the given address and storage keys.
You can call this new RPC method with something like:
const result = provider.request({
"method": "eth_getProof",
"params": [
// the address to query and generate proof for
"0x7F0d15C7FAae65896648C8273B6d7E43f58Fa842",
// optional storage keys to generate proofs for
["0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"],
// the block at which to generate the proof
"latest"
]
});
And it will return something like this:
{
"accountProof": [
"0xf90211a...0701bc80",
"0xf90211a...0d832380",
"0xf90211a...5fb20c80",
"0xf90211a...0675b80",
"0xf90151a0...ca08080"
],
"balance": "0x0",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
"nonce": "0x0",
"storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"storageProof": [
{
"key": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"proof": [
"0xf90211a...0701bc80",
"0xf90211a...0d832380"
],
"value": "0x1"
}
]
}
A great big thanks to the team at EthereumJS, and specifically to @jochem-brouwer, whose implementation of eth_getProof
does all of the heavy lifting for us. :tada:
Fixes: #3076 and #382.
Quantity.toNumber()
returns incorrect value with leading 00
bytes, and meaningful byte length > 6 (#3328)A regression in v7.3.1 introduced an issue where (in a fairly narrow edge case) an incorrect value was returned from an internal RPC data representation.
The return value of Quantity.toNumber()
was incorrect in the case where the input buffer contained at least one leading 00
byte, and the significant byte length was greater than 6.
The result was a significantly lower value – the correct value right shifted by the number of leading 00
bytes.
e.g., [0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
would have been converted to [0x10, 0x00, 0x00, 0x00, 0x00, 0x00]
resulting in: 17_592_186_044_416
instead of 4_503_599_627_370_496
.
Previously, when initializing Ganache, slightly different start times could be used in different places. This caused calls to evm_increaseTime
to return a value 1 second less than expected.
With this change, Ganache uses a single call to Date.now()
for calculating the internal time offset.
Fixes: #3271.
--verbose
cli help text (#3354)
callGasLimit
default value in README (#3322)
concurrency: production
in Release workflow (#3355)
hasOwn
JSDoc so it is correct (#3379)
callGasLimit
default change to breaking changes list in UPGRADE-GUIDE.md
(#3320)
You may have guessed it, but this change adds a "Pull Requests" section to our CONTRIBUTING.md! But while we're here talking about how you can contribute to Ganache, why not check out our help wanted and good first time contributor issues to start contributing yourself!
A recently introduced test borders on the edge of "just fast enough" and "too slow" and was causing intermittent test timeouts in the our GitHub Actions macOS runner. We've increased the timeout of this test to give it plenty of overhead.
--verbose
cli help text (#3354)The documentation for the --verbose
CLI flag was inaccurate. Now it isn't.
A recent change improved the accuracy of internal types and caused a test to become flaky. Whenever the from
or to
values in the test contained leading 00
s (like 0x00C7656EC7ab88b098defB751B7401B5f6d8976F
) the test would fail.
Before the change in #2983 Quantity.from("0x0011223344").toBuffer()
would return Buffer< 00 11 22 33 44 >
; after #2983 leading 00
bytes are stripped off, returning Buffer< 11 22 33 44 >
. This change would cause the test to fail because the Ethereum JS Address
class validates the length of the input buffer, and throws if it is not exactly 20 bytes.
We now use an Address
class to handle the addresses in this test.
Thanks, @dependabot!
This just sets up an initial CODEOWNERS
file so we can improve our code review process in the near future.
callGasLimit
default value in README (#3322)This goes along with #3320 to correct some documentation on a previous release that changed our default callGasLimit
value.
concurrency: production
in Release workflow (#3355)This ensures we don't trigger multiple Releases at once. See https://docs.github.com/en/actions/deployment/about-deployments/deploying-with-github-actions#using-concurrency for details on how this works.
hasOwn
JSDoc so it is correct (#3379)The JSDoc comment for our internal hasOwn
helper was out of date with the implementation. Now it's not.
callGasLimit
default change to breaking changes list in UPGRADE-GUIDE.md
(#3320)A known change in default start up options in Ganache v7 was left undocumented. This change adds a note about this change to our UPGRADE-GUIDE.md.
Just removing some totally unused code. Nothing to see here!
Quantity.toNumber()
returns incorrect value with leading 00
bytes, and meaningful byte length > 6 (@jeffsmale90)console.log
from Solidity (@davidmurdoch)--verbose
cli help text (@cds-amal)callGasLimit
default value in README (@davidmurdoch)concurrency: production
in Release workflow (@davidmurdoch)hasOwn
JSDoc so it is correct (@davidmurdoch)callGasLimit
default change to breaking changes list in UPGRADE-GUIDE.md
(@davidmurdoch)eth_getProof
RPC method (@jeffsmale90)console.log
event context is defined (@davidmurdoch)debug_storageRangeAt
fails to find storage when the slot was created earlier in the same block (#3338)evm_mine
with a timestamp
does not persist time offset (#3265)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccountNonce
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
Another day, another bug fix release.
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue, open a PR to fix an existing issue, or apply to join our team (we're hiring!) if you really want to get involved.
Speaking of the awesome community of Ganache users, we'd like to extend our gratitude to all issue openers/commenters (@kimpace19882627, @slav-arcadechain, @canoqb10, @khelil, @bolshoytoster, @spinlud, @VarunSaiTeja, @merlox, @ccornici, @SeanLuis, @alexander-schreiner) and contributors (@rmeissner, @tenthirtyone, @cds-amal, @eltociear, @MicaiahReid) who were a part of this release!
We've changed 29 files across 5 merged pull requests, tallying 318 additions and 193 deletions, since our last release.
defaultTransactionGasLimit
option on the CLI (#3233)
This change updates @trufflesuite/bigint-buffer
to 1.1.10
. This patched version is built in v18
of NodeJS and resolves build issues for Windows and Mac users installing Ganache (1, 2, possibly 3, 4) on Node v14
, v16
, and v18
.
jsDelivr has an unpacked bundle size limit of 100MB, which we recently exceeded, breaking our CDN recommendation in our README.md.
This change reduces the bundle size to under 100MB and also adds a check to our pr.yml CI Action that will fail if the new bundle size is greater than 100 MB.
Ganache's zero-config forking feature now works in the browser!
defaultTransactionGasLimit
option on the CLI (#3233)Previously, estimate
was causing an error when the miner options would attempt to cast the string to BigInt.
This change adds the estimateOrToBigIntOrString
function to Ethereum's miner options to intercept and handle the estimate
option on the cli.
This is a simple change fixing a typo in one of our comments. Thanks, @eltociear, for this fix!
defaultTransactionGasLimit
option on the CLI (@tenthirtyone)evm_mine
with a timestamp
does not persistent time offset (#3265)eth_feeHistory
RPC endpoint (#1470)eth_createAccessList
RPC method (#1056)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccountNonce
is race-conditiony (#1646)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)evm_mine
, eth_getLogs
returns same logs for all blocks (#533)eth_getProof
RPC message (#382)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team
Highlights
Fixes
Miscellaneous
Changelog
Known Issues
Future Plans
Today we have a smaller release so that we could get out a hot fix for an issue opened by @weiyuan95 (thanks Lee Wei Yuan!). We also have a performance improvement by @jeffsmale90, so upgrade to v7.3.1 to enjoy Ganache at even higher speeds!
If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner. Give them a +1 and we'll use this community feedback to help prioritize what we work on! Or better yet, open a new issue, open a PR to fix an existing issue, or apply to join our team (we're hiring!) if you really want to get involved.
We've changed 58 files across 2 merged pull requests, tallying 1264 additions and 790 deletions, since our last release.
The great @jeffsmale90 has whipped up an awesome performance improvement for Ganache's internal JSON-RPC data types that also manages to make us more inline with correct JSON-RPC data representations. Jeff started working on this change even before he formally started here at Truffle 3 months ago (oh the joys of working on open-source tech with highly motivated people), so he was pretty thrilled to have this one released. Introducing:
JSON-RPC Data Type Improvements: Better, Faster, Stronger
with actual footage of Jeff as this PR was released:
evm_mine
(#3247)In v7.3.0 we released a fix to the evm_mine
RPC method that ended up breaking evm_mine
in strict instamine mode. The previous fix ensured that blocks were saved before evm_mine
would return. However, in strict instamine mode, we had an explicit call to wait for the blocks to be saved. This attempt to wait for blocks to be saved became redundant and caused evm_mine
to hang indefinitely. This is now fixed, and we've added some tests to verify that evm_mine
continues working in both strict and eager instamine modes.
As part of an ongoing effort to make Ganache :zap: Lightning-Fast :zap:, the internal representations of JSON-RPC data (Data
, Quantity
, and Address
) have been rewritten to be quicker, and does not change how you should use Ganache.
These classes also now validate input values correctly, following the guidelines established by the Ethereum Foundation. This makes Ganache behave more correctly, but may cause some failures in existing code bases where invalid values are being passed into RPC functions.
This change has a significant impact on forking performance. The Convex Shutdown benchmark simulates a call to Convex's systemShutdown
method. With a hot cache, Ganache's performance, with and without this change is below:
Ganache Version | Cached |
---|---|
7.3.0 - before | 0m28.015s |
7.3.1 - after | 0m19.312s |
Which is an approximately 31% speed up!
Note: Benchmarks were performed on macOS 12.2.1 with M1 Pro CPU and 16 GB LPDDR5.
evm_mine
(@MicaiahReid)debug_traceTransaction
may crash on Node.js v12 (#2106)evm_mine
and miner_start
don't respect --mode.instamine=eager (#2029)evm_setAccountNonce
is race-conditiony (#1646)eth_feeHistory
RPC endpoint (#1470)@ganache/filecoin@alpha
doesn't work with ganache@alpha
(#1150)eth_createAccessList
RPC method (#1056)Cannot get state root with uncommitted checkpoints
error when starting ganache forking with infura RPC endpoint (#618)blockHash
to JSON-RPC methods which accept a default block parameter (#973)evm_mine
to return the new block (#536)personal_ecRecover
and personal_sign
(#995)eth_getProof
RPC message (#382)eth_getRawTransactionByHash
(#135)Open new issues (or join our team) to influence what we gets implemented and prioritized.
💖 The Truffle Team