This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
v7.0.0-alpha.2 #1556
davidmurdoch
announced in
Releases
v7.0.0-alpha.2
#1556
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Highlights
Breaking Changes
Fixes
New Features
Known Issues
Future Plans
This release is the third alpha release of the new and improved Ganache v7.0.0. You'll definitely want to catch up on the previous changes, if you haven't already, before reading on!
Thanks to everyone who tried out our previous alpha releases and provided feedback! You have been immensely helpful!
And special thanks to contributors, mentors, and reviewers: @MicaiahReid, @gnidan, @cds-amal, and @haltman-at. And special thanks to our community members for reporting and commenting on issues fixed by this release: @aliveli186, @winksaville, @anvacaru, @wilwade, and @moda20!
Not: this is still an alpha release; even these 7.0.0 release notes are "alpha" and the information here is likely incomplete. There will be bugs and kinks to work out before we ship things off to
beta
,rc
, then finally tolatest
. You absolutely should use this alpha release, but only to try it out and let us know where it breaks for you!In other words: 🔥🐉 Here be dragons 🔥🐉️
To install globally run:
We've changed 131 files across 18 merged pull requests, tallying 37,511 additions and 35,611 deletions, since our last release.
These changes bring:
debug_traceTransaction
, by over 30x!back to top
We've dropped support for Node.js v10 (and added v17) (#1519)
Node.js v10 reached its end of life in April of this year, and Truffle dropped support for it in October. Ganache is following suit in the v7.0.0 release.
This will simplify Ganache development and will result in smaller bundle sizes as we no longer need to transpile features available natively in Node v12 for Node v10.
back to top
So. Many. Fixes.
server.listen
baseFeePerGas
on pre-London blocksdebug_traceTransaction
responsesFixes various issues with EIP-1559 transactions (#1307)
Previously, a transaction's
effectiveGasPrice
was not stored in Ganache's database because, before London, this value was easy to calculate. After the introduction of the London hardfork defaulting to the previousgasPrice
would cause a type-2 transaction to have a differenteffectiveGasPrice
before and after saving to Ganache's database. Now, we store theeffectiveGasPrice
in the database so the correct gas price for each transaction type can be retrieved when fetching the transaction.We also use the EIP-1559 transaction's gas fields for
eth_call
and accurately upgrade legacy type-0 transactions to type-2 transactions when certain data is omitted from the transaction.back to fixes
Prevents a replaced, future-nonce transaction from being run alongside its replacement transaction (#1237)
It is possible to send a future-nonce transaction². You may also want to replace that future-nonce transaction. Before this fix, both the original and replacement future-nonce transaction would be executed. 😬
Previously, when an immediately executable transaction was received we'd check:
We now perform all of those same checks against the future-nonce transactions in the transaction pool, not just the executable transactions.
back to fixes
Ganache now works in the browser on Firefox, Microsoft Edge, and Safari (#1247)
🎉 YAY 🎉
back to fixes
Handle initialization errors and handle fallback rejections for
server.listen
(#1227)When you run
const server = Ganache.server()
Ganache immediately begins initializing internal components, eagerly running dozens of asynchronous operations. But any one of these async operations could fail. Previously these failures would appear as an Unhandled Rejection.We now handle these by delaying the exception until the call to
server.listen
is made. If the call toGanache.server
resulted in any initialization exceptions their rejection will be deferred until the callback or fulfillment of thislisten
call.back to fixes
Stop returning
baseFeePerGas
on pre-London blocks (#1541)When forking, a user may request a fork-point block that is before the London hardfork while London is actually activated in their Ganache instance. In Ganache v7 alpha.1, we'd return the block's
baseFeePerGas
before that field actually existed on mainnet because London was technically enabled in Ganache. Now, we keep better track whether thebaseFeePerGas
should be included or not.back to fixes
Suppress annoying Windows startup warnings by using our prebuilt bigint-buffer fork (#1414)
On some platforms Ganache would issue a warning about falling back to a pure JS version of this library due to compilation not being possible. We now pre-compile the library for all supported platforms.
back to fixes
Support 1+ GB
debug_traceTransaction
responses (1339)Ganache can now run
debug_traceTransaction
on Ethereum's largest most complex transactions! Here's a shallow-dive on how we solved this:The Problem
Node.js limits the size of strings to 256MB - 1GB, depending on the Node version, and larger transaction traces often exceed 1GB in size. You may think, "Simple! Just transmit the data in an
ArrayBuffer
instead of usingJSON.stringify
". But then you'd spend a whole day writing code to convert your JavaScript object directly to a Buffer only to find out that node limits the size of Buffers to about 2 GB (depending on the node version) and you are back to where you started! A trace of the recent Cream Finance hack is over 10GB!The Solution
HTTP Packets and WebSocket Fragments! Now, whenever Ganache detects a large
debug_traceTransaction
result (currently hardcoded to 100000 steps) it will start converting the trace results directly from their JavaScript object representation to UTF-8 encoded Buffers of each individual piece of data, skipping theJSON.stringify
ication step all together.While our implementation is not yet an optimal solution, as we sometimes transmit single byte packets (over HTTP) or fragments (over WebSockets¹), and don't handle backpressure, it allows us to transmit arbitrarily large traces limited only by the memory allotted to the node process.
Of course, the receiving end of the trace needs to be able to handle the large amounts of data flowing in, and Truffle doesn't yet support this (see #4381 for work being done there).
back to fixes
back to top
eth_signTypedData_v4
Much Faster Forking Performance (#1248, #1339)
We've added two new caching layers to Ganache's forking feature that greatly improve performance, making Ganache v7 alpha.2 up to 30x times faster than Ganache v7 alpha.1!
In Ganache v7-alpha.1
debug_traceTransaction
for transaction 0xa45166af02ee01ce2817b5a60862d758b4eae9449ad3f82f44c93818ea26e003 would previously take about 2 ½ minutes to compile and send.With a warm cache this will now take about 3 ½ seconds! ~30x faster!
In-memory LRU cache
The first caching layer is an in-memory LRU cache. This cache will store previous forking request results in memory so successive calls during the same Ganache session don't have to make the expensive network request to fetch the data again.
Persistent cache
The second caching layer is the more interesting cache and utilizes @truffle/db's network algorithm to efficiently store and retrieve requests and their responses to a persistent disk-backed database.
What this enables is for Ganache to differentiate blockchain networks based not on their chainId or networkId, but the contents of historical blocks.
You can always delete this persistent cache by running Ganache with the
--fork.deleteCache
flag. To disable both caches use the--fork.disableCache
flag.back to features
Ganache Docker Images (#1318)
Our Docker image will stay up-to-date with our releases! To use them, simply run:
$ docker run --publish 8545:8545 trufflesuite/ganache:alpha
To pass options through to Ganache add the arguments to the run command:
back to features
Support for
eth_signTypedData_v4
(#1231)We now support
eth_signTypedData_v4
, which can be used to sign typed data. For more information on this signing method, see MetaMask's helpful guide.back to features
back to top
eth_call
is not behaving as it should in alpha version (#1547)eth_call
should return JSON-RPC error on revert (#1496)asyncRequestProcessing
doesn't default totrue
like it is supposed to (#1532)web_sha3
should accept a hex-encoded string (#1375)chainId
shouldn't match the remote chain. We really should use a differentchainId
than the remote, but still be able to contextualize past transactions with their originalchainId
(#628)back to top
eth_createAccessList
method.evm_mine
will return the new blocks instead of just0x0
.evm_setCode
andevm_setStorageAt
RPC methods.evm_snapshot
ids globally unique (unpredictable instead of a counter).eth_getRawTransactionByHash
RPC method.debug_accountAt
RPC method.ganache filecoin
command will look for the@ganache/filecoin
package and start up a Filecoin and IPFS server.ganache --flavor ethereum --flavor filecoin --flavor optimism
.ganache --fork mainnet
to fork mainnet via your own Infura account.Open new issues (or join our team) to influence what we gets implemented and prioritized.
back to top
1. Thanks to @alexhultman for his work on the uWebsockets.js library!
2. Meaning: a transaction that will not be immediately executable but will stay in the transaction pool until the
from
account's nonce catches up with that of the transaction💖 The Truffle Team
This discussion was created from the release v7.0.0-alpha.2.
Beta Was this translation helpful? Give feedback.
All reactions