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

v7.0.0-rc.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@davidmurdoch davidmurdoch released this 12 Jan 23:16
· 221 commits to develop since this release

 New Features   Fixes   Miscellaneous   Known Issues   Future Plans 


This release is the first "Release Candidate" (rc) release of the new and improved Ganache v7.0.0. You'll definitely want to catch up on the previous changes from the beta releases, if you haven't already, before reading on!

Thanks to everyone who tried out our previous alpha and beta releases and provided feedback! You have been immensely helpful!

Special thanks to @domob1812, @gas1cent, and @MicaiahReid for your contributions to this release, and to @Fatorin and @0xng for reporting issues.

To install globally run:

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


Highlights

We've changed 45 files across 12 merged pull requests, tallying 1003 additions and 383 deletions, since our last release.

This is an official release candidate for Ganache 7! 🎉 This release contains two new features and a few bug fixes. If you do find any issues on this release, please report them! We'd much rather get them fixed before a stable release.

back to top


New Features


feat: add txpool_content RPC method. (#1539)

The new txpool_content RPC method returns the current contents of the transaction pool. The contents of the transaction pool are grouped into "pending" and "queued" transactions. "Pending" transactions are those that are immediately executable in the transaction pool, meaning that the transaction's nonce is equal to the sender account's next nonce. A "queued" transaction is one with a future nonce that is not immediately executable. Each of the groups of "pending" and "queued" transactions is grouped by the transaction's origin (aka sender), and a group of transactions from one origin are grouped by the origin's nonce.

Here is an example response:

{
  "pending" : {
    "0x8e89f513c2ed8eb9d915196199615e590028b727" : {
      "0" : { /* eth_getTransactionByHash */ }
    }
  },
  "queued" : {
    "0x8e89f513c2ed8eb9d915196199615e590028b727" : {
      "2" : { ... },
      "3" : { ... },
    }
  }
}

back to new features

feat: replace legacyInstamine option with instamine=eager|strict (#2013, #2043)

This feature doubles as both an unbreaking change to Ganache v6.x.x and a breaking change for alpha and beta pre-releases of Ganache v7.0.0.

Ganache v6's instamine behavior would include a submitted transaction in a block before returning the transaction hash. This allows the caller to immediately follow a call to eth_sendTransaction with a successful call to eth_getTransactionReceipt. This behavior will never occur against a real node, as it takes time for a transaction to be included in a block. This is very convenient for testing but resulted in a bit of confusion for new Ethereum developers into how eth_sendTransaction (and related RPC methods) worked.

Previously, pre-releases of Ganache v7.0.0 "fixed" this confusion by defaulting to a new strict instamine mode that more accurately recreated the behavior of a real node: it would return the transaction hash to the caller before the transaction was included in a block. This would result in calls to eth_getTransactionReceipt to sometimes return null, depending on timing, when they used to always return the receipt. This is normal real-world behavior, but because the Ethereum JavaScript Provider spec doesn't yet afford an easy and convenient way of detecting transaction changes we found this behavior to be too cumbersome to be a new default, compared to the v6 default (which we called --legacyInstamine in the v7 pre-releases).

This release reverts the previous decision to default to a strict instamine mode, and instead defaults to the v6 way, and is now referred to as "eager" instamine mode (instead of --legacyInstamine).

We still encourage users to use the new strict mode, which can be opted into by setting the --instamine flag/option to "strict":

ganache --instamine strict

or

const provider = ganache.provider({
  miner: {
    instamine: "strict"
  }
});

To upgrade from other pre-release versions of Ganache v7:

If you set --legacyInstamine flag:

Just remove the flag, as this behavior is the new default (now called "eager" instamine mode)

If you used the default (you didn't set the --legacyInstamine) flag:

The new default mode should work in nearly all instances that strict mode works, so you likely don't need to do anything. But if you do want to continue to use
"strict" mode you will need to add the "strict" instamine mode flag:

ganache --instamine strict

or

const provider = ganache.provider({
  miner: {
    instamine: "strict"
  }
});

back to new features

back to top


Fixes


fix: fix typo in evm_setTime docs (#1861)

This is will result in an invalid state -> This will result in an invalid state

back to fixes

fix: update gas limit to 30M (#1973)

Ethereum's average block gas limit has been around 30,000,000, so we are updating Ganache's default to match.

As a reminder, we regularly update Ganache defaults to match that of mainnet without a breaking-change release.

back to fixes

fix: include impersonated accounts in eth_accounts (#1990)

Accounts added via the --unlock flag were not being returned in calls to eth_accounts and personal_listAccounts. This PR fixes this issue.

back to fixes

fix: eth_call should use the same baseFee as given block num (#1980)

Previously, whenever eth_call was used to execute a message call the baseFeePerGas used to run the transaction was incorrect. This would cause the BASEFEE opcode to be incorrect, which could result in invalid results for contracts that use this opcode. The fee was also used to calculate the transaction's gas cost, which can also affect the way the transaction is run within the EVM. Now, the blockNumber passed in when calling eth_call is used to fetch that block's baseFeePerGas, which is in turn used to calculate the transaction's cost.

back to fixes

fix: update leveldb-related packages (#1989)

Updated leveldb and related packages to the latest versions. This fix should bring native compatibility to more systems.

back to fixes

back to top


Miscellaneous

  • docs: add docs for docker to readme (#1972)
  • chore: increase test timeout for slow CI (#1992)
  • chore: remove canary, add rc to release branches (#2037)
  • fix: update README to be for rc (#2041)

back to top


Known Issues

  • evm_setAccountNonce is race-conditiony (#1646)
  • --miner.callGasLimit implementation is wrong (#1645)
  • We don't return a proper pending block (#772)
  • Forking doesn't work in the browser
  • Uncles aren't fully supported when forking
  • Forking may fail in weird and unexpected ways. We need to "error better" here
  • Node.js v12 outputs a µWS warning in the console
  • Node.js v12 doesn't handle memory as well as 14+ and may crash computing very large debug_traceTransaction results
  • Our bundle size is larger than ideal

back to top


Future Plans

  • Update the eth_maxPriorityFeePerGas RPC method to return as Geth does, eth_gasPrice - baseFeePerGas.
  • Add support for the eth_feeHistory RPC method.
  • Support for enabling eligible draft EIPs before they are finalized or considered for inclusion in a hardfork.
  • New hardfork support well in advance of the hardfork launch.
  • Add an eth_createAccessList method.
  • Track test performance metrics over time.
  • Track real world Ganache usage (opt-in and anonymized) to better tune performance and drive bug fixes and feature development.
  • Track test coverage.
  • Document how to use Ganache in the browser, and what limits it has.
  • evm_mine will return the new blocks instead of just 0x0.
  • We've laid the groundwork for additional performance improvements. We expect to see an additional 2-5x speed up for typical testing work loads in the near future.
  • Add new evm_setCode and evm_setStorageAt RPC methods.
  • Make evm_snapshot ids globally unique (unpredictable instead of a counter).
  • Support eth_getRawTransactionByHash RPC method.
  • Support debug_accountAt RPC method.
  • Allow "mining" to be disabled on start up.
  • Set CLI options via config file, package.json, or ENV vars.
  • "Flavor" Plugins: We're building support for Layer 2 plugins into Ganache so we can start up and manage other chains. e.g., The ganache filecoin command will look for the @ganache/filecoin package and start up a Filecoin and IPFS server.
  • Multi-chain configurations: you'll be able to start up your project's entire blockchain "ecosystem" from a single ganache command: e.g., ganache --flavor ethereum --flavor filecoin --flavor optimism.
    • this is where defining your CLI options via JSON config will come in very handy!
  • Create a CLI interactive/RELP mode.
  • Enable a CLI daemon mode.

Open new issues (or join our team) to influence what we gets implemented and prioritized.

back to top


💖 The Truffle Team