Ganache is an Ethereum simulator that makes developing Ethereum applications faster, easier, and safer

Overview

Ganache

A tool for creating a local blockchain for fast Ethereum development.

FeaturesGetting StartedDocumentationCommunityDockerContributingRelated


Features

Ganache is an Ethereum simulator that makes developing Ethereum applications faster, easier, and safer. It includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze.

  • Zero-config Mainnet Forking
  • Fork any Ethereum network without waiting to sync
  • Ethereum JSON-RPC support
  • Snapshot/revert state
  • Mine blocks instantly, on demand, or at an interval
  • Fast-forward time
  • Impersonate any account (no private keys required!)
  • Listens for JSON-RPC 2.0 requests over HTTP/WebSockets
  • Programmatic use in Node.js
  • Pending Transactions

Getting Started

Ganache can be used from the command line, programmatically via Node.js, or in the browser.

Command line use

You must first install Node.js >= v10.13.0 and npm >= 6.4.1.

To install Ganache globally, run:

$ npm install ganache --global

In case youe're upgrading from a previous version of Ganache, we've also written up this handy guide on how to upgrade/install Ganache and to document all breaking changes to look out for.

Once installed globally, you can start ganache right from your command line:

$ ganache
Ganache CLI v6.12.1 (ganache-core: 2.13.1)

Available Accounts
==================
(0) 0xe261e26aECcE52b3788Fac9625896FFbc6bb4424 (100 ETH)
(1) 0xcE16e8eb8F4BF2E65BA9536C07E305b912BAFaCF (100 ETH)
(2) 0x02f1c4C93AFEd946Cce5Ad7D34354A150bEfCFcF (100 ETH)
(3) 0x0B75F0b70076Fab3F18F94700Ecaf3B00fE528E7 (100 ETH)
(4) 0x7194d1F1d43c2c58302BB61a224D41B649e65C93 (100 ETH)
(5) 0xC9A2d92c5913eDEAd9a7C936C96631F0F2241063 (100 ETH)
(6) 0xD79BcDE5Cb11cECD1dfC6685B65690bE5b6a611e (100 ETH)
(7) 0xb6D080353f40dEcA2E67108087c356d3A1AfcD64 (100 ETH)
(8) 0x31A064DeeaD74DE7B9453beB4F780416D8859d3b (100 ETH)
(9) 0x37524a360a40C682F201Fb011DB7bbC8c8A247c6 (100 ETH)

Private Keys
==================
(0) 0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6
(1) 0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628
(2) 0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814
(3) 0x941536648ac10d5734973e94df413c17809d6cc5e24cd11e947e685acfbd12ae
(4) 0x5829cf333ef66b6bdd34950f096cb24e06ef041c5f63e577b4f3362309125863
(5) 0x8fc4bffe2b40b2b7db7fd937736c4575a0925511d7a0a2dfc3274e8c17b41d20
(6) 0xb6c10e2baaeba1fa4a8b73644db4f28f4bf0912cceb6e8959f73bb423c33bd84
(7) 0xfe8875acb38f684b2025d5472445b8e4745705a9e7adc9b0485a05df790df700
(8) 0xbdc6e0a69f2921a78e9af930111334a41d3fab44653c8de0775572c526feea2d
(9) 0x3e215c3d2a59626a669ed04ec1700f36c05c9b216e592f58bbfd3d8aa6ea25f9

HD Wallet
==================
Mnemonic:      candy maple velvet cake sugar cream honey rich smooth crumble sweet treat
Base HD Path:  m/44'/60'/0'/0/{account_index}

Default Gas Price
==================
20000000000

Gas Limit
==================
6721975

Call Gas Limit
==================
9007199254740991

Listening on 127.0.0.1:8545

To install Ganache into an npm project, run:

$ npm install ganache

You can then add Ganache to your package.json scripts:

"scripts": {
  "ganache": "ganache --wallet.seed myCustomSeed"
}

See Documentation for additional command line options.

Then start it:

$ npm run ganache

Programmatic use

You can use Ganache programmatically from Node.js. Install Ganache into your npm package:

$ npm install ganache

Then you can use ganache as an EIP-1193 provider only, an EIP-1193 provider and JSON-RPC web server, as a Web3 provider, or an ethers provider.

As an EIP-1193 provider only:

const ganache = require("ganache");

const options = {};
const provider = ganache.provider(options);
const accounts = await provider.request({ method: "eth_accounts", params: [] });

As an EIP-1193 provider and JSON-RPC web server:

{ if (err) throw err; console.log(`ganache listening on port ${PORT}...`); const provider = server.provider; const accounts = await provider.request({ method: "eth_accounts", params: [] }); });">
const ganache = require("ganache");

const options = {};
const server = ganache.server(options);
const PORT = 8545;
server.listen(PORT, err => {
  if (err) throw err;

  console.log(`ganache listening on port ${PORT}...`);
  const provider = server.provider;
  const accounts = await provider.request({
    method: "eth_accounts",
    params: []
  });
});

As a web3.js provider:

To use ganache as a Web3 provider:

const Web3 = require("web3");
const ganache = require("ganache");

const web3 = new Web3(ganache.provider());

NOTE: depending on your web3 version, you may need to set a number of confirmation blocks

const web3 = new Web3(ganache.provider(), null, { transactionConfirmationBlocks: 1 });

As an ethers.js provider:

const ganache = require("ganache");

const provider = new ethers.providers.Web3Provider(ganache.provider());

Browser Use

You can also use Ganache in the browser by adding the following script to your HTML:

">
<script src="https://cdn.jsdelivr.net/npm/ganache@{VERSION}/dist/web/ganache.min.js">script>

NOTE: the {VERSION} in the above path needs to be replaced with a version number or tag that is listed in npm.

From there, Ganache is available in your browser for use:

const options = {};
const provider = Ganache.provider(options);

NOTE: currently forking does not work in the browser, but we plan to add support in the future.

Documentation

New interactive RPC documentation coming soon! In the meantime, check out our Ethereum JSON-RPC documentation.

Startup Options

The startup options are grouped in the chain, database, fork, logging, miner, and wallet namespaces, and should be used as such on startup, i.e.

ganache --namespace.option="value"

for CLI use, and

const options = { namespace: { option: "value"}};
const provider = ganache.provider(options);

for programmatic use.

The following options are listed for command line use, but can also be used when running Ganache programatically in your project.

, , can be specified multiple times. Note that private keys are 64 characters long and must be entered as an 0x-prefixed hex string. Balance can either be input as an integer, or as a 0x-prefixed hex string with either form specifying the initial balance in wei. deprecated aliases: --account [array] -a, --wallet.totalAccounts Number of accounts to generate at startup. deprecated aliases: --accounts [number] [default: 10] -d, --wallet.deterministic Use pre-defined, deterministic seed. deprecated aliases: --deterministic [boolean] [default: false] -s, --wallet.seed Seed to use to generate a mnemonic. deprecated aliases: --seed [string] [default: Random value, unless wallet.deterministic is specified] -m, --wallet.mnemonic Use a specific HD wallet mnemonic to generate initial addresses. deprecated aliases: --mnemonic [string] [default: Generated from wallet.seed] -u, --wallet.unlockedAccounts Array of addresses or address indexes specifying which accounts should be unlocked. deprecated aliases: --unlock [array] -n, --wallet.lock Lock available accounts by default (good for third party transaction signing). deprecated aliases: --secure, --lock [boolean] [default: false] --wallet.passphrase Passphrase to use when locking accounts. deprecated aliases: --passphrase [string] --wallet.accountKeysPath Specifies a file to save accounts and private keys to, for testing. deprecated aliases: --account_keys_path, --acctKeys [string] -e, --wallet.defaultBalance The default account balance, specified in ether. deprecated aliases: --defaultBalanceEther [number] [default: 1000] --wallet.hdPath The hierarchical deterministic path to use when generating accounts. [string] [default: m,44',60',0',0] Fork: -f, --fork.url Fork from another currently running Ethereum client at a given block. Input should be the URL of the node, e.g. "http://localhost:1337". You can optionally specify the block to fork from using an @ sign: "http://localhost:1337@8675309". You can specify Basic Authentication credentials in the URL as well. e.g., "wss://user:[email protected]/". If you need to use an Infura Project Secret, you would use it like this: "wss://:{YOUR-PROJECT-SECRET}@mainnet.infura.com/..." Alternatively, you can use the fork.username and fork.password options. deprecated aliases: --fork --fork.network A network name to fork from; uses Infura's archive nodes. Use the shorthand command ganache --fork to automatically fork from Mainnet at the latest block. [choices: "mainnet", "ropsten", "kovan", "rinkeby", "goerli", "görli"] --fork.blockNumber Block number the provider should fork from. [default: Latest block number] --fork.preLatestConfirmations When the fork.blockNumber is set to "latest" (default), the number of blocks before the remote node's "latest" block to fork from. [number] [default: 5] --fork.username Username to use for Basic Authentication. Does not require setting fork.password. When combined with fork.password, is shorthand for fork: { headers: { "Authorization": "Basic {ENCODED-BASIC-HEADER}" } } If the fork.headers option specifies an "Authorization" header, it will be be inserted after this Basic token. --fork.password Password to use for Basic Authentication. Does not require setting fork.username. When combined with fork.username, is shorthand for fork: { headers: { "Authorization": "Basic {ENCODED-BASIC-HEADER}" } } If the fork.headers option specifies an "Authorization" header, it will be be inserted after this Basic token. --fork.jwt Encoded JSON Web Token (JWT) used for authenticating to some servers. Shorthand for fork: { headers: { "Authorization": "Bearer {YOUR-ENCODED-JWT}" } } If the fork.headers option specifies an "Authorization" header, it will be be inserted after the JWT Bearer token. --fork.userAgent The User-Agent header sent to the fork on each request. Sent as Api-User-Agent when used in the browser. Will be overridden by a "User-Agent" defined in the fork.headers option, if provided. [default: Ganache/7.0.0-beta.0 (https://www.trufflesuite.com/ganache; ganache trufflesuite.com)] --fork.origin The Origin header sent to the fork on each request. Ignored in the browser. Will be overridden by an "Origin" value defined in the fork.headers option, if provided. --fork.headers Headers to supply on each request to the forked provider. Headers set here override headers set by other options, unless otherwise specified. Defaults to: ["User-Agent: Ganache/VERSION (https://www.trufflesuite.com/ganache; ganache trufflesuite.com)"] [array] --fork.requestsPerSecond Restrict the number of requests per second sent to the fork provider. 0 means no limit is applied. [number] [default: 0] --fork.disableCache Disables caching of all forking requests. [boolean] [default: false] --fork.deleteCache Deletes the persistent cache before starting. [boolean] [default: false] Server: --server.ws Enable a websocket server. [boolean] [default: true] --server.wsBinary Whether or not websockets should response with binary data (ArrayBuffers) or strings. [choices: "true", "false", "auto"] [default: auto] --server.rpcEndpoint Defines the endpoint route the HTTP and WebSocket servers will listen on. [default: "/" (Ethereum), "/rpc/v0" (Filecoin)] -h, --server.host Hostname to listen on. deprecated aliases: --host, --hostname [string] [default: "127.0.0.1"] -p, --server.port, --port Port to listen on. deprecated aliases: --port [number] [default: 8545] ">
Chain:
  --chain.allowUnlimitedContractSize    Allows unlimited contract sizes while debugging. Setting this to true
                                        will cause ganache to behave differently than production environments.
                                                                                    [boolean] [default: false]

  --chain.asyncRequestProcessing        When set to false only one request will be processed at a time.
                                                                                     [boolean] [default: true]

  --chain.chainId                       The currently configured chain id.            [number] [default: 1337]

  -i, --chain.networkId                 The id of the network returned by the RPC method net_version.
                                        deprecated aliases: --networkId
                                                            [number] [default: System time at process start or
                                                               Network ID of forked blockchain if configured.]

  -t, --chain.time                      Date that the first block should start.
                                        deprecated aliases: --time                                    [number]

  -k, --chain.hardfork                  Set the hardfork rules for the EVM.
                                        deprecated aliases: --hardfork
                                               [string] [choices: "constantinople", "byzantium", "petersburg",
                                                 "istanbul", "muirGlacier", "berlin", "london","arrowGlacier"]
                                                                                             [default: london]

  --chain.vmErrorsOnRPCResponse         Whether to report runtime errors from EVM code as RPC errors.
                                                                                    [boolean] [default: false]


Database:
  --database.dbPath                     Specify a path to a directory to save the chain database.
                                        deprecated aliases: --db, --db_path                           [string]

Logging:
  --logging.debug                       Set to true to log EVM opcodes.             [boolean] [default: false]

  -q, --logging.quiet                   Set to true to disable logging.
                                        deprecated aliases: --quiet                 [boolean] [default: false]

  -v, --logging.verbose                 Set to true to log all RPC requests and responses.
                                        deprecated aliases: --verbose               [boolean] [default: false]


Miner:
  -b, --miner.blockTime                 Sets the blockTime in seconds for automatic mining. A blockTime of 0
                                        enables "instamine mode", where new executable transactions will be
                                        mined instantly.
                                        deprecated aliases: --blockTime                  [number] [default: 0]

  -g, --miner.defaultGasPrice           Sets the default gas price in WEI for transactions if not otherwise
                                        specified.
                                        deprecated aliases: --gasPrice          [string] [default: 0x77359400]

  -l, --miner.blockGasLimit             Sets the block gas limit in WEI.
                                        deprecated aliases: --gasLimit            [string] [default: 0xb71b00]

  --miner.defaultTransactionGasLimit    Sets the default transaction gas limit in WEI. Set to "estimate" to
                                        use an estimate (slows down transaction execution by 40%+).
                                                                                   [string] [default: 0x15f90]

  --miner.difficulty                    Sets the block difficulty.                     [string] [default: 0x1]

  --miner.callGasLimit                  Sets the transaction gas limit in WEI for eth_call and eth_estimateGas
                                        calls.
                                                                          [string] [default: 0x1fffffffffffff]
  --miner.instamine                     Set the instamine mode to either "eager" (default) or "strict". In
                                        "eager" mode a transaction will be included in a block before its hash
                                        is returned to the caller. In "strict" mode a transaction's hash is
                                        returned to the caller before the transaction is included in a block.
                                        This value has no effect if `blockTime` is *not* `0` (the default).`
                                                      [string] [choices: "eager", "strict"] [default: "eager"]

  --miner.coinbase                      Sets the address where mining rewards will go.
                                                         [default: 0x0000000000000000000000000000000000000000]

  --miner.extraData                     Set the extraData block header field a miner can include.
                                                                                        [string] [default: 0x]

  --miner.priceBump                     Minimum price bump percentage needed to replace a transaction that
                                        already exists in the transaction pool.         [string] [default: 10]


Wallet:
  --wallet.accounts                     Account data in the form 
      
       ,
       
        , can be
       
      
                                        specified multiple times. Note that private keys are 64 characters
                                        long and must be entered as an 0x-prefixed hex string. Balance can
                                        either be input as an integer, or as a 0x-prefixed hex string with
                                        either form specifying the initial balance in wei.
                                        deprecated aliases: --account                                  [array]

  -a, --wallet.totalAccounts            Number of accounts to generate at startup.
                                        deprecated aliases: --accounts                  [number] [default: 10]

  -d, --wallet.deterministic            Use pre-defined, deterministic seed.
                                        deprecated aliases: --deterministic         [boolean] [default: false]

  -s, --wallet.seed                     Seed to use to generate a mnemonic.
                                        deprecated aliases: --seed
                                                                                                      [string]
                                             [default: Random value, unless wallet.deterministic is specified]

  -m, --wallet.mnemonic                 Use a specific HD wallet mnemonic to generate initial addresses.
                                        deprecated aliases: --mnemonic                                [string]
                                                                         [default: Generated from wallet.seed]

  -u, --wallet.unlockedAccounts         Array of addresses or address indexes specifying which accounts should
                                        be unlocked.
                                        deprecated aliases: --unlock                                   [array]

  -n, --wallet.lock                     Lock available accounts by default (good for third party transaction
                                        signing).
                                        deprecated aliases: --secure, --lock        [boolean] [default: false]

  --wallet.passphrase                   Passphrase to use when locking accounts.
                                        deprecated aliases: --passphrase                              [string]

  --wallet.accountKeysPath              Specifies a file to save accounts and private keys to, for testing.
                                        deprecated aliases: --account_keys_path, --acctKeys           [string]

  -e, --wallet.defaultBalance           The default account balance, specified in ether.
                                        deprecated aliases: --defaultBalanceEther     [number] [default: 1000]

  --wallet.hdPath                       The hierarchical deterministic path to use when generating accounts.
                                                                            [string] [default: m,44',60',0',0]


Fork:
  -f, --fork.url                        Fork from another currently running Ethereum client at a given block.
                                        Input should be the URL of the node, e.g. "http://localhost:1337". You
                                        can optionally specify the block to fork from using an @ sign:
                                        "http://localhost:1337@8675309".

                                        You can specify Basic Authentication credentials in the URL as well.
                                        e.g., "wss://user:[email protected]/". If you need to use an Infura
                                        Project Secret, you would use it like this:
                                        "wss://:{YOUR-PROJECT-SECRET}@mainnet.infura.com/..."

                                        Alternatively, you can use the fork.username and fork.password
                                        options.
                                        deprecated aliases: --fork

  --fork.network                        A network name to fork from; uses Infura's archive nodes.

                                        Use the shorthand command ganache --fork to automatically fork from
                                        Mainnet at the latest block.
                                        [choices: "mainnet", "ropsten", "kovan", "rinkeby", "goerli", "görli"]

  --fork.blockNumber                    Block number the provider should fork from.
                                                                                [default: Latest block number]

  --fork.preLatestConfirmations         When the fork.blockNumber is set to "latest" (default), the number of
                                        blocks before the remote node's "latest" block to fork from.
                                                                                         [number] [default: 5]

  --fork.username                       Username to use for Basic Authentication. Does not require setting
                                        fork.password.

                                        When combined with fork.password, is shorthand for fork: { headers: {
                                        "Authorization": "Basic {ENCODED-BASIC-HEADER}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after this Basic token.

  --fork.password                       Password to use for Basic Authentication. Does not require setting
                                        fork.username.

                                        When combined with fork.username, is shorthand for fork: { headers: {
                                        "Authorization": "Basic {ENCODED-BASIC-HEADER}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after this Basic token.

  --fork.jwt                            Encoded JSON Web Token (JWT) used for authenticating to some servers.

                                        Shorthand for fork:
                                          { headers: { "Authorization": "Bearer {YOUR-ENCODED-JWT}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after the JWT Bearer token.

  --fork.userAgent                      The User-Agent header sent to the fork on each request.

                                        Sent as Api-User-Agent when used in the browser.

                                        Will be overridden by a "User-Agent" defined in the fork.headers
                                        option, if provided.

                                                                                [default: Ganache/7.0.0-beta.0
                                          (https://www.trufflesuite.com/ganache; ganache
      
       trufflesuite.com)]
      

  --fork.origin                         The Origin header sent to the fork on each request.

                                        Ignored in the browser.

                                        Will be overridden by an "Origin" value defined in the fork.headers
                                        option, if provided.

  --fork.headers                        Headers to supply on each request to the forked provider.

                                        Headers set here override headers set by other options, unless
                                        otherwise specified.

                                                                    Defaults to: ["User-Agent: Ganache/VERSION
                                         (https://www.trufflesuite.com/ganache; ganache
      
       trufflesuite.com)"]
      
                                                                                                       [array]

  --fork.requestsPerSecond              Restrict the number of requests per second sent to the fork provider.
                                        0 means no limit is applied.                     [number] [default: 0]

  --fork.disableCache                   Disables caching of all forking requests.   [boolean] [default: false]

  --fork.deleteCache                    Deletes the persistent cache before starting.
                                                                                    [boolean] [default: false]


Server:
  --server.ws                           Enable a websocket server.                   [boolean] [default: true]

  --server.wsBinary                     Whether or not websockets should response with binary data
                                        (ArrayBuffers) or strings.
                                                                            [choices: "true", "false", "auto"]
                                                                                               [default: auto]

  --server.rpcEndpoint                  Defines the endpoint route the HTTP and WebSocket servers will listen
                                        on.
                                                               [default: "/" (Ethereum), "/rpc/v0" (Filecoin)]

  -h, --server.host                     Hostname to listen on.
                                        deprecated aliases: --host, --hostname
                                                                               [string] [default: "127.0.0.1"]

  -p, --server.port, --port             Port to listen on.
                                        deprecated aliases: --port
                                                                                      [number] [default: 8545]

Ganache Provider Events

In addition to EIP-1193's "message" event and the legacy "data" event, Ganache emits 3 additional events: "ganache:vm:tx:before", "ganache:vm:tx:step", and "ganache:vm:tx:after".

These events can be used to observe the lifecycle of any transaction executed via *sendTransaction, eth_call, debug_traceTransaction, or debug_storageRangeAt.

These share the event paradigm that Truffle uses, but without any of the wildcard handling, i.e., no "vm:*" support (for now).

Each of these events will emit a context object which is a unique object that can be used to identify a transaction over the course of its lifecycle. For example:

{ contexts.set(event.context, []); }); provider.on("ganache:vm:tx:step", (event: StepEvent) => { contexts.get(event.context).push(event.data); }); provider.on("ganache:vm:tx:after", (event: { context: {} }) => { doAThingWithThisTransactionsSteps(contexts.get(event.context)); contexts.delete(event.context); });">
interface StepEvent {
  account: {
    nonce: bigint;
    balance: bigint;
    stateRoot: Buffer;
    codeHash: Buffer;
  };
  address: Buffer;
  codeAddress: Buffer;
  depth: number;
  gasLeft: bigint;
  gasRefund: bigint;
  memory: Buffer;
  memoryWordCount: bigint;
  opcode: {
    name: string;
    fee: number;
  };
  pc: number;
  returnStack: Buffer[];
  stack: Buffer[];
}

const contexts = new Map();
provider.on("ganache:vm:tx:before", (event: { context: {} }) => {
  contexts.set(event.context, []);
});
provider.on("ganache:vm:tx:step", (event: StepEvent) => {
  contexts.get(event.context).push(event.data);
});
provider.on("ganache:vm:tx:after", (event: { context: {} }) => {
  doAThingWithThisTransactionsSteps(contexts.get(event.context));
  contexts.delete(event.context);
});

The reason this context is necessary is that Ganache may run multiple transactions simultaneously, so "ganache:vm:tx:step" events from different transactions could be intermingled.

The above events will be emitted for eth_call, *sendTransaction, debug_traceTransaction, and debug_storageRangeAt.

Currently, we do not await the event listener's return value, however, we'll likely enable this in the future.

Community

Docker

The simplest way to get started with the Docker image:

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest

To pass options to Ganache through Docker simply add the arguments to the end of the run command, e.g.,

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest --accounts 10 --debug
                                                                    ^^^^^^^^^^^^^^^^^^^^^

The Docker container adds an environment variable DOCKER=true; when this variable is set to true (case insensitive), Ganache uses a default hostname IP of 0.0.0.0 instead of the normal default 127.0.0.1. You can still specify a custom hostname however:

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest --host XXX.XXX.XXX.XXX
                                                                    ^^^^^^^^^^^^^^^^^^^^^^

To build and run the Docker container from source:

$ git clone https://github.com/trufflesuite/ganache.git && cd ganache

then:

$ docker build --tag trufflesuite/ganache --file ./src/packages/ganache/Dockerfile .
$ docker run --publish 8545:8545 trufflesuite/ganache

Contributing

See CONTRIBUTING.md for our guide to contributing to Ganache.

Related



Truffle

Comments
  • Ganache does not return a detailed exception

    Ganache does not return a detailed exception

    Hi! I found an error that Ganache does not return a detailed exception when calling contract function.

    I use Ganache in Docker trufflesuite/ganache:v7.0.4

    And Run it how:

    version: '3.7'
    
    services:
      ganache:
        image: trufflesuite/ganache:v7.0.4
        restart: always
        volumes:
          - ./blockchain-data:/blockchain-data
        env_file:
          - .env
        ports:
          - "8545:8545"
        command:
          --database.dbPath=/blockchain-data --miner.blockGasLimit=0x3B9ACA00 --port 8545
          --account="0x${TEST_CLOUD_ACCOUNT_PRIVATE_KEY_1},1000000000000000000000000000"
          --account="0x${TEST_CLOUD_ACCOUNT_PRIVATE_KEY_2},1000000000000000000000000000"
          --account="0x${TEST_CLOUD_ACCOUNT_PRIVATE_KEY_3},1000000000000000000000000000"
    

    Everything works, but does not return a detailed exception error when calling the contract.

    What do I get instead of getting a Time Limit exception:

    AssertionError: Expected transaction to be reverted with Time limit, but other exception was thrown: Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (error={"name":"ProviderError","code":-32000,"_isProviderError":true,"data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a54696d65206c696d697400000000000000000000000000000000000000000000"}, data="0x", code=CALL_EXCEPTION, version=providers/5.6.4)

    P.s in old package trufflesuite/ganache-cli everything works fine and I get a detailed error!

    opened by dminglv 29
  • Transaction status is 1, but last opcode is REVERT

    Transaction status is 1, but last opcode is REVERT

    I have a project that uses brownie and ganache-cli --fork against a geth node. (Geth is running according to these steps).

    A few of my tests check the return_value of my transactions. Most succeed, but one has no return value despite not reverting.

    • I asked about this on gitter: [X]
    • Link to my question on gitter: https://gitter.im/ConsenSys/truffle?at=5ed03f164412600ccd7497f0

    Expected Behavior

    A transaction with a status of 1 should have a return value.

    Current Behavior

    • eth_getTransactionReceipt.status is 1
    • debug_traceTransaction final instruction is REVERT

    Steps to Reproduce

    1. git clone https://github.com/SatoshiAndKin/argobytes-contracts-brownie (at ecf07c4)
    2. Follow the readme
    3. ./scripts/test.sh tests/test_uniswap_v1_arbitrage.py -I
    ./scripts/test.sh tests/test_uniswap_v1_arbitrage.py -I
    + [ -z /home/ski/code/argobytes-contracts-brownie/venv ]
    + brownie test --network mainnet-fork tests/test_uniswap_v1_arbitrage.py -I
    Brownie v1.8.9 - Python development framework for Ethereum
    
    ===================================================================================== test session starts =====================================================================================
    platform linux -- Python 3.8.2, pytest-5.4.2, py-1.8.1, pluggy-0.13.1
    rootdir: /home/ski/code/argobytes-contracts-brownie
    plugins: eth-brownie-1.8.9, forked-1.1.3, web3-5.10.0, hypothesis-5.15.0, xdist-1.32.0
    collecting ... Attached to local RPC client listening at '127.0.0.1:8575'...
    collected 1 item                                                                                                                                                                              
    
    tests/test_uniswap_v1_arbitrage.py F
    address_zero = '0x0000000000000000000000000000000000000000', argobytes_atomic_trade = <ArgobytesAtomicTrade Contract '0xF024fE5EF0b1Bf88caf9B1222E49d1A5CC312a71'>
    dai_erc20 = <Dai Contract '0x6B175474E89094C44Da98b954EedeAC495271d0F'>, argobytes_owned_vault = <ArgobytesOwnedVault Contract '0xb66F46436fa703237A9Fd26f4DA63919D3cc943D'>
    example_action = <ExampleAction Contract '0xDb43EFA90874d427e38Ff1e5F08572c0a2619930'>, chi = <ChiToken Contract '0x0000000000004946c0e9F43F4Dee607b0eF1fA1c'>
    uniswap_v1_factory = <Vyper_contract Contract '0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95'>, uniswap_v1_action = <UniswapV1Action Contract '0x006ba56B025c63aE46c510a904422945F2389d6F'>
    usdc_erc20 = <FiatTokenProxy Contract '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'>
    
        def test_uniswap_arbitrage(address_zero, argobytes_atomic_trade, dai_erc20, argobytes_owned_vault, example_action, chi, uniswap_v1_factory, uniswap_v1_action, usdc_erc20):
            assert argobytes_owned_vault.balance() == 0
            assert example_action.balance() == 0
        
            value = 1e18
        
            # send some ETH into the vault
            accounts[0].transfer(argobytes_owned_vault, value)
            # send some ETH into the sweep contract to simulate arbitrage profits
            accounts[0].transfer(example_action, value)
        
            # mint some gas token
            # TODO: how much should we make?
            argobytes_owned_vault.mintGasToken(chi, 26, {"from": accounts[0]})
        
            # make sure balances match what we expect
            assert argobytes_owned_vault.balance() == value
            assert example_action.balance() == value
        
            usdc_exchange = uniswap_v1_action.getExchange(uniswap_v1_factory, usdc_erc20)
            dai_exchange = uniswap_v1_action.getExchange(uniswap_v1_factory, dai_erc20)
        
            # sweep a bunch of times to use up gas
            encoded_actions = argobytes_atomic_trade.encodeActions(
                [
                    example_action,
                    uniswap_v1_action,
                    uniswap_v1_action,
                    uniswap_v1_action,
                ],
                [
                    # add some faked profits
                    example_action.sweep.encode_input(uniswap_v1_action, address_zero),
        
                    # trade ETH to USDC
                    # uniswap_v1_action.tradeEtherToToken(address to, address exchange, address dest_token, uint dest_min_tokens, uint trade_gas)
                    uniswap_v1_action.tradeEtherToToken.encode_input(uniswap_v1_action, usdc_exchange, usdc_erc20, 1, 0),
        
                    # trade USDC to DAI
                    # uniswap_v1_action.tradeTokenToToken(address to, address exchange, address src_token, address dest_token, uint dest_min_tokens, uint trade_gas)
                    uniswap_v1_action.tradeTokenToToken.encode_input(
                        uniswap_v1_action, usdc_exchange, usdc_erc20, dai_erc20, 1, 0),
    
                    # trade DAI to ETH
                    # uniswap_v1_action.tradeTokenToEther(address to, address exchange, address src_token, uint dest_min_tokens, uint trade_gas)
                    uniswap_v1_action.tradeTokenToEther.encode_input(address_zero, dai_exchange, dai_erc20, 1, 0),
                ],
            )
        
            arbitrage_tx = argobytes_owned_vault.atomicArbitrage(
                chi, argobytes_atomic_trade, address_zero, [address_zero], value, encoded_actions, {'from': accounts[1]})
        
            assert argobytes_owned_vault.balance() > value
        
            # make sure the transaction succeeded
            # there should be a revert above if status == 0, but something is wrong
            assert arbitrage_tx.status == 1
    >       assert arbitrage_tx.return_value is not None
    E       AssertionError: assert None is not None
    E        +  where None = <Transaction '0x903f37e1596487075620d2c83dea892287b553c0147d97fb8bf4642a2083e177'>.return_value
    
    tests/test_uniswap_v1_arbitrage.py:67: AssertionError
    
    Interactive mode enabled. Use quit() to continue running tests.
    >>> arbitrage_tx.trace[-1]['op']                                                                                                                                                               
    'REVERT'
    >>> arbitrage_tx._trace[-1]['op']                                                                                                                                                              
    'REVERT'
    >>>  
    

    Context

    Due to previous issues with reverting traces pointing to incorrect lines, I've disabled solc's runs, so that shouldn't be the problem.

    I suspected that gastoken2/chi might be related to the issue, but removing that code didn't change anything.

    I'm sure the transaction isn't actually reverting because my test balance increases after the transaction is completed. If the transaction had reverted, the balance would not increase.

    I don't think Brownie is the problem here. Brownie just gets the trace from ganache.

    Your Environment

    • Version used: ganache-cli 6.9.1 and 6.10.0-beta.1
    • Version of Truffle/Remix/Other tools used: eth-brownie-1.8.9
    • NodeJS Version: [ ] 6.x, [ ] 7.x (unsupported), [ ] 8.x, [ ] 9.x, [x] v12.16.3
    • Operating System and version (include distro if Linux): Ubuntu 20.04
    • Link to your project or repro gist: https://github.com/SatoshiAndKin/argobytes-contracts-brownie
    • Commit hash to use with above link for reproduction: ecf07c4
    • I intend to submit a pull request to fix this issue: [ ]
    forking 
    opened by WyseNynja 27
  • Factory contract unable to call deployed contract with --fork flag

    Factory contract unable to call deployed contract with --fork flag

    This discussion on the OpenZeppelin forum contains a full description of the issue and an example that can be reproduced. Below I've included the core parts from that discussion.

    The factory contract below should deploy a new Forwarder instance then call its initialize() function. The call to this function should emit the Initialized event and set version to 1.

    This fails when testing against a forked version of the mainnnet, but succeeds otherwise.

    The error messages when testing against a forked version of the mainnet are below. From the stack trace shown, generated by testing against ganache-cli -d -f https://mainnet.infura.io/v3/$INFURA_ID, you can see from the "after each" section that the cause is a fork failure.

    However, in my original project—before creating a trimmed down version to help diagnose this bug—this "after each" error did not show up in the stack trace, and I have not figured out why.

    Any ideas on the cause of this issue and how to fix it are greatly appreciated! Until it's resolved I don't really have a way to run some tests, since the full version of the initialize() function calls some functions on mainnet contracts. (There's always the option deploying and setting up local instances of all the dependent contracts, but I'm hoping to avoid that).

    Thanks!

    Stack Trace

    1) Contract: ForwarderFactory
           creates proxy:
    
          AssertionError: expected '0' to equal '1'
          + expected - actual
    
          -0
          +1
          
          at Context.it (test/forwarderFactory.test.js:30:55)
          at process._tickCallback (internal/process/next_tick.js:68:7)
    
      2) Contract: ForwarderFactory
           "after each" hook: after test for "creates proxy":
         Error: Returned error: Returned error: invalid argument 0: empty hex string
          at Object.ErrorResponse (node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/src/errors.js:29:1)
          at /Users/mds/Documents/Documents-MBP/floatify/ganache-fork-failure/node_modules/truffle/build/webpack:/node_modules/web3-core-requestmanager/src/index.js:140:1
          at /Users/mds/Documents/Documents-MBP/floatify/ganache-fork-failure/node_modules/truffle/build/webpack:/packages/provider/wrapper.js:112:1
          at XMLHttpRequest.request.onreadystatechange (node_modules/truffle/build/webpack:/node_modules/web3-providers-http/src/index.js:96:1)
          at XMLHttpRequestEventTarget.dispatchEvent (node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:1)
          at XMLHttpRequest._setReadyState (node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:208:1)
          at XMLHttpRequest._onHttpResponseEnd (node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:318:1)
          at IncomingMessage.<anonymous> (node_modules/truffle/build/webpack:/node_modules/xhr2-cookies/dist/xml-http-request.js:289:47)
          at endReadableNT (_stream_readable.js:1129:12)
          at process._tickCallback (internal/process/next_tick.js:63:19)
    

    And here are the relevant files:

    FowarderFactory.sol

    pragma solidity ^0.5.0;
    
    // Proxy factory contains the deployMinimal() function used below
    // https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.6.0/packages/lib/contracts/upgradeability/ProxyFactory.sol#L18
    import "@openzeppelin/upgrades/contracts/upgradeability/ProxyFactory.sol";
    
    import "./Forwarder.sol";
    
    contract ForwarderFactory is ProxyFactory {
    
      address[] public forwarders;
      address[] public users;
      mapping (address => address) public getForwarder; // maps user => forwarder
    
      event ForwarderCreated(address indexed _address);
    
      function createForwarder(address _target, address _user) external {
    
        address _admin = msg.sender;
        bytes memory _payload = abi.encodeWithSignature("initialize(address,address)", _user, _admin);
    
        // Deploy proxy
        address _forwarder = deployMinimal(_target, _payload);
        emit ForwarderCreated(_forwarder);
    
        // Update state
        forwarders.push(_forwarder);
        users.push(_user);
        getForwarder[_user] = _forwarder;
      }
    }
    

    Forwarder.sol

    pragma solidity ^0.5.0;
    
    import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol";
    import "@openzeppelin/upgrades/contracts/Initializable.sol";
    
    contract Forwarder is Initializable, Ownable {
    
      address public admin;
      uint256 public version;
    
      event Initialized(address indexed thisAddress);
    
      function initialize(address _recipient, address _admin) public initializer {
        emit Initialized(address(this));
        Ownable.initialize(_recipient);
        admin = _admin;
        version = 1;
      }
    }
    

    forwarderFactory.test.js

    const {
      BN, // Big Number support
      constants, // Common constants, like the zero address and largest integers
      expectEvent, // Assertions for emitted events
      expectRevert, // Assertions for transactions that should fail
    } = require('@openzeppelin/test-helpers');
    
    const { expect } = require('chai');
    
    const Forwarder = artifacts.require('Forwarder');
    const ForwarderFactory = artifacts.require('ForwarderFactory');
    
    contract('ForwarderFactory', ([admin, user]) => {
      it('creates proxy', async () => {
        const factory = await ForwarderFactory.new();
        const logic = await Forwarder.new();
    
        await factory.createForwarder(logic.address, user);
    
        const forwarderAddress = await factory.forwarders(0);
        const forwarder = await Forwarder.at(forwarderAddress);
        expect(await forwarder.version()).to.be.bignumber.equal('1');
      });
    });
    

    Your Environment

    • Version used:
    • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1):
    • Server type and version:
    • Operating System and version:
    • Link to your project:
    bug priority2 ⚠️ correctness/consistency state-bug stability forking 
    opened by mds1 26
  • eth_sign API out of sync with ethapi

    eth_sign API out of sync with ethapi

    As of https://github.com/ethereum/go-ethereum/pull/2940, eth_sign api has changed. It is now eth_sign(address, msg), accepting arbitrary input and putting it through keccak256.

    Expected Behavior

    Upstream eth_api introduced a breaking change where eth_sign now accepts the actual message, rather than a 32 byte hash digest. Signature is now eth_sign(address, msg)

    Current Behavior

    testrpc currently emulates existing eth_sign(address, sha3(msg)) behavior

    Possible Solution

    Change ethereumjs-util.ecsign to call keccak256 before calling secp256k1.sign

    Context

    We need to sign statements with web3, which is now incompatible between testrpc and real ethapi.

    Your Environment

    • Version used: v3.0.3
    • Environment name and version (e.g. PHP 5.4 on nginx 1.9.1): n/a
    • Server type and version:
    • Operating System and version: os x
    • Link to your project: https://github.com/mediachain/aleph-ethereum
    bug priority2 ⚠️ 
    opened by parkan 25
  • Ganache-cli command not found

    Ganache-cli command not found

    Hi I have been trying to get ganache-cli working for ages now but no luck, I have tried npm install g- ganache-cli aswell as trying to install it via yarn, both say that I have it installed but yet dont allow me to use the command to run it!

    opened by JMiddey 22
  • There should be a way to test overwriting pending transactions

    There should be a way to test overwriting pending transactions

    With the current functionality of Ganache Core, if you try to broadcast a transaction with a higher fee that has already been broadcast with the same nonce, you will receive the following error the tx doesn't have the correct nonce. account has nonce of: 1 tx has nonce of: 0.

    This is because it verifies the nonce itself before running against the vm https://github.com/trufflesuite/ganache-core/blob/283cbeca1cf9f9c598845a00baaa331afc621596/lib/statemanager.js#L965

    ganache-core does not currently support a mempool, although this WIP refactor by @davidmurdoch does support a mempool to some degree https://github.com/trufflesuite/ganache-core/blob/a4e8989efc301b28d094082297dfbb1c4b25a744/src/ledgers/ethereum/components/transaction-pool.ts#L80-L87

    A feature like this is incredibly important for DApp developers. Especially ones creating time sensitive DApps that need to ensure parties can overwrite pending transactions.

    bug priority2 ⚠️ correctness/consistency 
    opened by matthewjablack 20
  • Javascript heap out of memory

    Javascript heap out of memory

    After a while of fairly heavy use (like we use a Parity node in production) Ganache stops working due to an out of memory error. (docker image: trufflesuite/ganache-cli:v6.1.8)

    ethereum_1                | 
    ethereum_1                | <--- Last few GCs --->
    ethereum_1                | 
    ethereum_1                | [1:0x561ab041e000] 26545867 ms: Mark-sweep 1404.1 (1464.4) -> 1404.0 (1464.4) MB, 378.3 / 0.0 ms  allocation failure GC in old space requested
    ethereum_1                | [1:0x561ab041e000] 26546370 ms: Mark-sweep 1404.0 (1464.4) -> 1404.0 (1433.4) MB, 502.1 / 0.1 ms  last resort GC in old space requested
    ethereum_1                | [1:0x561ab041e000] 26546865 ms: Mark-sweep 1404.0 (1433.4) -> 1404.0 (1433.4) MB, 495.8 / 0.1 ms  last resort GC in old space requested
    ethereum_1                | 
    ethereum_1                | 
    ethereum_1                | <--- JS stacktrace --->
    ethereum_1                | 
    ethereum_1                | ==== JS stack trace =========================================
    ethereum_1                | 
    ethereum_1                | Security context: 0x56ffe825879 <JSObject>
    ethereum_1                |     1: set(this=0x912f019afe1 <Map map = 0x3997f91848d9>,0x13318c210739 <JSArray[152]>,0xc4b8d949dd9 <JSArray[152]>)
    ethereum_1                |     2: set [/src/build/cli.node.js:~10] [pc=0x1d0b12cec68b](this=0x912f019aeb1 <yc map = 0x236896533a01>,e=0x13318c210739 <JSArray[152]>,a=0xc4b8d949dd9 <JSArray[152]>)
    ethereum_1                |     3: Ic [/src/build/cli.node.js:~10] [pc=0x1d0b12faf924](this=0x382ee240c209 <JSGlobal Object>,e=0x13318c210739...
    ethereum_1                | 
    ethereum_1                | FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
    

    To give an idea what I mean by fairly heavy usage, the full log: https://gist.github.com/roderik/82cba1882eb67b7e64c6482d12dd25d5 (about 19k lines)

    Startup command:

      ethereum:
        image: trufflesuite/ganache-cli:v6.1.8
        ports:
          - '8545:8545'
        command:
          [
            'node',
            './build/cli.node.js',
            '--secure',
            '--gasPrice',
            '0',
            '--unlock',
            '0',
            '--gasLimit',
            '0xfffffffffff',
            '--host',
            '0.0.0.0',
            '--networkId',
            '1337',
            '--mnemonic',
            'robot robot robot robot robot robot robot robot robot robot robot robot',
          ]
    
    opened by roderik 19
  • can't find evm_unlockUnknownAccount

    can't find evm_unlockUnknownAccount

    evm_unlockUnknownAccount : Unlocks any unknown account. Accounts known to the personal namespace and accounts returned by eth_accounts cannot be unlocked using this method; use personal_unlockAccount instead.

    This was supported in ganache-cli to add an account at runtime but I cannot find it anywhere in ganache. Is there something else?

    opened by Chiray1 18
  • v7.0.0-beta.0 signing issue: Invalid signature v value

    v7.0.0-beta.0 signing issue: Invalid signature v value

    I'm having trouble calling a smart contract method with v7.0.0-beta.0.

    The same code executed against ganache-cli v6.12.2 works fine.

    web3 code in question:

      const signedTx = await eth.accounts.signTransaction(
        transactionObject,
        ADMIN_ETH_KEY_1,
      );
      const txReceipt = await eth.sendSignedTransaction(signedTx.rawTransaction);
    

    When this is run with ganache v7 beta, I get this: Error: Returned error: Invalid signature v value

    It looks like the v value is 0x2d45 on ganache v6.12.2, but 0x2d46 on v7.0.0-beta-0.

    Edit: v7.0.0-alpha.2 has the same issue

    Possibly related to https://github.com/trufflesuite/ganache/issues/972

    bug priority2 ⚠️ 
    opened by FFdhorkin 18
  • testrpc doesn't work with Mist

    testrpc doesn't work with Mist

    Steps to Reproduce (for bugs)

    1. Start testrpc
    2. Start Mist with --rpc localhost:8545
    3. Select any account and try to send ether

    Current Behavior

    First in the tranasaction window threre's a warning:

    It seems this transaction will fail. If you submit it, it may consume all the gas you send.

    and

    Estimated fee consumption: We couldn't estimate the gas.

    Then after clicking on send transaction following message is displayed:

    Error: RPC method personal_signAndSendTransaction not supported. at GethApiDouble.handleRequest (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\lib\subproviders\geth_api_double.js:49:16) at next (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\index.js:95:18) at SolcSubprovider.handleRequest (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\subproviders\solc.js:28:7) at next (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\index.js:95:18) at VmSubprovider.handleRequest (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\subproviders\vm.js:40:12) at next (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\index.js:95:18) at GethDefaults.handleRequest (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\lib\subproviders\gethdefaults.js:17:12) at next (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\index.js:95:18) at FilterSubprovider.handleRequest (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\subproviders\filters.js:87:7) at next (C:\Users\jondoe\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\web3-provider-engine\index.js:95:18)

    Context

    I'm trying to test my contracts using Mist started with --rpc localhost:8545 to connect to testrpc. Test accounts are listed properly with their actual balance. Problems starts when I try to create a contract or send ether.

    Your Environment

    • Version used:
    • Environment name and version: TestRPC v3.0.3, Mist 0.8.7
    • Operating System and version: Windows 7 SP1
    • Link to your project:
    opened by gnom1gnom 18
  • istanbul chainId opcode returns bad value

    istanbul chainId opcode returns bad value

    Steps to reproduce

    1. Start ganache-cli using the following command:
    ganache-cli -l 8000000 -i 65535 -h 0.0.0.0 -k istanbul
    
    1. Compile/deploy the following contract:
    contract ChainIdTest
    {
    	function chainId()
    	public pure returns (uint256 id)
    	{
    		assembly { id := chainid() }
    	}
    }
    
    1. Call the chainId() function.

    I expect the returned value to be the chainId passed using the -i flag and accessible using await web3.eth.net.getId(); ... but I get a value of 1

    bug priority2 ⚠️ correctness/consistency istanbul 
    opened by Amxx 18
  • System Error when running Ganache 2.5.4 on win32

    System Error when running Ganache 2.5.4 on win32

    PLATFORM: win32 GANACHE VERSION: 2.5.4

    EXCEPTION:

    Error: EPERM: operation not permitted, watch
        at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
    
    opened by elamine77 0
  • System Error when running Ganache 2.5.4 on win32

    System Error when running Ganache 2.5.4 on win32

    PLATFORM: win32 GANACHE VERSION: 2.5.4

    EXCEPTION:

    Error: ENOENT: no such file or directory, rename 'C:\Users\a\AppData\Roaming\Ganache\workspaces\Quickstart\Settings.3761729630' -> 'C:\Users\a\AppData\Roaming\Ganache\workspaces\Quickstart\Settings'
        at Object.renameSync (fs.js:643:3)
        at writeFileSync (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\node_modules\write-file-atomic\index.js:124:8)
        at Proxy.setItem (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\node_modules\node-localstorage\LocalStorage.js:217:7)
        at JsonStorage_JsonStorage.setToStorage (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\json\JsonStorage.js:48:18)
        at JsonStorage_JsonStorage.setAll (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\json\JsonStorage.js:58:10)
        at WorkspaceSettings_WorkspaceSettings.setAll (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\settings\Settings.js:55:19)
        at WorkspaceSettings_WorkspaceSettings.bootstrap (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\settings\Settings.js:87:10)
        at flatMap (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\workspaces\WorkspaceManager.js:44:20)
        at Array.flatMap (<anonymous>)
        at WorkspaceManager_WorkspaceManager.enumerateWorkspaces (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\app.asar\webpack:\src\main\types\workspaces\WorkspaceManager.js:17:10)
    
    opened by zeroinmars 0
  • System Error when running Ganache 2.5.4 on win32

    System Error when running Ganache 2.5.4 on win32

    PLATFORM: win32 GANACHE VERSION: 2.5.4

    EXCEPTION:

    TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
        at validateString (internal/validators.js:112:11)
        at Object.extname (path.js:753:5)
        at ProjectFsWatcher.handleContractFileEvent (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\static\node\truffle-integration\projectFsWatcher.js:155:28)
        at FSWatcher.<anonymous> (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\static\node\truffle-integration\projectFsWatcher.js:186:16)
        at FSWatcher.emit (events.js:210:5)
        at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:131:12)
    
    opened by mukulhosendeveloper 0
  • System Error when running Ganache 2.5.4 on win32

    System Error when running Ganache 2.5.4 on win32

    PLATFORM: win32 GANACHE VERSION: 2.5.4

    EXCEPTION:

    Error: EPERM: operation not permitted, watch
        at FSEvent.FSWatcher._handle.onchange (internal/fs/watchers.js:123:28)
    
    opened by DhruvVaghani8844 0
  • Ganache doesn't build due type error when calling IPFS method

    Ganache doesn't build due type error when calling IPFS method

    The following error occurs when attempting build from a clean respository:

    npm run build
    
    > build
    > npm run tsc && cross-env NODE_OPTIONS=--max_old_space_size=4096 lerna run build
    
    
    > tsc
    > tsc --build src
    
    src/chains/filecoin/filecoin/src/blockchain.ts:716:46 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'CID'.
    
    716       await this.ipfsServer.node.object.stat(cid, {
                                                     ~~~
    
    src/chains/filecoin/filecoin/src/blockchain.ts:730:57 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'CID'.
    
    730     const stat = await this.ipfsServer.node.object.stat(cid, {
                                                                ~~~
    
    
    Found 2 errors.
    
    opened by adob 0
  • System Error when running Ganache 2.5.4 on win32

    System Error when running Ganache 2.5.4 on win32

    PLATFORM: win32 GANACHE VERSION: 2.5.4

    EXCEPTION:

    Error: connection not open
        at WebsocketProvider.send (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\static\node\node_modules\web3-providers-ws\src\index.js:282:18)
        at Timeout._onTimeout (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\static\node\node_modules\web3-providers-ws\src\index.js:267:19)
        at listOnTimeout (internal/timers.js:531:17)
        at processTimers (internal/timers.js:475:7)
    
    opened by chsai31288 0
Releases(v7.7.2)
  • v7.7.2(Dec 19, 2022)

     Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


    Here's another hotfix that corrects issues for some users facing Unhandled Promise Rejection... on NodeJs/Operating System combinations using eth_estimateGas.

    We've changed 5 files across 2 merged pull requests, tallying 59 additions and 295 deletions, since our last release.


    Fixes

    fix: handle eth_gasEstimate reverts correctly to prevent potential process crash (#4056)

    When updating to support the Merge hardfork code that handled eth_gasEstimate was refactored. A code block that previously "short circuited" the function no longer did, causing a JavaScript Promise to be fullfilled with a handled rejection, but then also an unhandled rejection. :badger:
    We've fixed the short circuit code and added a test to prevent this from regressing in the future.

    back to top


    Miscellaneous

    chore: remove Promise.allSettled shim (#4003)

    This was TODO'd to be removed if we bumped typescript to 4.2.3+

    back to top


    Changelog

    • #4003 chore: remove Promise.allSettled shim (@tenthirtyone)
    • #4056 fix: handle eth_gasEstimate reverts correctly to prevent potential process crash (@davidmurdoch)

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

    • Accept a genesis.json file (#1042)

    Coming Soon™:

    • Switch to esbuild to make build times faster/reasonable (#1555)
    • fork specific block & specific index (#952)
    • 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 to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.7.1(Dec 16, 2022)

     Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


    We released v7.7.0 yesterday, but it caused installation problems for Windows users without windows-build-tools. This hot fix resolves the issue for those affected users.

    If you are still experiencing issues installing Ganache please open a new issue.

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

    To install this latest release, run

    npm install ganache@latest --global
    


    Fixes

    fix: add leveldown back to bundle for Windows installation (#4046)

    For reasons not yet understood, the leveldown package must be bundled or installations on Windows without windows-build-tools installed fails. This puts the leveldown package back into the ganache package's bundledDependencies.
    This PR also introduces changes to our CI process to build a release candidate tarball during test runs.

    Fixes #3661

    back to top


    Miscellaneous


    docs: fix build status badge on README.md (#4048)

    Reason for this change: https://github.com/badges/shields/issues/8671
    Before:

    Before

    After:

    After

    back to miscellaneous

    chore: remove tarball that was accidentally added to the repo (#4052)

    In my haste to get the hot fix out to fix v7.7.0 I added a release candidate tarball to a PR and we didn't notice until it was merged into the develop branch :facepalm:. This PR just removes that mistake.

    back to miscellaneous

    back to top


    Changelog

    • #4046 fix: add leveldown back to bundle for Windows installation (@davidmurdoch)
    • #4048 docs: fix build status badge on README.md (@davidmurdoch)
    • #4052 chore: remove tarball that was accidentally added to the repo (@davidmurdoch)

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

    • Accept a genesis.json file (#1042)

    Coming Soon™:

    • Switch to esbuild to make build times faster/reasonable (#1555)
    • fork specific block & specific index (#952)
    • 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 to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.7.0(Dec 15, 2022)

     New Features   Miscellaneous   Changelog   Known Issues   Future Plans 


    It's been just two days since our last release, but we just couldn't wait any longer! This release has just two PRs, one which adds support for the Merge to Ganache, and the other which fixes an issue with the previous PR :sweat_smile:. Skip ahead to read the details of the Merge PR.

    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 134 files across 2 merged pull requests, tallying 7230 additions and 4319 deletions, since our last release.

    To install this latest release, run

    npm install ganache@latest --global
    


    New Features

    feat: add support for the merge hardfork (#3971)

    This release (re)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 released Ganache v7.4.4-alpha.0 back in September with support for the Merge. This PR brings that set of features to our stable release.
    This introduces a few important changes and features that are worth explaining.

    Dropping Node v12 Support

    Upgrading ethereumjs required dropping support for Node.js v12. In Ganache v7.0.0 we gave a deprecation notice for Node.js v12, and this release finalizes the removal of support for this version. To use Ganache, you'll need to install Node.js v14 or greater.

    New Block Tags

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

    New Default Hardfork

    The new default hardfork when starting Ganache is merge. To start Ganache with a different hardfork, use the --chain.hardfork option.

    back to top


    Miscellaneous

    ci: remove node 12 from CI tests (#4029)

    You know when you spend a really long time on a big PR and finally think you've got every little detail settled, then the whole team reviews the PR and finds a few other little things that you fix, then they all approve the PR, so you all think you've got every little detail settled, then you finally merge the PR and you immediately realize that you forgot to remove a now unsupported version of node from your CI tests that only run once the PR has been merged into develop, so now you have to make another PR to remove the now unsupported node version from your CI tests? Yeah I hate when that happens.

    back to top


    Changelog

    • #3971 feat: add support for the merge hardfork (@MicaiahReid)
    • #4029 ci: remove node 12 from CI tests (@MicaiahReid)

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

    • Accept a genesis.json file (#1042)

    Coming Soon™:

    • Switch to esbuild to make build times faster/reasonable (#1555)
    • fork specific block & specific index (#952)
    • 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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.6.0(Dec 13, 2022)

     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.


    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 :+1:, 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

    • #3833 ci: update actions/workflows to use Node 16 (@cds-amal)
    • #3840 docs: document eth_feeHistory in RCP-METHODS.md (@davidmurdoch)
    • #3723 docs: update README.md to clarify usage (@emilyJLin95)
    • #3568 feat: add detach mode to the CLI (@jeffsmale90)
    • #3890 docs: add server to list of startup option namespaces in README.md (@tenthirtyone)

    back to top


    Known Issues

    Top Priority:

    • The Merge https://github.com/trufflesuite/ganache/pull/3971
    • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
    • 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:

    • Accept a genesis.json file (#1042)

    Coming Soon™:

    • Switch to esbuild to make build times faster/reasonable (#1555)
    • 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 to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.5.0(Oct 25, 2022)

     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

    • #3361 fix: add an upper limit to # of accounts that can be generated by ganache (@tenthirtyone)
    • #3404 fix: add " " after the HTTP/1.1 Response Status-Code (@davidmurdoch)
    • #3634 docs: fix typo in fork.username cli description (@davidmurdoch)
    • #3775 ci: add @MicaiahReid to CODEOWNERS (@MicaiahReid)
    • #3784 test: improve coverage of RPC-JSON Data byteLength argument (@jeffsmale90)
    • #3713 chore: remove extra quotes in require-engines test helper (@davidmurdoch)
    • #3801 docs: fix typos (@omahs)
    • #3774 docs: fix eth_call interactive docs example (@MicaiahReid)
    • #3351 feat: add eth_feeHistory JSON-RPC endpoint (@tenthirtyone)

    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_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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.4.4(Oct 5, 2022)

     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)
    • 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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.4.4-alpha.0(Sep 23, 2022)

     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

    • #3531 fix: calling evm_mine with a timestamp argument should reflect the change of time in subsequent blocks (@jeffsmale90)
    • #3705 chore: remove support for Node.js v12 (@davidmurdoch)
    • #3656 chore: upgrade @ethereumjs/vm to v6.0.0 (@MicaiahReid)

    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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.4.3(Sep 8, 2022)

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

    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 > should get a block from the original chain test is now skipped.

    back to miscellaneous

    chore: add sepolia as a network option (#3580)

    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.

    back to miscellaneous

    back to top


    Changelog

    • #3523 fix: assume unknown tx type is TransactionType.Legacy (@jaketimothy)
    • #3533 test: replace assert.deepEqual with assert.deepStrictEqual (@l2ig)
    • #3534 chore: set default hardfork to grayGlacier; update @ethereumjs/* packages (@davidmurdoch)
    • #3433 fix: after provider.disconnect() is called, Ganache should stop serving requests (@jeffsmale90)
    • #3564 docs: add trufflesuite.com to README (@davidmurdoch)
    • #3506 fix: evm_setTime doesn't work correctly with miner.timestampIncrement (@jeffsmale90)
    • #3527 fix: return exactly 32 bytes from eth_getStorageAt (@davidmurdoch)
    • #3543 ci: add config for semantic-prs app (@MicaiahReid)
    • #3547 ci: remove docker from automated release workflow (@MicaiahReid)
    • #3617 test: skip test pending chainId added to transaction object (@jeffsmale90)
    • #3619 ci: fix docker publish (@MicaiahReid)
    • #3580 chore: add sepolia as a network option (@tenthirtyone)

    back to top


    Known Issues

    Top Priority:

    • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
    • 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_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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.4.2(Sep 8, 2022)

    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

    Source code(tar.gz)
    Source code(zip)
  • v7.4.1(Aug 16, 2022)

     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 bundle-size-check test run on external contributor PRs (@davidmurdoch)
    • #3349 fix: correct signature of eth_getWork (@emilbayes)
    • #3227 fix: EIP-1559 access list transaction gas cost (@robmcl4)
    • #3409 build: ensure webpack's INFURA_KEY is exactly 32 lowercase hex characters (@davidmurdoch)
    • #3434 refactor: fix typo in promise-queue/index.ts (@eltociear)
    • #3444 test: make bundle-size-check test work again (@davidmurdoch)
    • #3443 test: correct webpack infura key validation error message grammar (@tenthirtyone)
    • #3466 fix: switch to user-provided logger rather than console.log (@MicaiahReid)
    • #3508 test: replace assert.equal with assert.strictEqual in tests (@l2ig)
    • #3472 chore: remove unnecessary TODOs from api, update TODOs with issue numbers (@tenthirtyone)

    back to top


    Known Issues

    Top Priority:

    • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
    • 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_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 blcok (#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) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.4.0(Jul 27, 2022)

     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!


    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. :tada:

    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)

    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!

    back to miscellaneous

    ci: avoid timeouts in mac-os github actions (#3356)

    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.

    back to miscellaneous

    docs: update --verbose cli help text (#3354)

    The documentation for the --verbose CLI flag was inaccurate. Now it isn't.

    back to miscellaneous

    test: fix intermittent test failure (#3357)

    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 00s (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.

    back to miscellaneous

    build(deps): bump parse-url from 6.0.0 to 6.0.2 (#3334)

    Thanks, @dependabot!

    back to miscellaneous

    chore: create CODEOWNERS (#3188)

    This just sets up an initial CODEOWNERS file so we can improve our code review process in the near future.

    back to miscellaneous

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

    back to miscellaneous

    chore: enforce 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.

    back to miscellaneous

    chore: update internal 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.

    back to miscellaneous

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

    back to miscellaneous

    chore: remove unused build file (#3274)

    Just removing some totally unused code. Nothing to see here!

    back to miscellaneous

    back to top


    Changelog

    • #3289 chore: add "Pull Requests" section to CONTRIBUTING.md (@davidmurdoch)
    • #3328 fix: issue where Quantity.toNumber() returns incorrect value with leading 00 bytes, and meaningful byte length > 6 (@jeffsmale90)
    • #3327 feat: add the ability to use console.log from Solidity (@davidmurdoch)
    • #3356 ci: avoid timeouts in mac-os github actions (@davidmurdoch)
    • #3354 docs: update --verbose cli help text (@cds-amal)
    • #3357 test: fix intermittent test failure (@davidmurdoch)
    • #3334 build(deps): bump parse-url from 6.0.0 to 6.0.2 (@dependabot)
    • #3188 chore: create CODEOWNERS (@davidmurdoch)
    • #3322 docs: correct callGasLimit default value in README (@davidmurdoch)
    • #3355 chore: enforce concurrency: production in Release workflow (@davidmurdoch)
    • #3389 fix: set up the chain correctly to ensure a consistent start time (@jeffsmale90)
    • #3379 chore: update internal hasOwn JSDoc so it is correct (@davidmurdoch)
    • #3320 docs: add callGasLimit default change to breaking changes list in UPGRADE-GUIDE.md (@davidmurdoch)
    • #3274 chore: remove unused build file (@davidmurdoch)
    • #3199 feat: add eth_getProof RPC method (@jeffsmale90)
    • #3421 fix: ensure console.log event context is defined (@davidmurdoch)

    back to top


    Known Issues

    Top Priority:

    • debug_storageRangeAt fails to find storage when the slot was created earlier in the same block (#3338)
    • calling evm_mine with a timestamp does not persist 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)
    • 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 (or join our team) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.3.2(Jun 24, 2022)

     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

    • #3208 fix: fix installation issues by bumping @trufflesuite/bigint-buffer to v1.1.10 (@tenthirtyone)
    • #3268 chore: fix typo in errors.ts (@eltociear)
    • #3275 fix: reduce bundle size and check size in CI (@davidmurdoch)
    • #3130 fix: make forking work in the browser (@davidmurdoch)
    • #3233 fix: Properly handle 'estimate' for defaultTransactionGasLimit option on the CLI (@tenthirtyone)

    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 (or join our team) to influence what we gets implemented and prioritized.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.3.1(Jun 17, 2022)

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

    back to top


    Changelog

    • #2983 perf: improve JSON-RPC data types; better, faster, stronger (@jeffsmale90)
    • #3247 fix: remove redundant await in evm_mine (@MicaiahReid)

    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)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Add personal_ecRecover and personal_sign (#995)
    • Add flag for starting ganache in detached mode (#1001)
    • Implement eth_getProof RPC message (#382)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)
    • Support IPC endpoint (#759)
    • Accept a genesis.json file (#1042)

    back to top

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


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.3.0(Jun 9, 2022)

     Highlights   New Features   Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


    This is our third feature release since Ganache v7.0.0 launched almost 5 months ago! In this release we introduce not one, but two new features, fix four bugs, perform two chores, and introduce one huge performance improvement!

    If you have some time, we encourage you to browse our issues to find anything you'd like implemented/fixed sooner and give them a +1; 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 (@gorbak25, @benjamincburns) and contributors (@robmcl4, @AuHau, @jeffsmale90, @tenthirtyone, @MicaiahReid) who were a part of this release!

    All in all, we've changed 154 files across 10 merged pull requests, tallying 4788 additions and 4251 deletions, since our last release.


    Highlights

    The most noteworthy change in this release is likely the new TypeScript namespace for all RPC method parameters and return types. Check out the details below for more information!

    Also worth mentioning is the new --miner.timestampIncrement option. When used in combination with the existing --chain.time option it introduces a new way of ensuring deterministic block timestamps that was previously very cumbersome and tedious to accomplish. Details below.

    back to top


    New Features


    feat: create arm64 architecture docker build at release (#3037)

    We now publish a Docker build for ARM v8 (ARM64) with every new ganache release, in addition to our AMD64 build. Now when you run docker run --publish 8545:8545 trufflesuite/ganache:latest on your M1 Mac (and other ARM64-based systems) you'll run a container built specifically for your processor's architecture.

    back to new features

    feat: add miner.timestampIncrement option (#3131)

    We've been told that you all want us to have more meme content in our release notes. This is the best I could do this time (sorry, not sorry):

    By default ganache uses the system clock time for automatically mined blocks. This behavior is convenient, but results in nondeterminism, invalid block timestamps[^1], and can cause issues with relative block timestamp dependent contracts and tests. There were workarounds for all of these issues (by manually mining via evm_mine({ timestamp })) but a built in solution was clearly necessary.

    Ganache now enables the use of a new --miner.timestampIncrement option which can be used to set the amount of seconds between consecutive blocks, regardless of how much system time has passed. The default value, "clock", retains the previous default behavior of using the system time for each block.

    The following example will start ganache instructing it to increment each new block's timestamp forward by 60 seconds from the initial starting time of 499162860000 (October 26 1985, as a Unix timestamp with millisecond precision):

    $ ganache --time 499162860000 --miner.timestampIncrement=60
    

    [^1]: The Ethereum Yellowpaper defines: $H_{\mathrm{s}} > P(H){_\mathrm{H_s}}$ where $H{\mathrm{_s}}$ is the timestamp of block $H$ and $P(H)$ is the parent block. Or in other words: a block's timestamp must be greater than its parent block's timestamp.

    back to new features

    back to top


    Fixes


    fix: eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex to respect non-zero transaction index (#3118)

    Both eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex accept an index parameter to indicate the which transaction within the block to return.

    Previous to this fix, both functions would return the 0th (first) transaction within the block, regardless of the value passed.

    back to fixes

    fix: add new Ethereum types namespace to fix types (#2527)

    We fixed our Ethereum RPC types and put them in a new namespace: Ethereum! Use it as follows:

    import Ganache, {ProviderOptions, Ethereum} from "ganache";
    
    async function getLatestBlock(): Promise<Ethereum.Block> {
      return await provider.request({method: "eth_getBlockByNumber", params: ["latest"]});
    }
    async function getAccounts(): Promise<string[]> {
      return await provider.request({method: "eth_accounts", params: []});
    }
    async function sendTransaction(transaction: Ethereum.Transaction): Promise<string> {
      return await provider.request({method: "eth_sendTransaction", params: [transaction]});
    }
    
    const options: ProviderOptions = {
      fork: { network: "mainnet" }
    };
    const provider = Ganache.provider(options);
    const accounts  = await getAccounts();
    const block = await getLatestBlock();
    console.log(block.number); // string
    const transaction: Ethereum.Transaction = { from: accounts[0], to: accounts[2], value: "0xffff" };
    const hash = await sendTransaction(transaction);
    console.log(hash); // string
    

    If you find issues or can think of ways we can further improve our types please open a New Issue (you can view all existing type issues by filtering our issues by the typescript label).

    fixes #2134

    back to fixes

    fix: save evm_mine blocks before returning (#3016)

    Though it was rare, sometimes calling evm_mine would return before the mined block was actually saved. If you polled for the block that Ganache had claimed to mine directly after calling evm_mine, that block could not yet exist.
    This change ensures that the block is saved before emitting the "newHeads" subscription message and before returning during an evm_mine. Fixes #3060.

    Potential Side Effect

    This change does have one potential side effect, though we really doubt anyone should be impacted, and we consider it a bug fix. Sometimes when a block is mined, Ganache waits until the next iteration of the event loop (using setImmediate) to emit the mined block. This is to ensure that the user has time to listen for the new block's "message" before Ganache emits it.

    Previously, Ganache would delay emitting this event if --miner.instamine="eager" AND --miner.blockTime=0. These settings mean that transactions are saved before returning the transaction (as apposed to returning a hash as the transaction enters the transaction pool in "strict" mode), and the miner immediately starts mining transactions as they enter the transaction pool (as opposed to mining a block every blockTime seconds).*

    Now, Ganache delays emitting this event when --miner.instamine="eager" regardless of how blockTime is set. The instamine mode affects when the transaction is returned to the user, so it should be the driving factor behind delaying the event. If in --miner.blockTime=0 mode (the default) you somehow relied on the event being emitted at a very specific event tick, this may cause issues for you. For most of us mere mortal developers, this won't make a difference.

    *Note: We'll have a blog post or discussion providing a deeper dive into all of our mining modes soon that should help further clarify --miner.instamine, --miner.blockTime, and --chain.vmErrorsOnRPCResponse.

    back to fixes

    fix: only mine one block in interval mining (#3032)

    In a real Ethereum node, blocks are committed approximately every 15 seconds. Ganache allows users to configure how often this mining takes place in this "interval" mining mode with the --miner.blockTime flag, and it allows users to "instamine" transactions by setting --miner.blockTime=0 (the default).
    For each block that is made in a real Ethereum node, the transactions that are included on the block is based off of many factors including the number of transactions in the transaction pool, the gas price and gas limit of those transactions, and the block's gas limit. Regardless of the ordering, the number of transactions included on the block is limited by that block gas limit. Then, once a single block is mined, approximately 15 seconds elapses before another block is generated.

    In the interval mining mode before this change, Ganache would begin mining after the blockTime elapses, but it would mine all transactions in the pool, regardless of how many blocks it would take. This change fixes Ganache's behavior to be more like a real Ethereum node. Now only one block will be mined whenever blockTime elapses, even if that means leaving some transactions in the transaction pool until the next block is generated. This change fixes #3030.

    back to fixes

    back to top


    Miscellaneous


    docs: update Node.js version recommendation in README (#3038)

    We haven't supported Node.js v10 for a while now; the recommendation in our README.md to use Node.js v10 has been updated to reflect our actual support: at least Node v12 and npm v6.12.0.

    back to miscellaneous

    chore: throw if name arg in create script includes scope (#3108)

    This may be a small change to an internal-facing script, but it is still a big deal: this is the first contribution to the newest member of the Ganache team: @tenthirtyone! Welcome to the team!

    back to miscellaneous

    chore: add relevant keywords to ganache's package.json (#3151)

    Users reported that it was difficult to find the ganache package in the npm registry because they were used to searching for ganache-cli and ganache-core. This change adds those terms to our package.json's "keywords" list, which hopefully alleviates the problem.
    Fixes #3143

    back to miscellaneous

    perf: speed up large transaction traces by buffering fragmented send (#2634)

    We introduced the ability to return huge transaction traces in v7.0.0, but that ability came with a cost: it was about 30x slower than it needed to be!

    Thanks to work started by @robmcl4 large transaction traces (traces with more than 100000 structLogs) are now consistently more than 30x faster than in previous versions in both WebSocket and HTTP transports. This means that transaction traces that used to take 8 minutes now takes less than 10 seconds!

    If you don't mind reading some JavaScript and like reasoning about JavaScript Generator logic you should take a look at the PR that made this performance bump possible!

    back to miscellaneous

    back to top


    Changelog

    • #2527 fix: add new Ethereum types namespace to fix types (@davidmurdoch)
    • #3038 docs: update Node.js version recommendation in README (@davidmurdoch)
    • #3108 chore: throw if name arg in create script includes scope (@tenthirtyone)
    • #3037 feat: create arm64 architecture docker build at release (@AuHau)
    • #3151 chore: add relevant keywords to ganache's package.json (@davidmurdoch)
    • #3016 fix: save evm_mine blocks before returning (@MicaiahReid)
    • #3032 fix: only mine one block in interval mining (@MicaiahReid)
    • #2634 perf: speed up large transaction traces by buffering fragmented send (@robmcl4)
    • #3131 feat: add miner.timestampIncrement option (@davidmurdoch)

    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)
    • Implement eth_getProof RPC message (#382)

    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)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Add personal_ecRecover and personal_sign (#995)
    • Add flag for starting ganache in detached mode (#1001)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)
    • Support IPC endpoint (#759)
    • Accept a genesis.json file (#1042)

    back to top

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


    💖 The Truffle Team


    Source code(tar.gz)
    Source code(zip)
  • v7.2.0(May 20, 2022)

     Highlights   New Features   Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


    Not much in this release, as we just wrapped a huge hackathon here at ConsenSys. During the hackathon we got to actually use Ganache on our own project, which is actually not something we do very often, and in doing so found lots of new ways to improve the overall experience, so you can expect some really amazing changes in the weeks to come.

    Thanks to @adjisb, @RiccardoBiosas, and @davidmurdoch for their contributions to this release!

    We've changed 41 files across 5 merged pull requests, tallying 714 additions and 780 deletions, since our last release.


    Highlights

    This release brings official Node v18 support to Ganache. Ganache was already working fine in Node v18, but because our tests harnesses were failing in CI we couldn't yet claim full support. Now we can!

    back to top


    New Features

    feat: add __experimental_info export to core (#2529)

    This is an internal and private feature for Truffle. Truffle needed a way to programmatically get the list of chains Ganache fully supports in order to enable the dry-run feature for those chains.
    This introduces a new experimental and private (this will likely change in a future release!) __experimental_info export:

    Readonly<{
      version: string,
      fork: Readonly<{
        /**
         * Chains Ganache is known to be compatible with. Operations performed
         * locally at historic block numbers will use the Ethereum Virtual Machine
         * OPCODEs, gas prices, and EIPs that were active at the time the historic
         * block originally took place.
         */
        knownChainIds: number[],
      }>
    }>
    

    back to top


    Fixes

    fix: enforce eip-2 imposed limits and secp256k1 upper bound for private keys (#2944)

    Sending transactions from an impersonated account with a "large" account number, like fffffffffffffffffffffffffffffffffffffffe, would result in the error "The nonce generation function failed, or the private key was invalid" due to the way we fake transaction signing in ganache. Previously we would take the account number plus the first 12 bytes of the account number, fffffffffffffffffffffffffffffffffffffffe + ffffffffffffffffffffffff, and would use that as a fake private key. This results in an invalid key, as secp256k1, the elliptic curve used in Ethereum cryptography, has an effective maximum private key value of 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140n (AKA secp256k1_n - 1, or the total number of non-trivial points on the curve). This fixes #2586.

    While implementing this fix it was discovered that we were not rejecting transactions with too-high s-values; i.e., s-values that are greater than (secp256k1_n - 1) / 2. This restriction was added way back in Ethereum's first hardfork, homestead, as part of EIP-2 in order to remove the possibility of "malleable" transactions. While somewhat unrelated to the core reason for this fix, it has been added as part of this PR. This fixes #2600.

    back to top


    Miscellaneous


    chore: support node 18 (#2988)

    Ganache now supports and is tested on Node versions 12.0.0, 12.x, 14.x, 16.x, and 18.x on operating systems Windows 2019, Ubuntu 18.04, Ubuntu 20.04, and macOS 11, with the exception of Node v18 on Ubuntu 18.04, as Ubuntu 18.04 is not supported by Node v18.
    Happy upgrading!

    back to miscellaneous

    docs: add documentation of eth_call overrides (#3007)

    This PR adds some documentation of the eth_call overrides object to or RPC method docs, fixing #3002.

    back to miscellaneous

    chore: update @ethereumjs/vm to v5.9.0, add support for sepolia (#2528)

    We've updated @ethereumjs/vm to v5.9.0 and added support for forking the new "sepolia" test network.

    back to miscellaneous

    back to top


    Changelog

    • #2944 fix: enforce eip-2 imposed limits and secp256k1 upper bound for private keys (@davidmurdoch)
    • #2529 feat: add __experimental_info export to core (@davidmurdoch)
    • #2988 chore: support node 18 (@davidmurdoch)
    • #3007 docs: add documentation of eth_call overrides (@MicaiahReid)
    • #2528 chore: update @ethereumjs/vm to v5.9.0, add support for sepolia (@davidmurdoch)

    back to top


    Known Issues

    Top Priority:

    • Unable to install Ganache (npm) on MacOS 10.15.7 (#2445)
    • Ganache v7.0.0 - typings are broken (#2134)
    • Add option to set fork block's timestamp to the time the actual block was mined (#2122)
    • 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)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Add personal_ecRecover and personal_sign (#995)
    • Add flag for starting ganache in detached mode (#1001)
    • Implement eth_getProof RPC message (#382)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)
    • Support IPC endpoint (#759)
    • Accept a genesis.json file (#1042)

    back to top

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


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.1.0(Apr 28, 2022)

     Highlights   New Features   Miscellaneous   Changelog   Known Issues   Future Plans 


    Here comes our first feature release since Ganache v7.0.0! We've worked through a good chunk of the bugs that have been discovered since the release, so we look forward to starting to add some new features! Don't worry, we're still working through bugs as well. Feel free to give any issues that you'd like to see implemented sooner a :+1: and we'll use this community feedback to help prioritize what we work! 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 (@fabioberger, @szgyuszi1) and contributors (@domob1812, @dekz, @jeffsmale90, @gnidan) who were a part of this release!

    We've changed 9 files across 7 merged pull requests, tallying 1235 additions and 188 deletions, since our last release.


    Highlights

    VM Overrides During eth_call

    Ganache now has support for overriding the contract code and storage and the account balance and nonce for simulations with eth_call. This feature is similarly supported by geth.

    The eth_call RPC method now accepts a third override parameter which is a map from an address to the desired state of that address. The state object has the following keys, all of which are optional:

    balance: QUANTITY - The balance to set for the account before executing the call. nonce: QUANTITY - The nonce to set for the account before executing the call. code: DATA - The EVM bytecode to set for the account before executing the call. state*: OBJECT - Key-value mapping of storage slot to value that will clear all slots and then override individual slots in the account storage before executing the call. stateDiff*: OBJECT - Key-value mapping of storage slot to value that will override individual slots in the account storage before executing the call. *Note - state and stateDiff fields are mutually exclusive.

    So, an example override object using all fields overriding multiple addresses could look like the following:

    const overrides = {
      "0xd9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f3": { 
        "nonce": "0xa", 
        "balance": "0xffff", 
        "state": { 
          "0000000000000000000000000000000000000000000000000000000000000001": "0xbaddad42baddad42baddad42baddad42baddad42baddad42baddad42baddad42"
        } 
      },
      "0xebe8efa441b9302a0d7eaecc277c09d20d684540": { 
        "code": "0x123456", 
        "stateDiff": {
          "0000000000000000000000000000000000000000000000000000000000000002": "0xbaddad42baddad42baddad42baddad42baddad42baddad42baddad42baddad42"
        } 
      }
    };
    const transaction = { ... };
    const result = await provider.request({ method: "eth_call", params: [ transaction, "latest", overrides ] });
    

    Like all state changes made with eth_call, the changes are ephemeral and only last for that specific run of eth_call. Happy transaction simulating!

    back to top


    New Features


    perf: improve performance of the persistent cache used in forking (#2811)

    We've found some small adjustments that could be made to our persistent cache to slightly improve forking performance. Even more forking performance improvements are in the works now, too!

    back to new features

    feat: allow balance, code, nonce, and state overrides in eth_call (#2565)

    This feature was demonstrated in our highlights above. We'd like to give a huge thank you to @domob1812 and @dekz for their initial contributions to this one, you both were a huge help.

    The PR introducing this feature uses @dekz's #905 as a starting point, and fixes #554 and #2934.

    back to new features

    back to top


    Miscellaneous


    chore: remove outdated warning about EIP-1193 fork providers (#2856)

    This PR removes the warning described in #2558 about non-EIP-1193 providers, since Web3.js appears to be sticking with this kind of provider for the foreseeable future.

    back to miscellaneous

    ci: automated release improvements (#2892)

    This change updates the release automation process in a few ways:

    1. Adds a vX.x.x git tag to each release, in addition to the [email protected] tag that already was automatically added - Fixes #2279.
    2. After a successful "latest" release (into master), merges master back into develop to keep their commit history in sync.
    3. Signs all automation commits from @TrufBot - Fixes #2882.

    back to miscellaneous

    chore: wrap comment at 80 chars (#2987)

    Just some cleanup - nothing to see here :smile:

    back to miscellaneous

    ci: fix release tagging (#2979)

    Our initial attempt at this v7.1.0 release did pan out as expected because our automated release process didn't correctly handle minor version changes. This led to the accidental creation of v7.0.5 :sweat_smile:

    This PR updates our automated release process to parse through a release's commits, detect feature commits, and set the new release version accordingly (and hey! It looks like it works! Way to go @davidmurdoch).

    back to miscellaneous

    back to top


    Changelog

    • #2811 perf: improve performance of the persistent cache used in forking (@jeffsmale90)
    • #2856 chore: remove outdated warning about EIP-1193 fork providers (@gnidan)
    • #2892 ci: automated release improvements (@MicaiahReid)
    • #2565 feat: allow balance, code, nonce, and state overrides in eth_call (@domob1812 / @dekz / @MicaiahReid)
    • #2987 chore: wrap comment at 80 chars (@davidmurdoch)
    • #2979 ci: fix release tagging (@davidmurdoch)

    back to top


    Known Issues

    Top Priority:

    • A transaction with maxFeePerGas less than the next block's baseFeePerGas should be rejected (#2176)
    • Ganache v7.0.0 - typings are broken (#2134)
    • ganache forking is not working as expected (#2122)

    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)
    • System Error when sending batch request with 1 not valid item (#402)
    • --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)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Add personal_ecRecover and personal_sign (#995)
    • Add flag for starting ganache in detached mode (#1001)
    • Implement eth_getProof RPC message (#382)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)
    • Support IPC endpoint (#759)
    • Accept a genesis.json file (#1042)

    back to top

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


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.0.5(Apr 28, 2022)

    This version should have been v7.1.0 and has been re-released as such. Release notes are here: https://github.com/trufflesuite/ganache/releases/tag/v7.1.0

    Source code(tar.gz)
    Source code(zip)
  • v7.0.4(Apr 5, 2022)

     Highlights   Fixes   Miscellaneous   Changelog   Known Issues   Future Plans 


    We've got a few more fixes in this release! But much more importantly we'd like to welcome @jeffsmale90 to the Ganache team! He has hit the ground running and is responsible for three out of five bug fixes today. Welcome to the team, Jeff! We'd also like to thank our issue openers (@PeterYinusa, @robsmith11), PR contributors (@MatthieuScarset), and technical consultants (@cds-amal). Thank you for being a part of this community!

    We've changed 26 files across 8 merged pull requests, tallying 584 additions and 150 deletions, since our last release.


    Highlights

    Disable Rage Quit; Fix Regular Shutdown

    Ganache v7 was released with a lovely feature that prevented Ganache from shutting down when some applications (including MetaMask) connect to Ganache and regularly poll for data. This feature was shipped to provide our users with some much needed practice expressing negative emotions as they repeatedly attempt to shut down Ganache, and Ganache says that it recognizes the shutdown signal but fails to shutdown.

    Giant panda destroying computer in a fit of rage.

    We are, of course, kidding. This issue had multiple causes which are now fixed in this release. Ganache now facilitates graceful shutdown in cases where persistent HTTP connections previously held Ganache open. Thank you all for your patience in waiting for a fix on this issue. 🙏

    back to top


    Fixes


    fix: use host param when passed in server.listen (#2397)

    Ganache previously ignored the --host parameter and would always bind to host 127.0.0.1. It now binds to the given host as expected.

    back to fixes

    fix: correctly pad / truncate in JSON-RPC types, add tests to ethereum-address and json-rpc-data (#2716)

    The internal Address class previously wasn't properly padding compressed addresses. This would cause some RPC methods, like evm_addAccount, to add invalid Ethereum addresses. The class will now pad addresses to the correct length, allowing this behavior:

    const address = new Address("0x1");
    console.log(address.toString()) // 0x0000000000000000000000000000000000000001
    

    which will in turn allow:

    const address = "0x1";
    const passphrase = "passphrase"
    const result = await provider.send("evm_addAccount", [address, passphrase] );
    

    back to fixes

    fix: parse port to number type if provided in as string (#2610)

    Ganache now allows the port number passed via ganache --port to be a string or a number. This allows the use case where the port is passed directly from args without parsing.

    back to fixes

    fix: close http connections after http-server.close() has been called (#2667)

    As stated in our highlights, Ganache now facilitates graceful shutdown in cases where persistent HTTP connections previously held Ganache open. In the worst case where no requests are received over the persistent connection, Ganache will timeout after 10 seconds.

    back to fixes

    fix: update @trufflesuite/uws-js-unofficial dependency to silence node12 warnings (#2807)

    If you've been using Ganache with nodejs 12, you've probably been bothered by the annoying error stating:

    This version of µWS is not compatible with your Node.js build:
    
    Error: node-loader:
    Error: Module did not self-register: '/home/workspace/.nvm/versions/node/v12.22.1/lib/node_modules/ganache/dist/node/3wHsIyFE.node'.
    Falling back to a NodeJS implementation; performance may be degraded.
    

    This change silences the warning to give you the uncluttered CLI you deserve.

    back to fixes

    back to top


    Miscellaneous


    ci: fix test timeouts (#2503)

    Tests that used to pass in CI started failing in GitHub Actions due to timeouts. We verified there were no performance regressions on our part, and that these timeouts were caused by GitHub Action runners becoming slower over time. We bumped the test timeout default value to 5 seconds.

    back to miscellaneous

    refactor: rearrange miner for easier readability (#2514)

    We noticed some duplicate branches in a method and simplified it. There's nothing interesting to see here... 🙂

    back to miscellaneous

    docs: fix example in README (#2789)

    The README.md example showing programmatic usage had a bug causing it to fail. The example now works as intended. Thanks again for pointing this out, @MatthieuScarset!

    back to miscellaneous

    back to top


    Changelog

    • #2503 ci: fix test timeouts (@MicaiahReid)
    • #2514 refactor: rearrange miner for easier readability (@davidmurdoch)
    • #2397 fix: use host param when passed in server.listen (@davidmurdoch)
    • #2610 fix: parse port to number type if provided in as string (@jeffsmale90)
    • #2716 fix: correctly pad / truncate in JSON-RPC types, add tests to ethereum-address and json-rpc-data (@jeffsmale90)
    • #2667 fix: close http connections after http-server.close() has been called (@jeffsmale90)
    • #2789 docs: fix example in README (@davidmurdoch)
    • #2807 fix: update @trufflesuite/uws-js-unofficial dependency to silence node12 warnings (@trufflesuite)

    back to top


    Known Issues

    Top Priority:

    • A rejected transaction should possibly be added back into the pool (#2176)
    • Ganache v7.0.0 - typings are broken (#2134)
    • Ganache's provider type is not compatible with Web3 (#2125)
    • Add eth_feeHistory RPC endpoint (#1470)
    • evm_mine and miner_start don't respect --mode.instamine=eager (#2029)

    Coming Soon™:

    • debug_traceTransaction may crash on Node.js v12 (#2106)
    • evm_setAccountNonce is race-conditiony (#1646)
    • @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)
    • --db Option Requires Same Mnemonic and Network ID (#1030)
    • 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)
    • System Error when sending batch request with 1 not valid item (#402)

    back to top


    Future Plans

    • Reduce Bundle Size (#2096)
    • Add a way to create or modify arbitrary accounts and storage (#1889)
    • Switch to esbuild to make build times faster/reasonable (#1555)
    • Accept a genesis.json file (#1042)
    • Add flag for starting ganache in detached mode (#1001)
    • Add personal_ecRecover and personal_sign (#995)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • 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)
    • Support IPC endpoint (#759)
    • Enhance the database to allow for better UX and determinism (#756)
    • Create Project and set Milestones for Ganache interactive docs (#680)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Add evm_setCode and evm_setStorageAt RPC methods (#649)
    • Add support for eth_call state-overrides (#554)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Implement eth_getProof RPC message (#382)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)

    back to top

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


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.0.3(Mar 2, 2022)

     New Features   Fixes   Changelog   Known Issues   Future Plans 


    We have three new RPC methods and two bug fixes in this release! Thank you to our issue reporter (@robmcl4) and contributors (@rmeissner and @anticlimactic) on this release, we really appreciate it!

    We've changed 11 files across 5 merged pull requests, tallying 2874 additions and 24 deletions, since our last release.


    New Features

    feat: add methods to modify account (#2337)

    This PR adds the evm_setAccountBalance, evm_setAccountCode, and evm_setAccountStorageAt RPC methods. Just as their names suggest, these methods let you set the balance, code, and storage (at a specified slot) for an account.

    evm_setAccountBalance:

    const balance = "0x3e8";
    const [address] = await provider.request({ method: "eth_accounts", params: [] });
    const result = await provider.send("evm_setAccountBalance", [address, balance] );
    console.log(result);
    

    evm_setAccountCode:

    const data = "0xbaddad42";
    const [address] = await provider.request({ method: "eth_accounts", params: [] });
    const result = await provider.send("evm_setAccountCode", [address, data] );
    console.log(result);
    

    evm_setAccountStorageAt:

    const slot = "0x0000000000000000000000000000000000000000000000000000000000000005";
    const data = "0xbaddad42";
    const [address] = await provider.request({ method: "eth_accounts", params: [] });
    const result = await provider.send("evm_setAccountStorageAt", [address, slot, data] );
    console.log(result);
    

    Thanks again to @rmeissner for his awesome work on this PR!

    back to top


    Fixes


    fix: serialize eth_subscribe log data (#2331)

    A previous PR (#2331) fixed how we emit logs on eth_subscribe for EIP-1193 "message" event types, but unintentionally broke those messages for the legacy "data" event types. For those of you still using the legacy event types (cough cough Truffle), this fix should get those events working again.

    back to fixes

    fix: allow hex string for coinbase option in cli (#2405)

    The miner.coinbase option allows you to specify the address to which mining rewards will go as a either a string representing the hex-encoded address or a number representing the index of the account returned by eth_accounts. However, a hex address sent with this option was incorrectly interpreted as a (verrrrrry large) number, causing a startup error. This fix correctly parses the argument so that the option can be used as expected.

    back to fixes

    back to top


    Changelog

    • #2281 docs: remove rc reference from docker instructions (@MicaiahReid)
    • #2389 docs: fix typo in README.md (@anticlimactic)
    • #2337 feat: add methods to modify account (@rmeissner)
    • #2331 fix: serialize eth_subscribe log data (@MicaiahReid)
    • #2405 fix: allow hex string for coinbase option in cli (@davidmurdoch)

    back to top


    Known Issues

    Top Priority:

    • Shutting down the Ganache Server v7.0.0 (#2185)
    • A rejected transaction should possibly be added back into the pool (#2176)
    • Ganache v7.0.0 - typings are broken (#2134)
    • Ganache's provider type is not compatible with Web3 (#2125)
    • ganache forking is not working as expected (#2122)
    • Node.js v12 outputs a µWS warning in the console (#2095)
    • evm_mine and miner_start don't respect --mode.instamine=eager (#2029)

    Coming Soon™:

    • debug_traceTransaction may crash on Node.js v12 (#2106)
    • 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)
    • --db Option Requires Same Mnemonic and Network ID (#1030)
    • 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)
    • System Error when sending batch request with 1 not valid item (#402)

    back to top


    Future Plans

    • Reduce Bundle Size (#2096)
    • Add a way to create or modify arbitrary accounts and storage (#1889)
    • Switch to esbuild to make build times faster/reasonable (#1555)
    • Accept a genesis.json file (#1042)
    • Add flag for starting ganache in detached mode (#1001)
    • Add personal_ecRecover and personal_sign (#995)
    • Support for EIP 1898- Add blockHash to JSON-RPC methods which accept a default block parameter (#973)
    • 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)
    • Support IPC endpoint (#759)
    • Enhance the database to allow for better UX and determinism (#756)
    • Create Project and set Milestones for Ganache interactive docs (#680)
    • idea: add in warning to help switch over to new "pending tx" mode (#674)
    • evm_snapshot ids should be opaque (#655)
    • Add evm_setCode and evm_setStorageAt RPC methods (#649)
    • Add support for eth_call state-overrides (#554)
    • Upgrade custom rpc method evm_mine to return the new block (#536)
    • Implement eth_getProof RPC message (#382)
    • Implement a streaming trace capability (#381)
    • Allow mining to be completely disabled on startup (#248)
    • Add support for eth_getRawTransactionByHash (#135)
    • Log contract events (#45)

    back to top

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


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.0.2(Feb 3, 2022)

     Fixes   Changelog   Known Issues   Future Plans 


    Two more fixes are ready in this release! Thank you to our issue reporters for these bringing these to our attention (@Ruj89 and @davidmurdoch). It means a lot to us that you use Ganache and want to be a part of making it even better.

    In this release we've changed 3 files across 2 merged pull requests, tallying 151 additions and 46 deletions.

    Last call for T-shirts

    If you helped contribute to Ganache v7 in any way, we tagged you in our v7 release notes to let you know you're eligible to receive a limited edition Ganache T-shirt. We've had many of you claim the goods and want to get these bad boys made, but we want to be sure all of our contributors have had the chance to claim them first. If you're on the list¹ and you're interested, email us at [email protected] by Thursday, February 10th to claim.


    Fixes


    Fix how we return logs from eth_subscribe (#2268)

    In an oversight on our end, we unintentionally had a breaking change between Ganache v6 and v7 in which we started aggregating event logs and emitting them once for every transaction that triggered them. Ganache v6 was inline with Geth's logging, which emits separately for each event.

    With this release we've fixed this behavior to once again be inline with Geth. When using eth_subscribe to subscribe to logs, you can expect each emitted contract event to emit a separate log with the following structure:

    {
      type: "eth_subscription",
      data: {
        result: {
            address: address,
            blockHash: blockHash,
            blockNumber: blockNumber,
            data: data,
            logIndex: logIndex,
            removed: removed,
            topics: topics,
            transactionHash: transactionHash,
            transactionIndex: transactionIndex
        },
        subscription: subscriptionId
      }
    }
    

    back to fixes

    Fix type compatibility with Web3 (#2272) (#4743 in ChainSafe/web3.js)

    After the initial release of Ganache v7 we found that our provider type wasn't playing nice with Web3's provider type. After a little digging, we found that both repos had bugs. Our side of the fix is available in this new release, and we've opened a PR in the web3.js repo to fix it on their end. This should be merged in their coming 1.7.1 release. Shout out to the ChainSafe team for getting this merged and for all of the sweet stuff they make.

    back to fixes

    back to top


    Changelog

    • #2272 fix: jsonrpc types and provider compatibility with web3 (@MicaiahReid)
    • #2268 fix: eth_subscribe logs (@MicaiahReid)

    back to changelog

    back to top


    Known Issues

    Top Priority Issues:

    • evm_mine and miner_start don't respect --mode.instamine=eager (#2029)
    • Ganache forking is not working as expected (#2122)
    • Ganache v7.0.0 - typings are broken (#2134)
    • A rejected transaction should possibly be added back into the pool (#2176)
    • Shutting down the Ganache Server v7.0.2 (#2185)
    • Node.js v12 outputs a µWS warning in the console (#2095)
    • ~~Simulating transactions on Ganache v7 fork throws insufficient funds error (#2162)~~
    • ~~Ganache's provider type is not compatible with Web3 (#2125)~~
    • ~~Websocket logs subscription not supported by Geth Client (#2206)~~

    Coming Soon™:

    • 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 (#1245)
    • Uncles aren't fully supported when forking (#786)
    • Forking may fail in weird and unexpected ways. We need to "error better" here (#615)
    • Node.js v12 doesn't handle memory as well as 14+ and may crash computing very large debug_traceTransaction results (#2106)
    • Our bundle size is larger than ideal (#2096)

    back to top


    Future Plans

    • Update the eth_maxPriorityFeePerGas RPC method to return as Geth does, eth_gasPrice - baseFeePerGas (#2097)
    • Add support for the eth_feeHistory RPC method (#1470)
    • Support for enabling eligible draft EIPs before they are finalized or considered for inclusion in a hard fork (#1507)
    • New hard fork support well in advance of the hard fork launch (#2099)
    • Add an eth_createAccessList method (#1056)
    • Track test performance metrics over time (#2105)
    • Track real world Ganache usage (opt-in and anonymized) to better tune performance and drive bug fixes and feature development (#2100)
    • Track test coverage (#2101)
    • evm_mine will return the new blocks instead of just 0x0 (#536)
    • Add new evm_setCode and evm_setStorageAt RPC methods (#649)
    • Make evm_snapshot ids globally unique (unpredictable instead of a counter) (#655)
    • Support eth_getRawTransactionByHash RPC method (#135)
    • Support debug_accountAt RPC method (#813)
    • Allow "mining" to be disabled on start up (#248)
    • Set CLI options via config file, package.json, or ENV vars (#2102)
    • Create a CLI interactive/REPL mode (#2103)
    • Enable a CLI daemon mode (#2104)
    • "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!
    • We've laid the groundwork for additional performance improvements. We expect to see an additional 2-5x speed up for typical testing workloads in the near future.

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

    back to top

    1. Ganache v7 Contributors: @davidmurdoch @MicaiahReid @gnidan @eggplantzzz @kevinweaver @cds-amal @haltman-at @kevinbluer @seesemichaelj @tcoulter @nicholasjpaterno @eshaben @CruzMolina @honestbonsai @domob1812 @moda20 @0xGorilla @fedgiac @FFdhorkin @NicsTr @convexman @rainwater11 @aliveli186 @winksaville @anvacaru @nepoche @gas1cent @Fatorin @0xng @wilwade @MatthiasLohr @alexhultman


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.0.1(Jan 26, 2022)

     Fixes   Changelog   Known Issues   Future Plans 

    Since the release of Ganache v7, we've seen exiting increase in engagement and downloads and an uptick in repo star gazers. Welcome to our new users following along!

    Thank you to all of those who have opened issues (@teknoxic, @PeterYinusa, @NikZak, @haseebrabbani, @gorbak25, @fabianorodrigo), you are a huge help and you keep us humble :sweat_smile:. We've got two fixes out for you today!

    We've changed 13 files across 3 merged pull requests, tallying 247 additions and 86 deletions, since our last release.


    Fixes


    Restructure Errors on eth_call (#2186)

    Before this change, errors from eth_call were formatted in our "non-standard" vmErrorsOnRPCResponse format, which uses the error's data property to store some extra helpful information (program counter, hash, etc.):

    {
       "error": {
         "message": "...",
         "code": ...
         "data": {
              ... bunch of props, like `hash` and `programCounter`...
             "result": "<raw revert hex string>" <---- this moves (See below)
         }
       }
    }
    

    The problem with this approach is that it differs from how a real node handles these errors, causing our users to have to handle eth_call errors differently when using Ganache. Now, the error's data property only contains the raw revert hex string, which should more closely match real node's error handling:

    {
       "error": {
         "message": "...", // <- we'll change the message
         "code": ...
         "data": "<raw revert hex string>"  <---- new home
       }
    }
    

    Our hope is that this will allow users to remove any conditionals handling errors differently between Ganache and real Ethereum nodes.

    back to fixes

    Keep an index to latest block in the persisted database (#2196)

    Ganache wasn't saving a pointer to the "latest" block correctly, so when a persisted database (the dbPath flag) was restarted after block 255 (2^⁸-1) the "latest" block would always be set to block 255 (this pattern would occur again once blocks reached 2¹⁶ - 1, 2²⁴ - 1, 2³² - 1 and so on). Ganache now tracks the index correctly.

    back to fixes

    back to top


    Changelog

    • #2114 docs: remove rc release reference from README (@davidmurdoch)
    • #2186 fix: gethify eth call errors (@MicaiahReid)
    • #2196 fix: keep an index to latest block in the database (@davidmurdoch)

    back to changelog

    back to top


    Known Issues

    Top Priority Issues:

    • evm_mine and miner_start don't respect --mode.instamine=eager (#2029)
    • Ganache forking is not working as expected (#2122)
    • Ganache's provider type is not compatible with Web3 (#2125)
    • Ganache v7.0.1 - typings are broken (#2134)
    • Simulating transactions on Ganache v7 fork throws insufficient funds error (#2162)
    • A rejected transaction should possibly be added back into the pool (#2176)
    • Shutting down the Ganache Server v7.0.1 (#2185)
    • Node.js v12 outputs a µWS warning in the console (#2095)

    Coming Soon™:

    • 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 (#1245)
    • Uncles aren't fully supported when forking (#786)
    • Forking may fail in weird and unexpected ways. We need to "error better" here (#615)
    • Node.js v12 doesn't handle memory as well as 14+ and may crash computing very large debug_traceTransaction results (#2106)
    • Our bundle size is larger than ideal (#2096)

    back to top


    Future Plans

    • Update the eth_maxPriorityFeePerGas RPC method to return as Geth does, eth_gasPrice - baseFeePerGas (#2097)
    • Add support for the eth_feeHistory RPC method (#1470)
    • Support for enabling eligible draft EIPs before they are finalized or considered for inclusion in a hard fork (#1507)
    • New hard fork support well in advance of the hard fork launch (#2099)
    • Add an eth_createAccessList method (#1056)
    • Track test performance metrics over time (#2105)
    • Track real world Ganache usage (opt-in and anonymized) to better tune performance and drive bug fixes and feature development (#2100)
    • Track test coverage (#2101)
    • evm_mine will return the new blocks instead of just 0x0 (#536)
    • Add new evm_setCode and evm_setStorageAt RPC methods (#649)
    • Make evm_snapshot ids globally unique (unpredictable instead of a counter) (#655)
    • Support eth_getRawTransactionByHash RPC method (#135)
    • Support debug_accountAt RPC method (#813)
    • Allow "mining" to be disabled on start up (#248)
    • Set CLI options via config file, package.json, or ENV vars (#2102)
    • Create a CLI interactive/REPL mode (#2103)
    • Enable a CLI daemon mode (#2104)
    • "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!
    • 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.

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

    back to top


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v7.0.0(Jan 20, 2022)

     Highlights   Upgrade Guide and Breaking Changes   New Features   Changelog   Known Issues   Future Plans 


    It's here, it's finally here! The much anticipated (well, at least by us!) Ganache v7 release has now been shipped! This release has been years in the making and we're really proud of the work we've done. We hope you love it as much as we do. If you do, or if you want to keep up with all things Ganache, be sure to give this repository a ⭐ star ⭐.


    Thank you to everyone who has been a part of making this release happen — contributors, mentors, reviewers, issue reporters, and community participators have all been instrumental in making Ganache v7. We are immensely thankful to you all:

    @davidmurdoch @MicaiahReid @gnidan @eggplantzzz @kevinweaver @cds-amal @haltman-at @kevinbluer @seesemichaelj @tcoulter @nicholasjpaterno @eshaben @CruzMolina @honestbonsai @domob1812 @moda20 @0xGorilla @fedgiac @FFdhorkin @NicsTr @convexman @rainwater11 @aliveli186 @winksaville @anvacaru @nepoche @gas1cent @Fatorin @0xng @wilwade @MatthiasLohr @alexhultman

    As a token of our appreciation to our early contributors, we want to send you something real and tangible (sorry, no NFTs at this time 😔). Email [email protected] and we'll verify your identity to get it sent out to you (you'll just need to cover shipping if you're outside the United States). We want to keep it a little on the down-low to keep people from being jealous, but what we can tell you is that it's exclusive, brown, soft, wearable, with two arm holes (it's a t-shirt).


    This is a huge release, so these release notes don't cover everything that's changed. For those gluttons for detail among us that want the comprehensive list, check out the notes from our alpha, beta, and rc releases:

    | Release | Release Date | | ----------------------------------------------------------------------------------------------------- | -----------: | | [email protected] | 2021/08/26 | | [email protected] | 2021/09/21 | | [email protected] | 2021/11/12 | | [email protected] | 2021/11/19 | | [email protected] | 2021/11/24 | | [email protected] | 2021/12/20 | | [email protected] | 2022/01/12 |

    For everyone else, we think these notes do a pretty great job of covering the features and changes that you'll care most about.


    Highlights

    Forking Got an Upgrade

    Ganache's ancestor, Test RPC, was the first tool to introduce forking back in 2016. Ganache 7 takes forking to a new level.

    Zero-Config Mainnet Forking

    Truffle has partnered with Infura to provide free archive node access to Ganache users. Simply run ganache --fork and BOOM, you've forked mainnet at the latest block.

    ganache --fork

    But it doesn't stop there. Use ganache --fork NETWORK to fork the Ropsten, Kovan, Rinkeby and Görli networks.

    SPPPPEEEEEEED

    We've introduced two new caching layers that can reduce the run time of complex forking requests, like debug_traceTransaction, by over 30x!

    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 highlights

    Ganache is Now Ganache

    Before, the Ganache UI application was just Ganache, which used ganache-core, which was also used by ganache-cli. Confused? So were we. Which is why we thought a rename was in order.

    Previously, ganache-core was the core code that powered the Ganache UI and Ganache CLI applications and allowed for programmatic use of Ganache. ganache-cli was a separate application that had to be installed to use Ganache in the command line.

    We've now merged ganache-core and ganache-cli into just ganache. This one tool gives you access to Ganache as a command line application, for programmatic use in Node, or for use in the browser.

    Note: In case you just love typing "-cli", we've left ganache-cli as an alias to ganache, so you can continue using the ganache-cli command in your npm scripts and in your terminal.

    back to highlights

    Use Ganache in the Browser

    Why? We don't really know!

    slack-conversation-release

    But we're pretty sure you, our loyal and talented users, will make something great out of it. To use this feature, simply add the following script to your HTML:

    <script src="https://cdn.jsdelivr.net/npm/ganache@{VERSION}/dist/web/ganache.min.js"></script>
    

    NOTE: The {VERSION} in the above path needs to be replaced with a version number or tag that is listed in npm.

    From there, Ganache is available in your browser for use:

    const options = {};
    const provider = Ganache.provider(options);
    

    NOTE: Currently forking does not work in the browser, but we plan to add support in the future.

    back to highlights

    Huge Transaction Traces

    If you've got transactions, we can trace 'em.™ Ganache can now run debug_traceTransaction on Ethereum's largest and most complex transactions, even those constrained by Node's runtime limitations!

    We're proud of this one and will likely have a blog post coming soon to show off our JS-fu and explain how. For now, our past release notes go into some detail on this feature.

    back to highlights

    back to top


    Upgrade Guide and Breaking Changes

    In short, you can install the new version using:

    npm install ganache --global
    

    We've also written up this handy guide on how to upgrade/install Ganache and to document all breaking changes to look out for.

    back to top


    New Features


    Berlin, London, and Arrow Glacier Hard Fork Support

    Ganache now supports the Berlin, London, and Arrow Glacier hard forks. This means that EIP-2718's Typed Transaction Envelope, EIP-2930's Access List Transaction, and EIP-1559's Fee Market Transaction are all available for use in Ganache.

    The default hard fork has been set to "london". Because of this, any legacy typed transactions (those with no "type" field) that don't supply a gas price, will automatically be upgraded to a "Type 2" EIP-1559 transaction.

    back to new features

    Future Nonces and Queued Transactions

    Ganache now allows you to send what we call "future nonce transactions". These are transactions whose nonce is ahead of that of the sender's account. The transaction isn't immediately executable, so it stays in the transaction pool as a "queued" transaction.

    Once the nonce gap is filled, the queued transaction will be executed automatically. For example, if a brand new account (nonce 0) sends transactions with nonces 1, 2, and 3, all three of these transactions will sit in the "queued" pool. As soon as a transaction from that account is sent with a nonce of 0, the nonce for the account is incremented to 1, so the transaction with nonce 1 is executed. At that point, the account's nonce is 2, so the transaction with nonce 2 is executed. Finally, the account's nonce is 3, so the transaction with account 3 is executed.

    back to new features

    Replacement Transactions

    Replacement transactions are now supported in Ganache v7. This allows any transaction that is pending or queued in the transaction pool to be replaced by another transaction if the gas price of the new transaction is high enough compared to the original.

    To send a replacement transaction, simply send a transaction with the same from and nonce fields as the transaction being replaced with a gas price that is --miner.priceBump (a configurable startup option, defaulted to 10%) higher than the original. Future nonce transactions that are queued up in the transaction pool are also able to be replaced.

    back to new features

    New RPC Endpoints

    RPC methods provide access to Ethereum nodes and to Ganache. We've added some new methods to keep in step with real-world Ethereum nodes and some new custom methods to make your testing experience easier.

    evm_setAccountNonce

    This custom method allows you to (re)write history by setting an account's nonce.

    evm_addAccount/evm_removeAccount

    The evm_addAccount method can be used to add any address to the personal namespace. Ganache will create a fake private key which will then be used for all personal namespace commands sent using that added address. Here's an example of how to use this:

    const zeroAddress = "0x0000000000000000000000000000000000000000"; // let's send transactions from the zero address!
    const transaction = {from: zeroAddress};
    const passphrase = "this is my passphrase";
    // this will fail because we don't "know" the zero address
    await assert.rejects(provider.send("personal_sendTransaction", [{ from: zeroAddress }, passphrase] ));
    
    const added = await provider.send("evm_addAccount", [zeroAddress, passphrase] );
    assert.equal(added, true) // but now we do!
    
    // so now we can send transactions from the zero address!
    const txHash = await provider.send("personal_sendTransaction", [{ from: zeroAddress }, passphrase] ))
    

    The evm_removeAccount method can be used to do just the opposite — it will remove an account from the personal namespace.

    eth_signTypedData_v4

    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.

    eth_maxPriorityFeePerGas

    Ganache now supports the eth_maxPriorityFeePerGas RPC method. Currently, this defaults to returning 1 GWEI. In the future, we may adjust the behavior so it returns the current gas price minus the latest block's baseFeePerGas.

    txpool_content

    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 sender address, and a group of transactions from sender address are grouped by the sender address' nonce.

    Here is an example response:

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

    back to new features

    New Startup Options

    Startup options are now grouped in the chain, database, fork, logging, miner, and wallet namespaces, and should be used as such on startup. For startup options in the CLI, use:

    $ ganache --namespace.option="value"
    

    and when using Ganache programmatically, you can do:

    const options = { namespace: { option: "value"}};
    const provider = ganache.provider(options);
    

    We've also added to, updated, and renamed some startup options. To get a full list of options, you can always run ganache --help in the CLI, or you can check out our documentation. Here are the changes we've made in Ganache v7.

    --miner.coinbase

    The --miner.coinbase option allows you to set the address where mining rewards will go. By default, this is the zero address.

    --miner.instamine

    The --miner.instamine option allows you to configure when in the mining process Ganache returns a transaction's hash. This may sound trivial, but it can have some huge implications, which are covered in detail in this discussion.

    In short, setting --miner.instamine="eager" (the default case), Ganache returns the transaction's hash to the caller after the transaction has been included in a block. This is the same as how Ganache v6 behaved, but differs from real nodes' behavior. Setting --miner.instamine="strict" works like a real node, the transaction's hash is returned before the transaction has been included in a block.

    --miner.priceBump

    The new --miner.priceBump option allows you to specify the percentage increase in the gas price required to replace an existing transaction. For example, if the price bump is set to 10% using --miner.priceBump=10 and a transaction with maxFeePerGas = 100 GWEI and maxPriorityFeePerGas = 1 GWEI is waiting in the transaction pool to be mined, a transaction with maxFeePerGas >= 110 GWEI and maxPriorityFeePerGas >= 1.1 GWEI will be required to replace the existing transaction.

    --server.wsBinary

    The --server.wsBinary option can now be used to set whether websockets should respond with binary data (ArrayBuffers) or strings. The default for this option is set to "auto", which responds with whichever type (binary data or string) you used in the request. Setting --server.wsBinary=true will always respond with binary data and --server.wsBinary=false will always respond with a string.

    --wallet.lock

    The --wallet.secure option has been renamed to --wallet.lock.

    --wallet.passphrase

    This feature allows you to specify a passphrase that will be used for personal namespace commands (personal_unlockAccount, personal_sendTransaction, etc.) on all startup accounts. Before this feature, the default (and only) password for startup accounts was "".

    NOTE: Specifying the wallet.passphrase parameter does not lock accounts by default. The wallet.lock (previously wallet.secure) parameter can be used to lock accounts by default. If wallet.passphrase parameter is used without wallet.lock, the passphrase will still be used when personal_lockAccount is used.

    back to new features

    TypeScript Rewrite and Type Support

    In this release Ganache has been almost completely rewritten from the ground up in TypeScript. With that, we are now exporting types in the published build, though it isn't perfect yet.

    While Ganache is now a TypeScript project, all internal components are shipped in a bundle to improve installation time. While there are lots of tools to bundle JavaScript, the tools to bundle (or "rollup") these types aren't very mature and result in some strange types. We are now using ApiExtractor to generate our rollup types, as it works well for most of the types we need to export with one exception — it likes to rename types:

    messed-up-types

    EthereumProvider_2 in the above image should be EthereumProvider.

    You find many other strangely named types in this version, as well as many types that aren't exported, but should be. We will have a fix out for this in the future.

    back to new features

    New Event System

    In addition to EIP-1193's "message" event and the legacy "data" event, Ganache emits 3 additional events: "ganache:vm:tx:before", "ganache:vm:tx:step", and "ganache:vm:tx:after".

    These events can be used to observe the lifecycle of any transaction executed via eth_sendTransaction, personal_sendTransaction, eth_sendRawTransaction, eth_call, debug_traceTransaction, or debug_storageRangeAt.

    These share the event paradigm that Truffle uses, but without any of the wildcard handling, i.e., no "vm:*" support (for now).

    Each of these events will emit a context object which is a unique object that can be used to identify a transaction over the course of its lifecycle. For example:

    interface StepEvent {
      account: {
        nonce: bigint;
        balance: bigint;
        stateRoot: Buffer;
        codeHash: Buffer;
      };
      address: Buffer;
      codeAddress: Buffer;
      depth: number;
      gasLeft: bigint;
      gasRefund: bigint;
      memory: Buffer;
      memoryWordCount: bigint;
      opcode: {
        name: string;
        fee: number;
      };
      pc: number;
      returnStack: Buffer[];
      stack: Buffer[];
    }
    const contexts = new Map();
    provider.on("ganache:vm:tx:before", (event: { context: {} }) => {
      contexts.set(event.context, []);
    });
    provider.on("ganache:vm:tx:step", (event: StepEvent) => {
      contexts.get(event.context).push(event.data);
    });
    provider.on("ganache:vm:tx:after", (event: { context: {} }) => {
      doAThingWithThisTransactionsSteps(contexts.get(event.context));
      contexts.delete(event.context);
    });
    

    The reason this context is necessary is that Ganache may run multiple transactions simultaneously, so "ganache:vm:tx:step" events from different transactions could be intermingled.

    The above events will be emitted for eth_call, eth_sendTransaction, personal_sendTransaction, eth_sendRawTransaction, debug_traceTransaction, and debug_storageRangeAt.

    Currently, we do not await the event listener's return value, however, we'll likely enable this in the future.

    back to new features

    Dropping Node 8 & 10, Adding Node 17

    We are dropping support for Node.js versions 8 and 10 in the Ganache v7 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.

    We've also added support for Node versions up to v17.

    back to new features

    back to top


    Changelog

    • #657 refactor: rewrite into a TypeScript monorepo, partial (@davidmurdoch)
    • #614 fix: add debug_traceTransaction RPC method (@tcoulter)
    • #665 fix: switch to SecureTrie (@davidmurdoch)
    • #666 fix: don't overwrite existing initial accounts (@davidmurdoch)
    • #667 test(eth_getCode): add tests for contract factories (@davidmurdoch)
    • #668 feat: add option to use gas estimate on send tx (@davidmurdoch)
    • #679 docs: update docs for GH Pages (@davidmurdoch)
    • #703 chore: move chain packages to a subfolder (@seesemichaelj)
    • #708 feat: change CLI to dynamically generate args from flavor options (@seesemichaelj)
    • #725 chore: ignore folders that are packages from another branch (@seesemichaelj)
    • #731 chore: fix windows node 10.7.0 CI by updating npm (@davidmurdoch)
    • #721 chore: polish cli (@davidmurdoch)
    • #732 feat: handle mutually exclusive args in cli (@davidmurdoch)
    • #734 chore: lighten up github ci to enhance dev experience (@seesemichaelj)
    • #737 fix: update types on wallet legacy options (@seesemichaelj)
    • #738 chore: add "push" action to "build all" on develop (@seesemichaelj)
    • #739 chore: fix readme badges and drop macos (@davidmurdoch)
    • #741 chore: update build-status badge image (@davidmurdoch)
    • #745 chore: ensure logo is centered on npm (@davidmurdoch)
    • #748 chore: add start and build info to contributing.md (@davidmurdoch)
    • #749 chore: use our "sweet treat" mnemonic in readme.md (@davidmurdoch)
    • #740 chore: rename ganache-cli to ganache in readme (@davidmurdoch)
    • #750 chore: fix launch.json example in contributing.md (@davidmurdoch)
    • #769 fix(docs): update contributing url in readme to full path (@kevinbluer)
    • #733 fix: ensure path sep is always / in link-ts-references.ts (@davidmurdoch)
    • #770 fix(ethereum): ensure randomBytes can return 0-255 (@davidmurdoch)
    • #785 fix(cli): enable SIGINT to shutdown cli on Windows (@davidmurdoch)
    • #777 chore: enabling building from root (@davidmurdoch)
    • #792 feat: allow mining many blocks via evm_mine (@davidmurdoch)
    • #793 fix(docs): fix docs for evm_mine (@davidmurdoch)
    • #794 refactor: use WEI constant in test (@davidmurdoch)
    • #779 feat: log warning on legacy-style eth_getTransactionReceipt calls (@eggplantzzz)
    • #796 docs: add request diagram to @ganache/core (@davidmurdoch)
    • #795 refactor: replace seedCounter w/ an instance prng (@davidmurdoch)
    • #771 fix: set difficulty default to 1 and add totalDifficulty (@eggplantzzz)
    • #800 chore: update marked to v2.0.0 (@davidmurdoch)
    • #789 chore: remove dead code in runtime-block.ts (@davidmurdoch)
    • #801 chore: update root dev dependencies (@davidmurdoch)
    • #790 fix: calculate block size correctly (@davidmurdoch)
    • #755 feat: add support for debug_storageRangeAt RPC (@eshaben)
    • #766 feat: throw exception when conflicting options are passed to the provider (@tcoulter)
    • #803 docs: improve usefulness of readme.md and contributing.md (@eshaben)
    • #819 chore: use consistent capitalization and punctuation in readme (@eshaben)
    • #809 perf: optimize debug_storageRangeAt (@davidmurdoch)
    • #857 fix: hex encode hash in eth_getTransactionReceipt notice (@davidmurdoch)
    • #874 chore: point community link at our discord channel (@davidmurdoch)
    • #884 chore(deps): bump y18n from 4.0.0 to 4.0.1 (dependabot[bot])
    • #877 fix: rearchitect server status and move async functions from constructors to initialize functions (@seesemichaelj)
    • #888 feat: add filecoin flavor (@seesemichaelj)
    • #893 fix: support a uws fallback if uws native binaries don't exist (win+electron) (@seesemichaelj)
    • #816 fix: make random seed actually random (@davidmurdoch)
    • #892 refactor: increase the default ether balance for created accounts to 1000 (@eggplantzzz)
    • #909 fix(docs): ensure Error object can be logged to console (@davidmurdoch)
    • #908 feat: forking (@davidmurdoch)
    • #907 chore: general clean up for publishing (@davidmurdoch)
    • #918 chore(deps): bump ws in /src/chains/ethereum/ethereum (dependabot[bot])
    • #920 chore(deps-dev): bump ws from 7.3.1 to 7.4.6 in /src/packages/core (dependabot[bot])
    • #919 chore(deps-dev): bump ws from 7.3.1 to 7.4.6 (dependabot[bot])
    • #921 chore(deps-dev): bump ws in /src/chains/filecoin/filecoin (dependabot[bot])
    • #882 feat: add dockerfile for Docker Hub container image (@kevinbluer)
    • #923 feat: change miner.gasPrice option to miner.defaultGasPrice (@davidmurdoch)
    • #925 fix(debug_traceTransaction): make sure we dont run all the txs in a block when debugging them (@davidmurdoch)
    • #817 feat: allow starting up with 0 accounts (@davidmurdoch)
    • #928 fix(cli): miner.difficulty should accept strings (@davidmurdoch)
    • #926 fix: signed raw transactions must always have a nonce (@davidmurdoch)
    • #929 fix(forking): ignore txs that fail when running the block in traceTransaction (@davidmurdoch)
    • #930 fix(forking): ensure forked receipt logs work (@davidmurdoch)
    • #932 fix: use correct RPC method for gasPrice (@davidmurdoch)
    • #934 chore: automate release (@davidmurdoch)
    • #937 fix: add Iuri Matias back to license (@davidmurdoch)
    • #895 fix: upgrade @trufflesuite/uws-js-unofficial to use better polyfill (@seesemichaelj)
    • #946 fix: remove trfl.co links (@davidmurdoch)
    • #1044 chore: rename ganache-core to ganache (@davidmurdoch)
    • #1045 fix: remove phrase from cli help messages (@davidmurdoch)
    • #1046 fix: remove extra space from CLI version string (@davidmurdoch)
    • #944 fix: support node 16 (@davidmurdoch)
    • #1058 fix: switch back to lockfileVersion: 1 (@davidmurdoch)
    • #1065 fix: increase max payload size to match geth (@davidmurdoch)
    • #1068 chore: add alpha branch to CI (@davidmurdoch)
    • #943 fix: add EIP2930 Access List Transactions (@micaiahreid)
    • #1097 fix: websocket error timeout issue by updating uws to .12 (@davidmurdoch)
    • #1117 fix: make sure zero address is always signed with the same key (@davidmurdoch)
    • #1135 feat: london (@davidmurdoch)
    • #1199 fix: verify chain id in type 1 and 2 transactions (@davidmurdoch)
    • #1226 docs: add link to ganache-cli-archive (@davidmurdoch)
    • #1227 fix: handle initialization errors on server.listen, handle fallback rejections (@davidmurdoch)
    • #1323 docs: update evm_revert documentation (@davidmurdoch)
    • #1253 fix: use new url shortener links (@davidmurdoch)
    • #1407 docs: call out ganache-cli@latest documentation loudly (@davidmurdoch)
    • #1103 chore(deps): bump tar from 4.4.16 to 4.4.19 (dependabot[bot])
    • #1339 perf: add a disk cache for forking requests (@davidmurdoch)
    • #1519 chore: update min Node.js version to 12.0.0, add support for Node.js v17 (@davidmurdoch)
    • #1551 fix: make web builds work (@davidmurdoch)
    • #1593 fix: make web3_sha encode data correctly (@davidmurdoch)
    • #1513 fix: improve account locking (@micaiahreid)
    • #1588 chore: revert to node 14 for release (@davidmurdoch)
    • #1524 feat: add support for arrowGlacier hard fork (@davidmurdoch)
    • #1587 fix: make the quiet flag actually work (@davidmurdoch)
    • #1553 chore: ensure new packages can be published (@davidmurdoch)
    • #1518 chore: update bufferutil and utf-8-validate (@davidmurdoch)
    • #1537 fix: make forking chainId aware (@davidmurdoch)
    • #1579 feat: integrate with infura (@davidmurdoch)
    • #1591 fix: remove bigint's n from cli output (@davidmurdoch)
    • #1589 fix: return error for eth_call when call errors (@davidmurdoch)
    • #1610 chore: prepare for beta release (@davidmurdoch)
    • #1650 fix: update equality checks for replacement transactions to prevent erroneous underpriced errors (@micaiahreid)
    • #1614 docs: update README badge to beta version (@davidmurdoch)
    • #1613 fix: make docker publish work (@davidmurdoch)
    • #1592 fix: async request processing (@davidmurdoch)
    • #1662 fix: don't return an error from miner_start if aleady started (@davidmurdoch)
    • #1731 fix: parse cli time option correctly (@davidmurdoch)
    • #1732 fix: don't alter metadata state during eth_estimateGas (@davidmurdoch)
    • #1661 fix: ensure eth_sendTransaction returns the correct error when the account has insufficient funds (@davidmurdoch)
    • #1740 fix: prevent DEBUG env var from crashing ganache (@davidmurdoch)
    • #1738 fix: correct bad type (@davidmurdoch)
    • #1737 fix: permit using legacy fork.provider where appropriate (@davidmurdoch)
    • #1769 chore: drop support for Node.js-unsupported odd-numbered node versions (@davidmurdoch)
    • #1780 fix: version disparity between startup/web3_clientVersion (@micaiahreid)
    • #1842 fix: reject transactions with insufficient funds (@davidmurdoch)
    • #1829 fix: update callGasLimit to match geth's (@davidmurdoch)
    • #1781 feat: export typescript types in build (@davidmurdoch)
    • #1871 fix: make Tag type usable (@davidmurdoch)
    • #1873 build: ensure filter-shrinkwrap runs at release (@davidmurdoch)
    • #1861 fix: fix typo in evm_setTime docs (@gas1cent)
    • #1973 fix: update gas limit to 30M (@davidmurdoch)
    • #1972 docs: add docs for docker to readme (@davidmurdoch)
    • #1539 feat: add txpool_content RPC method. (@domob1812)
    • #1990 fix: include impersonated accounts in eth_accounts (@davidmurdoch)
    • #1980 fix: eth_call should use the same baseFee as given block num (@davidmurdoch)
    • #1992 chore: increase test timeout for slow CI (@davidmurdoch)
    • #1989 fix: update leveldb-related packages (@davidmurdoch)
    • #2013 feat: replace legacyInstamine option with instamine=eager|strict (@davidmurdoch)
    • #2037 chore: remove canary, add rc to release branches (@micaiahreid)
    • #2041 fix: update README to be for rc (@micaiahreid)
    • #2046 chore: update create script for latest typescript (@davidmurdoch)

    back to changelog

    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 (#1245)
    • Uncles aren't fully supported when forking (#786)
    • Forking may fail in weird and unexpected ways. We need to "error better" here (#615)
    • Node.js v12 outputs a µWS warning in the console (#2095)
    • Node.js v12 doesn't handle memory as well as 14+ and may crash computing very large debug_traceTransaction results (#2106)
    • Our bundle size is larger than ideal (#2096)

    back to top


    Future Plans

    • Update the eth_maxPriorityFeePerGas RPC method to return as Geth does, eth_gasPrice - baseFeePerGas (#2097)
    • Add support for the eth_feeHistory RPC method (#1470)
    • Support for enabling eligible draft EIPs before they are finalized or considered for inclusion in a hard fork (#1507)
    • New hard fork support well in advance of the hard fork launch (#2099)
    • Add an eth_createAccessList method (#1056)
    • Track test performance metrics over time (#2105)
    • Track real world Ganache usage (opt-in and anonymized) to better tune performance and drive bug fixes and feature development (#2100)
    • Track test coverage (#2101)
    • evm_mine will return the new blocks instead of just 0x0 (#536)
    • Add new evm_setCode and evm_setStorageAt RPC methods (#649)
    • Make evm_snapshot ids globally unique (unpredictable instead of a counter) (#655)
    • Support eth_getRawTransactionByHash RPC method (#135)
    • Support debug_accountAt RPC method (#813)
    • Allow "mining" to be disabled on start up (#248)
    • Set CLI options via config file, package.json, or ENV vars (#2102)
    • Create a CLI interactive/REPL mode (#2103)
    • Enable a CLI daemon mode (#2104)
    • "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!
    • 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.

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

    back to top


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 12, 2022)

     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! :tada: 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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Dec 21, 2021)

     Highlights    Breaking Changes    New Features   Fixes    Known Issues   Future Plans 


    This release is the third beta release of the new and improved Ganache v7.0.0. You'll definitely want to catch up on the previous changes from the first and second beta, 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 Trufflers and community members for reporting and commenting on issues fixed by this release: @kevinweaver, @cds-amal, @gnidan, @eggplantzzz, @davidmurdoch, and @fedgiac!

    Note: this is a beta release; even these 7.0.0 release notes are "beta" and the information here is likely incomplete. There may still be bugs and kinks to work out before we ship things off to rc (release candidate), then finally to latest. You absolutely should use this beta release, please do try it out and let us know if breaks for you!

    To install globally run:

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


    Highlights

    We've changed 196 files across 15 merged pull requests, tallying 16,693 additions and 28,515 deletions, since our last beta release.

    This release contains one small feature and a few bug fixes. Do continue to open new issues and questions; we're loving the feedback, questions, and issues coming in from everyone trying out these releases ❤️

    back to top


    Breaking Changes

    Reject transactions with insufficient funds (#1842)

    The ganache-cli v6 and ganache-core v2 packages used to allow transactions with a tx.gasLimit * tx.gasPrice + tx.value < account.balance into the transaction pool. Ganache v7 will now immediately reject transactions that meet that condition with an "insufficient funds for gas * price + value" error message (with a code of -32003).

    back to top


    New Features

    Export typescript types in published build (#1716 #1871)

    Ganache is a TypeScript project, but all internal components are shipped in a bundle to improve installation time. While there are lots of tools to bundle JavaScript, the tools to bundle (or "rollup") these types aren't very mature and result in some strange types. We are now using ApiExtractor to generate our rollup types, as it works well for most of the types we need to export with one exception — it likes to rename types:

    EthereumProvider_2

    EthereumProvider_2 in the above image should be EthereumProvider.

    You'll find many other strangely named types in this version, as well as many types that aren't exported, but should be. Expect the types to change in future.

    back to top


    Fixes


    We've removed the chainId from eth_sign (#1716)

    We were previously including the chainId when signing a message via eth_sign but chainId does not need to be included for message signatures created via eth_sign. If you have any tests updated to work with a pre-release v7 that relied on the value returned by eth_sign those tests may break due to this change.

    back to fixes

    Fix Transaction Defaults (#1730)

    Before a transaction is mined, its value and data (aka input) fields could possibly be undefined. Once the transaction is mined (which, in most cases is immediately), the transaction data is serialized and those undefined values are converted to 0x, which is the desired value for both the value and data when the fields are omitted by the user.

    If a transaction is sent with a future nonce, however, it isn't immediately mined. If that transaction is retrieved via eth_getTransactionByHash, it has not yet been serialized. As such those two fields are undefined and completely missing from the resulting transaction object. Now, we give default values of 0 for value and 0x for data when those fields are missing from a transaction.

    back to fixes

    Stop Altering State on eth_estimateGas(#1732)

    Estimating a transaction's gas requires that the transaction is run on the EVM, but it shouldn't alter the state of the EVM permanently. This fix adds additional VM checkpoints that are subsequently reverted to prevent the state from being altered.

    back to fixes

    Fix --chain.time Parsing (#1731)

    The --chain.time startup option allows you to start Ganache with the EVM time set to the specified time. Previously, we weren't parsing this value correctly, causing startup to fail when this option was specified. Now, you can use this option to test your contracts in the past, present, or future!

    back to fixes

    Fix Insufficient Balance Error (#1661)

    When eth_sendTransaction is used to send a transaction from an account that doesn't have enough funds to pay for the transaction, the VM returns an error that requires a transaction.getSenderAddress().toString() property. Previously, the transaction that Ganache supplied to the VM didn't have this property, resulting in a malformed error.

    back to fixes

    Prevent DEBUG env var from crashing Ganache (#1740)

    An external dependency was using the DEBUG environment variable in a way that would cause an exception within Ganache. We've removed the code that was causing the issue.

    back to fixes

    Update callGasLimit to match geth's (#1829)

    Our previous default callGasLimit was Number.MAX_SAFE_INTEGER, we've reduced this default to a more reasonable 50_000_000, which matches Geth's current default limit.

    back to fixes

    Permit using legacy fork.provider (#1737)

    A bug prevented "legacy" providers (providers that don't implement EIP-1193's request method) from working with Ganache v7 forking.

    back to fixes

    Fix version disparity between startup/web3_clientVersion(#1780)

    The web3_clientVersion version was always one version behind the actual version.

    back to fixes

    back to top


    Known Issues

    • evm_setAccountNonce is race-conditiony (#1646)
    • --miner.callGasLimit implementation is wrong (#1645)
    • eth_call with fork is not always behaving as it should in beta version (#1547)
    • 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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Nov 25, 2021)

     Highlights    Fixes    New Features   Known Issues   Future Plans 


    This release is the second beta 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 and beta releases and provided feedback! You have been immensely helpful!

    Special thanks to Trufflers and community members for reporting and commenting on issues fixed by this release: @MicaiahReid, @0xGorilla, @MatthiasLohr, @0xng, and @FFdhorkin!

    Note: this is a beta release; even these 7.0.0 release notes are "beta" and the information here is likely incomplete. There may still be bugs and kinks to work out before we ship things off to rc, then finally to latest. You absolutely should use this beta release, please do try it out and let us know if breaks for you!

    To install globally run:

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


    Highlights

    We've changed 15 files across 6 merged pull requests, tallying 204 additions and 39 deletions, since our last beta release.

    This release is a a bit light on the changes this time around. We wanted to get a quick release out before the team here at Truffle takes a few days off to be with family over the Thanksgiving holiday here in the USA.

    This release contains some small bug fixes and a new config option. Do continue to open new issues and questions while we're away; we're loving the feedback, questions, and issues coming in from everyone trying out these releases ❤️

    back to top

    Fixes


    Fix Transaction Replacement (#1650)

    When a transaction is in the transaction pool, it can be replaced by sending another transaction with the same nonce and with an extra premium on the gas price. This priceBump is a percentage that is set by a node and dictates how much that extra premium needs to be in order to replace an existing transaction.

    Before this fix, Ganache would only replace transactions with gas price greater than the priceBump percentage. So, when MetaMask or some other wallet's "cancel transaction" feature was used, which sets the replacement transaction's gas price to exactly priceBump more than the original, Ganache would reject the replacement transaction as underpriced. With this fix, Ganache will replace transactions with gas price greater than or equal to the priceBump percentage.

    This fix also aligns us closer with how Geth handles replacement transactions after the introduction of EIP-1559 transactions. Previously, we would compare the effectiveGasPrice of the existing and replacement transaction. The effectiveGasPrice represents the lesser value between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas. If the replacement transaction's effectiveGasPrice was greater than the existing transaction's effectiveGasPrice by greater than priceBump percent, we'd call it a valid replacement. Geth, however, requires that both the maxFeePerGas and the maxPriorityFeePerGas are greater in the replacement transaction, so we've updated ourselves to match.

    back to fixes

    Fix async request processing (#1592)

    A misconfiguration of the default options on startup caused all requests to be executed sequentially. Thanks goes to @0xGorilla for finding this issue!

    back to fixes

    Don't return an error from miner_start if already started (#1632)

    A quick and easy fix! When using legacyInstamine mode miner_start used to return an RPC error if the miner was already started. Now it doesn't 🤯

    back to fixes

    back to top


    New Features


    Add a miner.priceBump Option (#1650)

    The new --miner.priceBump option allows you to specify the percentage increase in the gas price required to replace an existing transaction. For example, if --miner.priceBump=10 (the default) is used on startup and a transaction with maxFeePerGas = 100 GWEI and maxPriorityFeePerGas = 1 GWEI is waiting in the transaction pool to be mined, a transaction with maxFeePerGas >= 110 GWEI and maxPriorityFeePerGas >= 1.1 GWEI will be required to replace the existing transaction.

    back to features

    Add eth_maxPriorityFeePerGas RPC Method (#1658)

    Ganache now supports the eth_maxPriorityFeePerGas RPC method. Currently, this defaults to returning 1 GWEI. In the future, we may adjust the behavior so it returns the current gas price minus the latest block's baseFeePerGas.

    back to features

    back to top


    Known Issues

    • evm_setAccountNonce is race-conditiony (#1646)
    • --miner.callGasLimit implementation is wrong (#1645)
    • eth_call with fork is not always behaving as it should in alpha version (#1547)
    • Our TypeScript types aren't properly exported (#1412)
    • 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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Nov 19, 2021)

     Highlights    New Features   Breaking Changes    Fixes    Known Issues   Future Plans 


    This release is the first beta 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 thanks again 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: @domob1812, @NicsTr, @convexman, and @rainwater11!

    Note: this is a beta release; even these 7.0.0 release notes are "beta" and the information here is likely incomplete. There may still be bugs and kinks to work out before we ship things off to rc, then finally to latest. You absolutely should use this beta release, please do try it out and let us know if breaks for you!

    To install globally run:

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


    Highlights

    We've changed 70 files across 12 merged pull requests, tallying 2,616 additions and 65,747 deletions, since our last release. The high number of deletions is due to reverting our lock files back to v1, as we aren't yet confident in npm 7+'s stability.

    This release fixes many bugs and adds some new features, but there is one that we are really excited about:

    Free integrated archive data for Mainnet, Ropsten, Kovan, Rinkeby, and Görli!

    You can now run your own fork of Ethereum's Mainnet with a simple command:

    ganache --fork

    which will automatically connect to a Mainnet Node with full Archive Data, for free! 🤯

    Full announcement is below.

    back to top

    New Features

    Other than the big Infura + Ganache integration feature mentioned above, we've also added a couple of smaller features that we hope will improve the development experience.



    Integrate Infura into Ganache forking (#1513)

    This is a big deal! You now have free access to Infura²'s archive data for Ethereum's Mainnet, Ropsten, Kovan, Rinkeby, and Görli networks built right into Ganache itself!

    The command ganache --fork will fork Ethereum's Mainnet at the latest block number with access to full archive data.

    ganache --fork

    We currently don't impose restrictions outside of the default limits provided by Infura, but will monitor usage closely in order to limit abuse so we can continue to provide this resource to you for free.

    You can also fork from Ropsten, Kovan, Rinkeby, and Görli:

    $ ganache --fork ropsten
    $ ganache --fork kovan
    $ ganache --fork rinkeby
    $ ganache --fork görli
    $ ganache --fork goerli
    

    If you prefer using Ganache's option namespaces you can use:

    $ ganache --fork.network mainnet
    $ ganache --fork.network ropsten
    $ ganache --fork.network kovan
    $ ganache --fork.network rinkeby
    $ ganache --fork.network görli
    $ ganache --fork.network goerli
    

    You can also use this feature programmatically:

    import Ganache from "ganache";
    
    const server = Ganache.server({
      fork: {
        network: "mainnet"
      }
    });
    server.listen(8545, () => {
      const liveOptions = provider.getOptions();
    
      console.log("forked network: " + liveOptions.fork.network);
      console.log("forked at block: " + liveOptions.fork.blockNumber.toString());
      console.log("listening on 8545");
    });
    

    This feature is made possible by our close relationship with Infura.

    Please let us know if you have problems, questions, or suggestions!

    back to features

    Add a wallet.passphrase Option (#1513)

    This feature allows you to specify a passphrase that will be used for personal namespace commands (personal_unlockAccount, personal_sendTransaction, etc.) on all startup accounts. Before this feature, "" was the default (and only) password for startup accounts.

    NOTE: Specifying the wallet.passphrase parameter does not lock accounts by default. The wallet.lock (previously wallet.secure) parameter can be used to lock accounts by default. If wallet.passphrase parameter is used without wallet.lock, the passphrase will still be used when personal_lockAccount is used.

    back to features

    Add evm_addAccount/evm_removeAccount RPC Methods (#1513)

    The evm_addAccount method can be used to add any address to the personal namespace. Ganache will create a fake private key which will then used for all personal namespace commands sent using that added address. Here's an example of how to use this:

    const address = "0x0000000000000000000000000000000000000000"; // let's send transactions from the zero address!
    const transaction = {from: address};
    const passphrase = "this is my passphrase";
    // this will fail because we don't "know" the zero address
    await assert.rejects(provider.send("personal_sendTransaction", [{ from: address }, passphrase] ));
    
    const added = await provider.send("evm_addAccount", [address, passphrase] );
    assert.equal(added, true) // but now we do!
    
    // so now we can send transactions from the zero address!
    const txHash = await provider.send("personal_sendTransaction", [{ from: address }, passphrase] ))
    

    The evm_removeAccount method can be used to do just the opposite — it will remove an account from the personal namespace.

    back to features

    Add support for the "arrowGlacier" hardfork (#1524)

    We updated ethereumjs-vm, and related packages, add added support for the "arrowGlacier" hardfork which is set to activate at block number 13,773,000 which is predicted to occur on December 8, 2021.

    This hardfork introduces a single change: it pushes the difficulty bomb back several months. This doesn't affect Ganache, other than accepting the hardfork name in our options.

    back to features

    back to top


    Breaking Changes

    We've replaced some previous alpha features and errors (#1513)

    In the [email protected] release, we introduced the evm_unlockUnknownAccount and evm_lockUnknownAccount RPC methods, and we since realized that these could be made simpler to use with a few tweaks. So, the breaking part of this change is that these methods have been removed. The good news is that they've been replaced with evm_addAccount and evm_removeAccount, which is explained in more detail in the features section of these notes.

    We've also updated some error messaging to encourage the use of passphrases over passwords. So, the original error signer account is locked error changed to authentication needed: password or unlock in [email protected] and has (hopefully!) finally settled on authentication needed: passphrase or unlock in the beta. We doubt this will actually break anything for our users, but we thought we'd mention it just in case.

    back to top


    Fixes

    We've got a handful of fixes in the release, some big (like making forking "chainId-aware"), some small. Thanks again to users who opened issued or provided feedback on these issues!



    Fix account locking/unlocking (#1513)

    Starting up Ganache creates a set of accounts and saves their private/public keys to an encrypted¹ keyfile, or so we thought. It turns out that there were some cases where the keyfile wasn't properly initialized. So, when an account was locked via personal_lockAccount, it was removed from our whitelist of "unlocked" accounts, never to be found again. When an attempt to unlock the account via personal_unlockAccount would then be made, the private key for the account wouldn't be found and the unlock would fail.

    Now, we properly store accounts in the keyfile, so all accounts in the personal namespace can be locked and unlocked.

    back to fixes

    Make web3_sha encode data correctly (#1593)

    We were previously treating the data as utf-8 instead of hex.

    Now we do things the right way.

    back to fixes

    Make the quiet flag actually work (#1587)

    The command ganache --quite wasn't making Ganache be quiet.

    Now it does.

    back to fixes

    Make forking chainId aware (#1537)

    Previous versions of Ganache applied the local hardfork rules to eth_call and debug_traceTransaction calls run in the context of a block that should be executed under different hardfork rules.

    This bug may have caused results to be incorrect in cases where new opcodes were added, gas costs changed, or new transaction types added in hardforks.

    This fix makes the assumption that the result of a call to eth_chainId will accurately identify the chain (Mainnet = 1, Görli = 5, etc).

    back to fixes

    Fix Blake2-256 calculation (#1524)

    There was a bug in @ethereumjs/vm package - blake2-256 precompile (see EIP-152) was implemented incorrectly. This was fixed in a newer version and we've upgraded the package in this release.

    back to fixes

    Remove bigint's n from cli output (#1591)

    Startup display on Ganache 7.0.0-alpha.2 included an "n" after some numbers. This release properly prints the numbers without the n suffix.

    back to fixes

    Return error for eth_call when call errors (#1589)

    We incorrectly were requiring the use of our vmErrorsOnRPCResponse flag in order to return eth_call revert messages and errors.

    back to fixes

    back to top


    Known Issues

    • eth_call is not behaving as it should in alpha version (#1547)
    • asyncRequestProcessing doesn't default to true like it is supposed to (#1532)
    • Our TypeScript types aren't properly exported (#1412)
    • 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

    • Forking support for EVM compatible chains Arbitrum Rollup, Optimistic Ethereum, and Polygon PoS!
    • 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


    1. The keyfile isn't always encrypted on start up. If the user starts up Ganache with all accounts unlocked with the default passphrase ("") we will keep the unencrypted private keys in memory.
    2. If you don't know already, Infura provides access to Ethereum networks.

    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Nov 13, 2021)

     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 to latest. 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:

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


    Highlights

    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:

    • Much faster forking performance! We've introduced two new caching layers that can reduce the run time of complex forking requests, like debug_traceTransaction, by over 30x!
    • Support for transaction traces over 1 GB in size
    • Pre-built Docker containers and GitHub packages
    • Dropped support for Node.js v10 (and v11)
    • Added support for Node.js v17
    • and more...

    back to top

    Breaking Changes

    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


    Fixes

    So. Many. Fixes.


    Fixes 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 previous gasPrice would cause a type-2 transaction to have a different effectiveGasPrice before and after saving to Ganache's database. Now, we store the effectiveGasPrice 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:

    1. do we have an executable transaction in the transaction pool from the same account?
    2. if so, does this new transaction have the same nonce as the one already in the pool?
    3. if so, is this new transaction's gas price better?
    4. if so, replace the previous transaction with this new one.

    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 to Ganache.server resulted in any initialization exceptions their rejection will be deferred until the callback or fulfillment of this listen 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 the baseFeePerGas 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 using JSON.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 the JSON.stringifyication 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


    New Features

    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:

    docker run --publish 8545:8545 trufflesuite/ganache:alpha --accounts 20
                                                             ^^^^^^^^^^^^^^
    

    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


    Known Issues

    • Ganache doesn't really lock accounts (#996)
    • 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 to true like it is supposed to (#1532)
    • web_sha3 should accept a hex-encoded string (#1375)
    • Our TypeScript types aren't properly exported (#1412)
    • Forking's chainId shouldn't match the remote chain. We really should use a different chainId than the remote, but still be able to contextualize past transactions with their original chainId (#628)
    • 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
    • Our bundle size is larger than ideal

    back to top


    Future Plans

    • 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!
    • Integrate with Infura: e.g., ganache --fork mainnet to fork mainnet via your own Infura account.
    • 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


    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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Sep 21, 2021)

     Highlights    Breaking Changes    Fixes    New Features   Known Issues   Future Plans 


    This release is the second 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!

    But first, 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 to latest. 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:

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


    Highlights

    • Added Berlin's EIP-2930 Access List Transactions

    • Added "london" hardfork support with EIP-1559 Fee Market Transactions

    • Added a new provider event system

    back to top

    Breaking Changes

    The default hardfork has changed to "london"

    We generally do not consider hardfork updates to be "breaking changes" in the semver sense, and they don't ever warrant a major version bump on their own. Regardless, we're listing the changes that are likely to cause your tests to fail here, instead of in the list of features, as it seems helpful to separate them out.

    The London hardfork changes many things about the way Ethereum works, and many of these changes might cause your tests to break and fail. We've outlined the most common changes here:

    Non-zero gas prices are not permitted

    A side effect of the updating to London is that transactions can no longer be sent with a gasPrice of 0. The reason for this is that blocks automatically adjust the minimum gas price from one block to another. We'll be adding a feature flag to allow for zero-gasPrice transactions in the future. If you need zero-gasPrice transactions now you'll have to set the --hardfork flag to "berlin" or earlier.

    Legacy transactions sent via eth_sendTransaction are automatically upgraded to "Type 2" (EIP-1559) transactions.

    If you send a transaction with eth_sendTransaction and that transaction doesn't have a gasPrice field the transaction will be automatically "upgraded" to a type 2 transaction. Type 2 transactions will have many different fields for an identical legacy transaction sent pre-london.

    // send a "legacy" transaction
    const hash = await provider.request("eth_sendTransaction", [{ from }]); 
    const tx = await provider.request("eth_getTransactionByHash", [hash]);
    // The returned `type` field indicates it was updated to a type 2 transaction
    assert.strictEqual(tx.type, "0x2");
    

    New fields enabled by EIP-1559:

    • maxPriorityFeePerGas:
      • Gas price above the block's base gas price you'll pay the miner.
      • currently defaults to 0, but we'll likely change this before v7.0.0.
    • maxFeePerGas:
      • The maximum gas price you'll pay for the transaction.
      • For eth_sendTransaction, this value is defaulted to the maximum possible block base gas price over the next 3 blocks (the fee can theoretically increase by a maximum of 12.5% per block).
      • If the transaction cannot be included within the next 3 blocks it is possible it will be rejected for having a too-low maxFeePerGas value.

    New fields enabled by the Berlin hardfork (EIP-2718, EIP-2930):

    • type: The type, currently "0x0" (Legacy), "0x1" (EIP-2930), or "0x2" (EIP-1559)
    • chainId: The chainId of the chain the transaction is intended for. If the chainId of the transaction doesn't match the chainId of the node the transaction will be rejected.
    • accessList: A list of addresses and storage keys that the transaction plans to access. Accesses outside the list are possible, but may be more expensive.

    Changed fields:

    • hash
    • v - type 1 and type 2 transactions do not encode the chain ID here (EIP-155) and do not include the addition of the number 27.
    • r
    • s

    Transactions are now ordered relative to the "current" block's baseFeePerGas

    Because the gas fee a transaction might pay now depends on the block's baseFeePerGas transactions are re-sorted in the context of each new block. Transaction ordering is still deterministic (except in rare cases) but the order now depends on previous blocks.

    back to top


    Fixes

    • WebSocket connections are sometimes closed prematurely (#1097)
    • Zero address transactions are now always signed with the same (fake) key (#1117)
    • Signatures with r or s values containing leading 0s would result in incorrect transaction hashes

    back to top


    New Features

    This alpha release brings you Berlin and London hardfork support as well as a new ganache event system.

    Berlin's Access List Transactions (EIP-2930)

    Access List Transactions enable support for specifying an accessList. The access list defines a list of addresses and storage keys that the transaction plans to access. Accesses outside the list are possible, but may be more expensive.

    See the EIP-2930 for details.

    London and its Fee Market Transactions (EIP-1559)

    EIP-1559 builds upon EIP-2930 by specifying a new transaction type: "0x2", or just "type 2".

    Read about what EIP-1559 is and how it is changing Ethereum.

    Event system

    In addition to EIP-1193's "message" event and the legacy "data" event, Ganache emits 3 additional events: "ganache:vm:tx:before", "ganache:vm:tx:step", and "ganache:vm:tx:after".

    These events can be used to observe the lifecycle of any transaction executed via *sendTransaction, eth_call, debug_traceTransaction, or debug_storageRangeAt.

    These share the event paradigm that Truffle uses, but without any of the wildcard handling, i.e., no "vm:*" support (for now).

    Each of these events will emit a context object which is a unique object that can be used to identify a transaction over the course of its lifecycle. For example:

    interface StepEvent {
      account: {
        nonce: bigint;
        balance: bigint;
        stateRoot: Buffer;
        codeHash: Buffer;
      };
      address: Buffer;
      codeAddress: Buffer;
      depth: number;
      gasLeft: bigint;
      gasRefund: bigint;
      memory: Buffer;
      memoryWordCount: bigint;
      opcode: {
        name: string;
        fee: number;
      };
      pc: number;
      returnStack: Buffer[];
      stack: Buffer[];
    }
    const contexts = new Map();
    provider.on("ganache:vm:tx:before", (event: { context: {} }) => {
      contexts.set(event.context, []);
    });
    provider.on("ganache:vm:tx:step", (event: StepEvent) => {
      contexts.get(event.context).push(event.data);
    });
    provider.on("ganache:vm:tx:after", (event: { context: {} }) => {
      doAThingWithThisTransactionsSteps(contexts.get(event.context));
      contexts.delete(event.context);
    });
    

    The reason this context is necessary is that Ganache may run multiple transactions simultaneously, so "ganache:vm:tx:step" events from different transactions could be intermingled.

    The above events will be emitted for eth_call, *sendTransaction, debug_traceTransaction, and debug_storageRangeAt.

    Currently, we do not await the event listener's return value, however, we'll likely enable this in the future.

    With all that said, we might change this event system depending on feedback about it's API and usefulness. Follow or comment on this issue if you'd like to influence the design of this system.

    back to top


    Known Issues

    • transactions that aren't immediately executable can't be replaced by "better" transactions (https://github.com/trufflesuite/ganache/issues/1219)
    • replacement transactions are run twice (https://github.com/trufflesuite/ganache/issues/1218)
    • type 2 gasPrice needs to be handled better (https://github.com/trufflesuite/ganache/issues/1213)
    • eth_call needs additional eip-1559 gasPrice logic (https://github.com/trufflesuite/ganache/issues/1214)
    • It may be possible for the transaction pool to not be stable sorted (https://github.com/trufflesuite/ganache/issues/1193)
    • Forking is so very slow.
    • Forking's chainId shouldn't match the remote chain. We really should use a different chainId than the remote, but still be able to contextualize past transactions with their original chainId.
    • Our TypeScript types aren't properly exported.
    • Our Docker container isn't published.
    • We don't return a proper pending block.
    • Uncles aren't fully supported when forking.
    • Forking may fail in weird and unexpected ways. We need to "error better" here.

    back to top


    Future Plans

    • 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.
    • Add in VM events so tools like solcoverage will work.
    • 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!
    • Integrate with Infura: e.g., ganache --fork mainnet to fork mainnet via your own Infura account.
    • 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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 26, 2021)

     Highlights    Breaking Changes    Fixes    New Features   Known Issues   Future Plans 


    This major release is the first alpha release of the new and improved Ganache v7.0.0. We've got a lot in store for you in this breaking-change release, so you'll definitely want to read on!

    But first, this is 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 to latest. 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 🔥🐉️


    Highlights

    • We broke Ganache… on purpose. 😅 This is a breaking change release, so you’ll want to pay close attention to these changes! (skip to the broken-stuff)

    • It's much faster and more memory efficient. We've seen truffle test execution times for real world repositories run in 1/3 the time. CLI initialization is ~300% faster. You can now run Ganache indefinitely without ever-increasing memory usage (with a few very rare exceptions¹ we consider to be bugs that will be fixed in a later release).

    • The ganache-core and ganache-cli packages you know and love have been (almost² completely rewritten from the ground up in TypeScript.

    • The ganache-core and ganache-cli npm packages have been merged into a single ganache package. We’ll continue to publish to the old core and cli npm packages for the time being, but you’ll want to switch over to the new ganache npm package soon, or you’ll start seeing a deprecation notice upon installation.

    • The ganache-core and ganache-cli GitHub repositories have been merged together and moved to ganache. Head over to the new repo and show it some love by smashing that ⭐ button!

    • The Docker container will be moving to https://hub.docker.com/r/trufflesuite/ganache

    • Ganache now works in the browser and we are working on building interactive browser-based documentation. We've built a prototype implementation and are working on optimizing and polishing the experience.

    • For the last year Ganache has been mostly maintained by one person (me). But now there are a whole two of us! We welcomed Micaiah Reid, formerly of Lockheed Martin, to the team in May! Go give him a follow!

    • Speaking of new team members… we're hiring! We’ve got tons of exciting work planned for the future of Ethereum developer tools. Come work with us on making Ethereum more accessible to more developers! Don’t know which positions to apply to? Feel free to reach out to anyone from our team to inquire more about working here at Truffle!

    back to top

    Breaking Changes

    Many changes are "breaking", some more than others. We've organized the breaking changes into three categories:

    The big ones

    These changes are likely to cause you some trouble if you upgrade blindly. We've ordered them from most-likely to least-likely to cause problems:

    🟀

    We've renamed our packages

    We've renamed *ganache-cli and ganache-core to ganache. You'll need to uninstall the old version before installing the new.

    For a global installation uninstall ganache-cli before installing ganache:

    $ npm uninstall ganache-cli --global
    $ npm install ganache@alpha --global
    

    For a local installation of ganache-cli and/or ganache-core:

    $ npm uninstall ganache-core ganache-cli
    $ npm install ganache@alpha
    

    You can now use the new ganache (without the -cli suffix) on the command line:

    $ ganache # use `npx ganache` if you installed locally
    

    and via global or local install in your package.json scripts:

    {
      "scripts": {
        "start-ganache": "ganache"
      }
    }
    

    Note: we've aliased ganache-cli to ganache, so you can continue using the ganache-cli command in your npm scripts and in your terminal.

    The Docker container will be moving soon -- from https://hub.docker.com/r/trufflesuite/ganache-cli to https://hub.docker.com/r/trufflesuite/ganache.

    back to list

    Transaction hashes are now returned before the transaction receipt is available.

    Previously, Ganache would allow this:

    // BAD CODE THAT USED TO WORK
    const provider = Ganache.provider();
    const txHash = await provider.send("eth_sendTransaction", [transaction]);
    const receipt = await provider.send("eth_getTransactionReceipt", [txHash]);
    assert.notStrictEqual(receipt, null);
    

    The problem is that this behavior is not representative of how Ethereum nodes behave in the real world; transactions take time to be mined after being accepted by the node. If you're already using Ethereum libraries like web3.js or ethers.js and connecting over WebSockets, you shouldn't have to worry about this change, as these libraries already handle the transaction lifecycle for you.

    If you are using Truffle to run your tests you'll want to enable the websockets flag in your Truffle config:

    // truffle-config.js
    module.exports = {
      networks: {
        development: {
          host: "127.0.0.1",
          port: 8545,
          network_id: "*",
          websockets: true // ← add this
        },
        /* … */
    

    However, even with WebSockets enabled, some versions of these libraries, including truffle, do not always set up their subscription events fast enough. When this happens the client will miss the notification from Ganache and fall back to polling for changes (slow). We're working with libraries to fix this behavior, but in the meantime you might want to go against our advice and enable legacyInstamine mode, as described below, when starting Ganache.

    If you have test code similar to the BAD CODE THAT USED TO WORK example above you'll need to make some changes.

    The easy, but not recommended way is to enable legacyInstamine mode in your start up options:

    $ ganache --miner.legacyInstamine true
    

    or

    const provider = Ganache.provider({ miner: { legacyInstamine: true } });
    

    Enabling legacyInstamine mode restores the old behavior, causing transaction hashes to be returned after the transaction results are persisted in the database.

    The problem with this fix is that you will be unable to reliably run your code against real Ethereum nodes later. We've seen this issue arise over and over once developers attempt their tests against a testnet or on Mainnet.

    A better way is to update your code so that it will behave no matter how long it takes for your transaction receipt to be available. To do that you'll either need to use Ethereum subscriptions or HTTP polling.

    Here's a somewhat robust example of how to wait for a transaction receipt in JavaScript with an EIP-1193 provider (like your browser wallet's window.ethereum) connected via WebSockets:

    const send = (method, params) => provider.request({ method, params });
    
    const sendRawTransaction = async (provider, rawTransaction) => {
      // first we need to subscribe to all new blocks
      const subId = await send("eth_subscribe", ["newHeads"]);
      try {
        // send the raw transaction
        const txHash = await send("eth_sendRawTransaction", [rawTransaction]);
        // wait for the receipt
        const receipt = await new Promise(resolve => {
          // wait for new messages
          provider.on("message", async ({ type, data }) => {
            // wait for our specific subscription
            if (type !== "eth_subscription" || data.subscription !== subId) return;
    
            // return our receipt if it is available
            const receipt = await send("eth_getTransactionReceipt", [txHash]);
            if (receipt === null) return;
    
            resolve(receipt);
          });
        });
      } finally {
        // make sure we always unsubscribe
        await send("eth_unsubscribe", [subId]);
      }
      return receipt;
    };
    

    I know… this is a lot of code for something that used to be so simple! This is why we've added a small helper for the simplest cases:

    // setup
    const provider = Ganache.provider();
    const send = (method, params) => provider.request({ method, params });
    // subscribe ONCE when starting ganache
    await send("eth_subscribe", ["newHeads"]); // ← add this
    
    // …
    
    const txHash = await send("eth_sendRawTransaction", [transaction]);
    // wait for a single block then continue
    await provider.once("message"); // ← add this
    const receipt = await send("eth_getTransactionReceipt", [txHash]);
    

    provider.once is currently non-standard and should only be used in controlled environments where you are the only one interacting with the node and are sending transactions sequentially.

    Note that legacyInstamine + vmErrorsOnRPCResponse mode's error messages, from a rejected Promise or the error parameter in callback-style, are now formatted as follows:

    type RpcError = {
       data: Record<string /* transaction hash */, {
        hash: string;
        programCounter: number;
        result: string;
        reason?: string;
        message: string;
      }>;
    };
    

    Previously, these errors were contained within a combination of the results and hashes properties:

    // OLD WAY!
    type RpcError = {
      results: Record<string /* transaction hash*/, {
        error: string;
        program_counter: number;
        reason?: string;
        return: string;
      }>;
      hashes: string[]; // array of transaction hashes
    };
    

    Also, only evm_mine and miner_start return an array for the data field, as these are the only places where multiple transactions may be executed[³].

    VM Errors on RPC Response now defaults to disabled

    Ganache used to return error messages alongside the result for eth_sendTransaction and eth_sendRawTransaction RPC calls by default. This is invalid behavior for a node and causes problems with some libraries.

    You can still enable this feature, but to do so you'll need to also enable legacyInstamine mode, as described above:

    $ ganache --miner.legacyInstamine true --chain.vmErrorsOnRPCResponse true
    

    or

    const provider = Ganache.provider({
      miner: {
        legacyInstamine: true
      },
      chain: {
        vmErrorsOnRPCResponse: true
      }
    });
    

    To see why a transaction has failed you can resend the transaction via eth_call.

    back to list

    Default startup ether is now 1000 instead of 100

    We polled 50 developers about Ganache's startup Ether amount. 44% had no opinion, 33% didn't need more, and 22% said they change the default amount to 1000 or more. While the 22% is a minority, we felt that it was a large enough percentage to warrant the change. Feel free to reach out to let us know if you like/dislike this change.

    back to list

    Ganache's provider and server interfaces have changed

    Ganache's provider and server internals are no longer leaking. This means you can’t manipulate the vm directly anymore. We’re already planning on exposing many of the vm events that other tools rely on (like ”step”) before launching to stable, but we need further feedback on other internals that will be missed. Open a new issue if you relied on these removed internals and need us to build in public and stable access to them.

    back to list

    Non-consecutive transaction nonces no longer throw an error

    We now support the pendingTransactions event and will soon support actual pending blocks.

    Previously, if you sent a transaction with a nonce that did not match the account's transaction count that transaction would be immediately rejected. In v7 that transaction will be placed in the node's transaction queue.

    You can replace these queued transactions the same way you'd replace the transaction on Mainnet or tests, by sending another transaction with the same nonce but a higher gas price.

    Currently the eviction mechanism is not tunable, but we plan on exposing options to change the behavior in the near future.

    Note: currently, the number of queued transactions does not have an upper bound and you can continue adding new transactions until your process runs out of memory and crashes. We consider this a memory leak and a bug. Expect this unbounded behavior to change in a patch-level release in the future.

    Note 2: if you use the persisted DB option: we have never stored unexecuted transactions to disk and do not plan to do so. The same is true of these queued transactions.

    back to list

    We've dropped support for Node v8.x

    Hopefully this won't affect your project, as it's been unsupported by Node.js for over a year now.

    We plan on dropping support for Node v10 within the next few months. Please file an issue if you think you or your team will be unable to upgrade to Node v12 or later by mid October 2021.

    back to list

    Old databases from previous versions are not compatible with v7.0.0

    Ganache's old database format is incompatible with this version. We've decided to hold off on building migration tools for this. If you will need a migration tool (you use the db_path flag and are unable to recreate your initial DB state) please open an issue to let us know.

    back to list

    back to breaking

    Other breaking changes, but you probably won't notice or care

    • web3_clientVersion now returns Ganache/v{number/number/number}
    • Runtime Error: errors are now Runtime error:
    • change signer account is locked error to authentication needed: password or unlock
    • change Exceeds block gas limit error to exceeds block gas limit
    • server.listen isn't pre-bound to the server instance (server.listen.bind(server))
    • provider.send isn't pre-bound to the provider instance (provider.listen.bind(provider))
    • remove options.keepAliveTimeout
    • rename provider.removeAllListeners to provider.clearListeners
    • provider.close is now provider.disconnect and returns a Promise (no callback argument)
    • return Cannot wrap a "[a-zA-Z]+" as a json-rpc type on evm_revert error instead of invalid type or false for invalid snapshot ids
    • change invalid string handling to error with cannot convert string value ${value} into type Quantity; strings must be hex-encoded and prefixed with "0x".
    • change Method {method} not supported error to The method {method} does not exist/is not available
    • return error header not found for requests to non-existent blocks
    • replace mutable provider.options with provider.getOptions(); getOptions now returns a deep clone of the options object
    • default coinbase (eth_coinbase RPC call) is now the 0x0 address (fixes #201)
    • sender doesn't have enough funds to send tx errors are now prefixed with VM Exception while processing transaction
    • logs subscription events are emitted before newHeads events

    back to breaking

    Technically bug fixes, but these might break your tests:

    • blocks are now filled based on actual transaction gas usage, not by the transactions stated gas/gasLimit
    • the underlying state trie is now computed properly; hashes and stateRoots will differ (fixes #664)
    • chainId option defaults to 1337 everywhere
    • remove support for BN in provider RPC methods
    • require transaction data to be valid json-rpc hex-encoded DATA (must start with 0x)
    • invalid transaction v values are no longer allowed
    • previous versions sent utf-8 instead of binary over WebSockets when the request was binary encoded, the encoding is now echoed by default. There is new flag/option to revert behavior: wsBinary
    • change error code when subscription requested over http from -32000 to -32004
    • require transaction value string to be a JSON-RPC encoded hex QUANTITY.
      • Reason: the string "1000" could be the decimal number 1000 or the hex representation of the number 4096. The JSON-RPC specification requires that we disambiguate by only accepting "0x"-prefixed hexadecimal strings.
    • a result is no longer present when an error is returned (fixes #558)
    • transaction ordering from multiple accounts is now ordered by gasPrice
    • options now always treats strings that represent numbers as "0x" prefixed hex strings, not as numbers

    back to breaking

    back to top


    Fixes

    • An actual block size is now returned in eth_getBlock* calls
    • eth_sign returns correct signatures (fixes #556)
    • The underlying state trie is now computed properly (fixes #664)

    back to top


    New Features

    • Updated default gasLimit to 12M
      • note: we've never considered changing the default gasLimit as a semver breaking change, but welcome civil discourse if you disagree.
    • Added more forking auth options and configuration. See ganache --help for details
    • Added namespaces for options arguments. See ganache --help for the new option names. Note:
      • You can still use the "legacy" options.
      • Let us know if you love or hate the namespaced options.
    • Added provider.once(message: string) => Promise<unknown>
    • Add the option miner.defaultTransactionGasLimit which can be set to "estimate" to automatically use a gas estimate instead of the default when gas/gasLimit has been omitted from the transaction.
    • evm_mine now accepts a new param: options: {timestamp?: number, blocks: number?}.
      • If options.blocks is given it mines that number of blocks before returning
    • Added miner.coinbase option (closed #201).
    • Added evm_setAccountNonce (closed #589).
    • Added getOptions() to provider instance.
    • Added getInitialAccounts() to provider instance.
    • evm_increaseTime now takes either a number or a JSON-RPC hex-encoded QUANTITY value (closed #118).
    • Added new flag, wsBinary (true, false, or "auto", defaults to "auto").
    • Added support for non-executable pending transactions (skipped nonces).
    • Added support for replacement transactions (closed #244 #484).

    back to top


    Known Issues

    • No Berlin/London support yet. We apologize for being behind on this one. This is our top priority and expect a follow up alpha release within 1 week to add in London and EIP-1559 transaction (type 2) support.
    • Forking is so very slow.
    • Forking's chainId shouldn't match the remote chain. We really should use a different chainId than the remote, but still be able to contextualize past transactions with their original chainId.
    • WebSocket connections are sometimes closed prematurely.
    • Our TypeScript types aren't properly exported.
    • Our Docker container isn't published.
    • We don't return a proper pending block.
    • Uncles aren't fully supported when forking.
    • Forking may fail in weird and unexpected ways. We need to "error better" here.

    back to top


    Future Plans

    • 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.
    • Add in VM events so tools like solcoverage will work.
    • 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!
    • Integrate with Infura: e.g., ganache --fork mainnet to fork mainnet via your own Infura account.
    • 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


    1. We don't evict excessive pending transactions, unreverted evm_snapshot references are only stored in memory, and we allow an unlimited number of wallet accounts to be created and stored in memory via personal_newAccount. 2. Truffle alum, Nick Paterno, built our ✨excellent✨ gas estimation algorithm which required no changes. 3. This isn't entirely true when a nonce is skipped and then the skipped nonce is executed, but this behavior wasn't supported in previous versions anyway.


    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
  • v2.13.2(Aug 26, 2021)

     Highlights    How to Upgrade    Changelog    Related Releases 


    We're moving to a betalatest release pipeline, where all non-hotfix changes are first released in a beta before being promoted to a stable release.

    We'd love it if you'd start using the latest betas and let us know early and often if you find any bugs or regressions!

    Highlights

    v2.13.2 – Taco Tuesday 🌮

    It's Tuesday. And you know what that means, don't you? Tacos! And tacos are delicious. And do you know what else is delicious? This release! It's got a couple of new bug fixes you'll want to check out, especially if you use the forking feature.

    Bon appetit!


    How to Upgrade

    Upgrade to the latest version of ganache-core by running:

    npm

    npm uninstall ganache-core
    npm install ganache-core@latest
    

    yarn

    yarn remove ganache-core
    yarn add ganache-core@latest
    

    Changelog

    Fixes:

    • fix: add removed field to Log JSON (#651)
    • fix: storage value encoding in forked trie. (#658)
    • fix: handle failure to retrieve net_version when forking (#676)

    Chores:

    • chore: update eth-sig-util to v3.0.0 (#711)

    Related Releases

    💖 The Truffle Team

    Source code(tar.gz)
    Source code(zip)
Owner
Truffle Suite
The most popular blockchain development suite
Truffle Suite
AnonCrypt ciphers and diciphers your messages or strings which makes you send texts to people without them understanding it.

AnonCrypt ciphers and diciphers your messages or strings which makes you send texts to people without them understanding it. Anoncrypt uses Aes192 cipher encryption type and not Hmac.

AnonyminHack5 11 Oct 23, 2022
A full stack digital marketplace running on Ethereum, built with Polygon, Next.js, Tailwind, Solidity, Hardhat, Ethers.js, and IPFS

A full stack digital marketplace running on Ethereum, built with Polygon, Next.js, Tailwind, Solidity, Hardhat, Ethers.js, and IPFS

Christotle Agholor 32 Dec 27, 2022
📡 Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

?? Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

Cris 9 May 5, 2022
DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:

DOMPurify DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's also very simple to use and get started with

Cure53 10.2k Jan 7, 2023
Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance

sanitize-html sanitize-html provides a simple HTML sanitizer with a clear API. sanitize-html is tolerant. It is well suited for cleaning up HTML fragm

Apostrophe Technologies 3.2k Dec 26, 2022
A WebApp that allows you to follow Cryptos' News and Stats

CryptoWatch A WebApp that allows you to follow Cryptos' News and Stats. Table of Contents About The Project Screenshots Built With Getting Started Pre

null 28 Aug 4, 2022
Smart contracts for governance. Contract allows to bond custom/LP UNI-v2 tokens and get voting power

Smart contracts for governance. Contract allows to bond custom/LP UNI-v2 tokens and get voting power

Rinat Fihtengolts 3 Oct 2, 2022
Build a Cryptocurrency Tracker with Next.js and GraphQL

Build a Cryptocurrency Tracker with Next.js and GraphQL This is the complete code to my blog post on Medium on "Build a Cryptocurrency Tracker with Ne

Presterud Myrseth Technologies 4 Dec 1, 2022
A Secure Web Proxy. Which is fast, secure, and easy to use.

Socratex A Secure Web Proxy. Which is fast, secure, and easy to use. This project is under active development. Everything may change soon. Socratex ex

Leask Wong 222 Dec 28, 2022
Policy-password is a NodeJS library written in Typescript to generate passwords according to policies and constraints.

Policy-password is a NodeJS library written in Typescript to generate passwords according to policies and constraints.

Thomas Hesse 14 May 17, 2022
Mongo Strict is a TypeScript based smart MongoDB ORM, It makes the usage of MongoDB safer, easier and faster with a better performance...

mongo-strict mongo-strict is compatible with mongo >= 5 Mongo Strict is a TypeScript-based smart MongoDB ORM, It makes the usage of MongoDB safer, eas

Mohamed Kamel 4 Sep 22, 2022
A JavaScript module that shortens your code, makes life easier, and makes development faster!

Quxt A JavaScript module that shortens your code, makes life easier, and makes development faster! Installation npm install quxt Quick Start Check ind

Qux App 5 May 8, 2022
🔥 Miniflare is a simulator for developing and testing Cloudflare Workers.

?? Miniflare is a simulator for developing and testing Cloudflare Workers.

Cloudflare 3.1k Jan 3, 2023
tauOS 17 Jul 10, 2022
Blockchain, Smart Contract, Ganache, Remix, Web3, Solidity, Java Script, MQTT, ESP32, RFID, DHT11,

Blockchain, Smart Contract, Ganache, Remix, Web3, Solidity, Java Script, MQTT, ESP32, RFID, DHT11,

Hajar OUAAROUCH 5 May 24, 2022
Library for testing Solidity custom errors with Truffle/Ganache.

Custom Error Test Helper Library for testing Solidity custom errors with Truffle/Ganache. Installation npm install --save-dev custom-error-test-helper

null 5 Dec 23, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionalty.js (beta) About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project Cr

Ali-Eldeba 16 Aug 30, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionality.js (beta) About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project C

Ali-Eldeba 9 May 25, 2022
A JavaScript Library To Make Your Work Work Easier/Faster

Functionality.js About ✍️ This Is A JavaScript Library To Make Your Work Easier/Faster, You Can See Functionalty.js Website From Here Project Created

functionality 16 Jun 23, 2022
An NPM package to help you get started with modern javascript tooling easier & faster

MODERNIZE.JS Creating config files for webpack and babel can be an hell of stress, this NPM package helps you get started with writing code as soon as

Kelechi Okoronkwo 5 Sep 22, 2022