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

feat: add support for the merge hardfork #3971

Merged
merged 26 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b52cbf9
chore: remove support for Node.js v12 (#3705)
davidmurdoch Sep 23, 2022
3868ea1
chore: upgrade @ethereumjs/vm to v6.0.0 (#3656)
MicaiahReid Sep 23, 2022
a0c4e74
feat: add support for the `merge` hardfork (#3658)
davidmurdoch Sep 23, 2022
fb6d37d
refactor: remove tech-debt added during ejs upgrade (#3776)
MicaiahReid Nov 30, 2022
d0b366f
fix white space in package-lock
MicaiahReid Nov 30, 2022
c48c4fe
clean up todo comments
MicaiahReid Nov 30, 2022
cf3d218
properly pass on the prefixCodeHashes options
MicaiahReid Nov 30, 2022
1c83066
remove timeouts
MicaiahReid Nov 30, 2022
fb68a01
remove comment
MicaiahReid Dec 1, 2022
d334449
simplify conversion
MicaiahReid Dec 1, 2022
0f784c8
revert style; keep types
MicaiahReid Dec 1, 2022
ba31379
set "merge" as default hardfork
MicaiahReid Dec 1, 2022
fe1122b
update tests to have "merge" as default hardfork
MicaiahReid Dec 1, 2022
d4862ed
Apply suggestions from code review
MicaiahReid Dec 1, 2022
2d27cae
shrinkwrap
MicaiahReid Dec 2, 2022
44290fd
shrinkwrap formatting
MicaiahReid Dec 2, 2022
89fdb47
shrinkwrap again
MicaiahReid Dec 2, 2022
d4325e8
Merge branch 'develop' into the-merge
MicaiahReid Dec 2, 2022
799eb09
fix package-lock whitespace
MicaiahReid Dec 2, 2022
0bc1de7
str8 to big int, dog
MicaiahReid Dec 6, 2022
3ffe434
add test for truncating address
MicaiahReid Dec 6, 2022
e03d24d
convert RuntimeBlock gas params to Quantity
MicaiahReid Dec 6, 2022
4608785
use nullish coalescing operator
MicaiahReid Dec 6, 2022
d62a8f0
don't convert like that, silly
MicaiahReid Dec 6, 2022
295e951
put this test back
davidmurdoch Dec 6, 2022
02e625f
Merge branch 'develop' into the-merge
MicaiahReid Dec 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
node: [14.0.0, 14.x, 16.x, 18.x]
os: [windows-2019, ubuntu-18.04, ubuntu-20.04, macos-11]
exclude:
# Node v18 does not run on ubuntu-18.04: https://github.com/nodejs/node/issues/42351#issuecomment-1068424442
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12.0.0, 12.x, 14.x, 16.x, 18.x]
node: [14.0.0, 14.x, 16.x, 18.x]
os: [ubuntu-20.04]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.0.0
v14.0.0
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Getting set up

- Use Node.js v12.0.0.
- Why v12.0.0? Because this is the first LTS release of Node.js v12 and is the earliest version Ganache supports.
- Use Node.js v14.0.0.
- Why v14.0.0? Because this is the first LTS release of Node.js v14 and is the earliest version Ganache supports.
- recommendation: use [nvm](https://github.com/nvm-sh/nvm) on Linux and macOS, and [nvm-windows](https://github.com/coreybutler/nvm-windows) on
Windows, to configure your node version.
- On Linux and macOS, if you have `nvm` installed, just run `nvm use` to switch to Node.js v12.0.0.
- On Linux and macOS, if you have `nvm` installed, just run `nvm use` to switch to Node.js v14.0.0.
- `git clone [email protected]:trufflesuite/ganache.git`
- `cd ganache`
- `npm install` (use npm v6)
Expand Down Expand Up @@ -153,7 +153,7 @@ index 2a2aa9e..57cbf21 100644

These are guidelines, not rules. :-)

- Use Node.js v12.0.0 for most local development.
- Use Node.js v14.0.0 for most local development.
- Use `bigint` literals, e.g., `123n`; if the number is externally configurable and/or could exceed
`Number.MAX_SAFE_INTEGER`.
- Write tests.
Expand Down
87 changes: 55 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"author": "David Murdoch <[email protected]> (https://davidmurdoch.com)",
"private": true,
"engines": {
"node": ">=12.0.0",
"npm": ">=6.12.0"
"node": ">=14.0.0",
"npm": ">=6.14.4"
},
"scripts": {
"build": "npm run tsc && cross-env NODE_OPTIONS=--max_old_space_size=4096 lerna run build",
Expand Down Expand Up @@ -47,8 +47,8 @@
"pretty-quick": "3.1.2",
"semver": "7.3.5",
"shx": "0.3.3",
"ts-node": "10.4.0",
"typescript": "4.6.4",
"ts-node": "10.9.1",
"typescript": "4.7.4",
"validate-npm-package-name": "3.0.0",
"yargs": "16.2.0"
},
Expand Down
15 changes: 10 additions & 5 deletions src/chains/ethereum/address/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Data, JsonRpcDataInputArg } from "@ganache/utils";
import { Address as EJSAddress } from "@ethereumjs/util";
import { JsonRpcDataInputArg, Data } from "@ganache/utils";

export class Address extends Data {
export class Address extends EJSAddress {
static ByteLength = 20;

constructor(value: string | Buffer) {
super(value, Address.ByteLength);
constructor(value: Buffer) {
super(value);
}

public static from<T extends string | Buffer = string | Buffer>(value: T) {
return new Address(value);
return new Address(Data.toBuffer(value, Address.ByteLength));
}

static toBuffer(value: JsonRpcDataInputArg): Buffer {
Expand All @@ -18,4 +19,8 @@ export class Address extends Data {
static toString(value: JsonRpcDataInputArg): string {
return Address.from(value).toString();
}

toJSON() {
return this.toString();
}
}
Loading