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

Releases: trufflesuite/ganache

v7.6.0

13 Dec 21:15
d267903
Compare
Choose a tag to compare

 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 👍 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.


Highlights

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.

back to top


New Features

feat: add 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 👍, or open a new issue.

Fixes: #1001

back to top


Miscellaneous


ci: update actions/workflows to use Node 16 (#3833)

Just getting with the times by updating some GitHub Actions.

back to miscellaneous

docs: document eth_feeHistory in RCP-METHODS.md (#3840)

It does what it says on the label.

back to miscellaneous

docs: update README.md to clarify usage (#3723)

Clarifying how to run Ganache for usage on the CLI, as well as in programmatic usage.

back to miscellaneous

docs: add server to list of startup option namespaces in README.md (#3890)

smol change

back to miscellaneous

back to top


Changelog

back to top


Known Issues

Top Priority:

Read more

v7.5.0

25 Oct 20:02
d8cfb81
Compare
Choose a tag to compare

 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.


Highlights

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.

back to top


New Features

feat: add 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

back to top


Fixes


fix: add an upper limit to # of accounts that can be generated by ganache (#3361)

This change logs a warning to the user that performance may be impacted if more than 100,000 accounts are created.

Fixes #736

back to fixes

fix: add " " 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

back to fixes

back to top


Miscellaneous


docs: fix typo in fork.username cli description (#3634)

Just fixing a typo in the CLI's --help description for the --fork.username option.

back to miscellaneous

ci: add @MicaiahReid to CODEOWNERS (#3775)

As described in the title, this change adds @MicaiahReid to the CODEOWNERS file for some files within Ganache.

back to miscellaneous

test: improve coverage of RPC-JSON Data byteLength argument (#3784)

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().

back to miscellaneous

chore: remove extra quotes in require-engines test helper (#3713)

Just fixing a typo in a test helper.

back to miscellaneous

docs: fix typos (#3801)

Just fixes some typos.

back to miscellaneous

docs: fix 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.

back to miscellaneous

back to top


Changelog

back to top


                
...

Read more

v7.4.4

05 Oct 20:25
5d5dad3
Compare
Choose a tag to compare

 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.


Highlights

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.

back to top


Fixes

fix: calling 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

back to top


Miscellaneous


refactor: remove support for deprecated test networks (#3732)

Removes zero-config forking support for deprecated testnets: Kovan, Ropsten, and Rinkeby.

Fixes #3706

back to miscellaneous

refactor: fix typo in uint-to-buffer.ts (#3738)

Corrects missspelling of "signficant" to the more correct "significant".

back to miscellaneous

back to top


Changelog

  • #3531 fix: calling evm_mine with a timestamp argument should reflect the change of time in subsequent blocks (@jeffsmale90)
  • #3732 refactor: remove support for deprecated test networks (@jeffsmale90)
  • #3738 refactor: fix typo in uint-to-buffer.ts (@eltociear)

back to top


Known Issues

Top Priority:

  • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
  • Add eth_feeHistory RPC endpoint (#1470)
  • Add eth_createAccessList RPC method (#1056)

Coming Soon™:

  • Implications failed: fork.headers -> url (#2627)
  • In Geth chain-mode, logic to accept/reject transactions based on gas price/limit should match Geth (#2176)
  • 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)
  • Launching ganache with fork is throwing revert errors when communicating with 3rd party contracts (#956)
  • Build a real pending block! (#772)
  • VM Exception when interfacing with Kyber contract (#606)
  • After calling evm_mine, eth_getLogs returns same logs for all blocks (#533)
  • personal_unlockAccount works with any password (#165)
  • --db Option Requires Same Mnemonic and Network ID (#1030)

back to top


Future Plans

Top Priority:

  • Add flag for starting ganache in detached mode (#1001)
  • Accept a genesis.json file (#1042)

Coming Soon™:

  • Switch to esbuild to make build times faster/reasonable (#1555)
  • Add eip-155 support ([#880](#880...
Read more

v7.4.4-alpha.0

23 Sep 22:09
c62e6fd
Compare
Choose a tag to compare
v7.4.4-alpha.0 Pre-release
Pre-release

 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.


Highlights

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.

Important Changes

  • Upgrading ethereumjs required dropping support for NodeJS v12. In Ganache v7.0.0 we gave a deprecation notice for node 12, and this release finalizes the removal of this version. To use Ganache, you'll need to install NodeJS v14 or greater.
  • Ethererumjs also dropped support for the Kovan testnet. We were already slated to remove zero-config mainnet forking support for Kovan in October; if you need Kovan support, we recommend using up to v7.4.3 of Ganache.

New Feature

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.

back to top


Fixes

fix: calling 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.

back to top


Changelog

back to top


Known Issues

Top Priority:

  • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
  • Add eth_feeHistory RPC endpoint (#1470)
  • Add eth_createAccessList RPC method (#1056)

Coming Soon™:

  • Implications failed: fork.headers -> url (#2627)
  • In Geth chain-mode, logic to accept/reject transactions based on gas price/limit should match Geth (#2176)
  • 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)
  • Launching ganache with fork is throwing revert errors when communicating with 3rd party contracts (#956)
  • Build a real pending block! (#772)
  • VM Exception when interfacing with Kyber contract (#606)
  • After calling evm_mine, eth_getLogs returns same logs for all blocks (#533)
  • personal_unlockAccount works with any password (#165)
  • --db Option Requires Same Mnemonic and Network ID (#1030)

back to top


Future Plans

Top Priority:

  • Add flag for starting ganache in detached mode (#1001)
  • Accept a genesis.json file (#1042)

Coming Soon™:

  • Switch to esbuild to make build times faster/reasonable (#1555)
  • Add eip-155 support (#880)
  • Allow to sync forked chain to the latest block (#643)
  • Implement a streaming trace capability (#381)
  • Improve log performance when forking (#145)
  • Log contract events (#45)

back to top

Open new issues (or [join our team](https://consensys.net/open-r...

Read more

v7.4.3

08 Sep 21:18
9980cb5
Compare
Choose a tag to compare

 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.


Fixes


fix: assume unknown tx type is 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!

back to fixes

fix: after 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.

back to fixes

fix: 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

back to fixes

fix: return exactly 32 bytes from 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.

back to fixes

back to top


Miscellaneous


test: replace 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!

back to miscellaneous

chore: add support for 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.

back to miscellaneous

docs: add trufflesuite.com to README (#3564)

We just thought it'd be useful to have a link to our website on our README 🔗

back to miscellaneous

ci: add config for semantic-prs app (#3543)

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.

back to miscellaneous

ci: remove docker from automated release workflow (#3547, #3619)

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.

back to miscellaneous

test: skip test pending chainId added to transaction object (#3617)

Pending resolution of #3616, `forking > blocks ...

Read more

v7.4.2

08 Sep 21:17
e4722fe
Compare
Choose a tag to compare

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

v7.4.1

16 Aug 03:29
3a74e07
Compare
Choose a tag to compare

 Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


For the month of August, the Ganache team is laser-focused on crushing tech debt.

Gif of man quickly and efficiently stomping on a long line of soda cans

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.


Fixes


fix: correct signature of eth_getWork (#3349)

This PR was opened by @emilbayes and fixes the signature of our eth_getWork RPC method. Thanks, @emilbayes!

back to fixes

fix: EIP-1559 access list transaction gas cost (#3227)

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:

  1. the up-front gas cost did not factor in the cost of the access list itself
  2. the access list addresses were not being properly marked as warmed by the VM, because address buffers were improperly extended to 32 bytes when the EVM expected 20 byte addresses

Thanks for this fix, @robmcl4!

back to fixes

fix: switch to user-provided logger rather than 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.logs 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.

back to fixes

back to top


Miscellaneous


test: make bundle-size-check test run on external contributor PRs (#3408)

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.

back to miscellaneous

build: ensure webpack's 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.

back to miscellaneous

refactor: fix typo in promise-queue/index.ts (#3434)

This is just a quick typo fix: entrys -> entries. Thanks @eltociear

back to miscellaneous

test: make bundle-size-check test work again (#3444)

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.

back to miscellaneous

test: correct webpack infura key validation error message grammar (#3443)

This change also just fixes some grammar:
From: "INFURA_KEY must 32 characters..."
To: "INFURA_KEY must **be** 32 characters..."

back to miscellaneous

test: replace 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!.

back to miscellaneous

chore: remove unnecessary TODOs from api, update TODOs with issue numbers (#3472)

Housekeeping to update code TODOs with links to matching Issues.

back to miscellaneous

back to top


Changelog

  • #3408 test: make bundl...
Read more

v7.4.0

27 Jul 23:07
4bac7d8
Compare
Choose a tag to compare

 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 💪

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!


Highlights

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!

  1. Ganache joins Remix, Foundry, and Vyper in supporting Hardhat style console.log statements from directly within Solidity!

  2. We've implemented eth_getProof which opens up the possibility to use Ganache together with Layer-2 blockchains, among other possibilities.

back to top


New Features


feat: add the ability to use 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:

back to new features

feat: add 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. 🎉

Fixes: #3076 and #382.

back to new features

back to top


Fixes


fix: issue where 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.

back to fixes

fix: set up the chain correctly to ensure a consistent start time (#3389)

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.

back to fixes

back to top


Miscellaneous

  • [chore: add "Pull Requests" section to CONTRIBUTING.md (#3289)](#user-co...
Read more

v7.3.2

24 Jun 22:01
f2af451
Compare
Choose a tag to compare

 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.


Fixes


fix: fix installation issues by bumping @trufflesuite/bigint-buffer to v1.1.10 (#3208)

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.

back to fixes

fix: reduce bundle size and check size in CI (#3275)

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.

back to fixes

fix: make forking work in the browser (#3130)

Ganache's zero-config forking feature now works in the browser!

back to fixes

fix: Properly handle 'estimate' for 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.

back to fixes

back to top


Miscellaneous

chore: fix typo in errors.ts (#3268)

This is a simple change fixing a typo in one of our comments. Thanks, @eltociear, for this fix!

back to top


Changelog

back to top


Known Issues

Top Priority:

  • calling evm_mine with a timestamp does not persistent time offset (#3265)
  • Architecture not supported (#2256)
  • Add eth_feeHistory RPC endpoint (#1470)
  • Add eth_createAccessList RPC method (#1056)

Coming Soon™:

  • Implications failed: fork.headers -> url (#2627)
  • In Geth chain-mode, logic to accept/reject transactions based on gas price/limit should match Geth (#2176)
  • 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)
  • Launching ganache with fork is throwing revert errors when communicating with 3rd party contracts (#956)
  • Build a real pending block! (#772)
  • VM Exception when interfacing with Kyber contract (#606)
  • After calling evm_mine, eth_getLogs returns same logs for all blocks (#533)
  • personal_unlockAccount works with any password (#165)
  • --db Option Requires Same Mnemonic and Network ID (#1030)

back to top


Future Plans

Top Priority:

  • Add flag for starting ganache in detached mode (#1001)
  • Implement eth_getProof RPC message (#382)
  • Accept a genesis.json file (#1042)

Coming Soon™:

  • Switch to esbuild to make build times faster/reasonable (#1555)
  • Add eip-155 support (#880)
  • Allow to sync forked chain to the latest blcok (#643)
  • Implement a streaming trace capability (#381)
  • Improve log performance when forking (#145)
  • Log contract events (#45)

back to top

[Open new issues](https:/...

Read more

v7.3.1

17 Jun 19:11
6eeaf3a
Compare
Choose a tag to compare

 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!

Millennium falcon entering hyperspace

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.


Highlights

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:

Man dancing on subway wearing Daft Punk helmet

back to top


Fixes

fix: remove redundant await in 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.

back to top


Miscellaneous

perf: improve JSON-RPC data types; better, faster, stronger (#2983)

As part of an ongoing effort to make Ganache ⚡ Lightning-Fast ⚡, 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.

back to top


Changelog

back to top


Known Issues

Top Priority:

  • Unable to install Ganache (npm) on MacOS 10.15.7 (#2445)
  • get forking working in the browser (#1245)

Coming Soon™:

  • 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)
  • Add eth_feeHistory RPC endpoint (#1470)
  • @ganache/filecoin@alpha doesn't work with ganache@alpha (#1150)
  • sort executable/pending transactions that have the same price by the time at which the transaction was submitted (#1104)
  • Add eth_createAccessList RPC method (#1056)
  • Launching ganache with fork is throwing revert errors when communicating with 3rd party contracts (#956)
  • Build a real pending block! (#772)
  • Add an upper limit to # of accounts that can be generated by ganache (#736)
  • Incorrect gas cost for SSTORE opcode when using fork feature (#625)
  • Cannot get state root with uncommitted checkpoints error when starting ganache forking with infura RPC endpoint (#618)
  • --db Option Requires Same Mnemonic and Network ID (#1030)

back to top


Future Plans

  • Reduce Bundle Size (#2096)
  • Switch to esbuild to make build times faster/reasonable (#1555)
  • Opt-in tracking (#945)
  • Mine txs in same block with provided sorting (#899)
  • Add eip-155 support (#880)
  • Add support for debug_accountAt RPC method as implemented by Turbo-Geth (#813)
  • Enhance the database to allow for better UX and determinism (#756)
  • Create Project and set Milestones for Ganache interactive docs ([#680](https://github.com/trufflesuite/ga...
Read more