Skip to content

Commit 2f70c44

Browse files
authored
trie: trie package renaming to mpt (#3719)
* trie: trie package renaming to mpt * adjust ci with mpt * trie: trie package renaming to mpt * adjust ci with mpt * mpt: update version * trie: renaming to mpt for clarity * mpt: rename * trie: adjust proof naming scheme * trie: fix isRawMPTNode import * trie: don't export internally used verifyRangeProof * mpt: minor adjustments * mpt: fix example script
1 parent 3136bd2 commit 2f70c44

File tree

163 files changed

+376
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+376
-337
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
with:
3737
path: ${{github.workspace}}/packages/ethereum-tests
3838
key: submodule-${{ steps.create-cache-key.outputs.submodule-cache-key}}
39-
40-
outputs:
39+
40+
outputs:
4141
submodule-cache-key: submodule-${{ steps.create-cache-key.outputs.submodule-cache-key}}
4242

4343
build:
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
path: ${{github.workspace}}/node_modules
5353
key: npm-${{ hashFiles('package-lock.json') }}
54-
54+
5555
- name: Use Node.js 20
5656
uses: actions/setup-node@v4
5757
with:
@@ -60,7 +60,7 @@ jobs:
6060

6161
- run: npm ci
6262
working-directory: ${{github.workspace}}
63-
63+
6464
- name: Cache dependencies
6565
uses: actions/cache/save@v4
6666
with:
@@ -73,7 +73,7 @@ jobs:
7373
path: ${{github.workspace}}
7474
key: npm-${{ hashFiles('package-lock.json') }}-${{ github.run_id }}
7575

76-
outputs:
76+
outputs:
7777
dep-cache-key: ${{ steps.dep-cache.outputs.cache-primary-key }}-${{ github.run_id }}
7878

7979
block:
@@ -82,7 +82,7 @@ jobs:
8282
with:
8383
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
8484
submodule-cache-key: ${{ needs.checkout-submodules.outputs.submodule-cache-key }}
85-
85+
8686
blockchain:
8787
needs: build
8888
uses: ./.github/workflows/blockchain-build.yml
@@ -139,6 +139,12 @@ jobs:
139139
with:
140140
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
141141

142+
mpt:
143+
needs: build
144+
uses: ./.github/workflows/mpt-build.yml
145+
with:
146+
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
147+
142148
rlp:
143149
needs: build
144150
uses: ./.github/workflows/rlp-build.yml
@@ -151,12 +157,6 @@ jobs:
151157
with:
152158
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
153159

154-
trie:
155-
needs: build
156-
uses: ./.github/workflows/trie-build.yml
157-
with:
158-
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
159-
160160
tx:
161161
needs: [build, checkout-submodules]
162162
uses: ./.github/workflows/tx-build.yml
@@ -188,7 +188,7 @@ jobs:
188188
uses: ./.github/workflows/wallet-build.yml
189189
with:
190190
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
191-
191+
192192
lint:
193193
needs: build
194194
uses: ./.github/workflows/lint.yml
@@ -201,5 +201,3 @@ jobs:
201201
with:
202202
dep-cache-key: ${{ needs.build.outputs.dep-cache-key }}
203203
submodule-cache-key: ${{ needs.checkout-submodules.outputs.submodule-cache-key }}
204-
205-

.github/workflows/trie-build.yml renamed to .github/workflows/mpt-build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Trie
1+
name: MPT
22
on:
33
workflow_call:
44
inputs:
@@ -15,18 +15,18 @@ on:
1515
default: 'none'
1616

1717
env:
18-
cwd: ${{github.workspace}}/packages/trie
18+
cwd: ${{github.workspace}}/packages/mpt
1919

2020
defaults:
2121
run:
22-
working-directory: packages/trie
22+
working-directory: packages/mpt
2323

2424
concurrency:
25-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-trie
25+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-mpt
2626
cancel-in-progress: true
2727

2828
jobs:
29-
test-trie:
29+
test-mpt:
3030
runs-on: ubuntu-latest
3131

3232
steps:
@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/checkout@v4
3636

3737
# We restore the code/deps from cache if triggered from workflow_call (i.e. have valid cache key)
38-
- if: inputs.dep-cache-key != 'none'
38+
- if: inputs.dep-cache-key != 'none'
3939
uses: actions/cache/restore@v4
4040
id: dep-cache
4141
with:
@@ -50,16 +50,16 @@ jobs:
5050

5151
- name: Install Dependencies (if not restored from cache)
5252
if: steps.dep-cache.outputs.cache-hit != 'true'
53-
run: npm ci
53+
run: npm ci
5454
working-directory: ${{ github.workspace }}
55-
55+
5656
- run: npm run coverage
5757
- uses: codecov/codecov-action@v3
5858
with:
5959
files: ${{ env.cwd }}/coverage/lcov.info
60-
flags: trie
60+
flags: mpt
6161

62-
# trie-benchmarks:
62+
# mpt-benchmarks:
6363
# runs-on: ubuntu-latest
6464
# steps:
6565
# - uses: actions/checkout@v4
@@ -85,7 +85,7 @@ jobs:
8585
# # Where the output from the benchmark tool is stored
8686
# output-file-path: ${{ env.cwd }}/output.txt
8787
# # Location of data in gh-pages branch
88-
# benchmark-data-dir-path: dev/bench/trie
88+
# benchmark-data-dir-path: dev/bench/mpt
8989
# # GitHub API token to make a commit comment
9090
# github-token: ${{ secrets.GITHUB_TOKEN }}
9191
# # Push and deploy to GitHub pages branch automatically (if on master)

.github/workflows/node-versions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353
run: npm run test:node
5454
working-directory: packages/evm
5555

56-
- name: Test Trie
56+
- name: Test MPT
5757
run: npm run test:node
58-
working-directory: packages/trie
58+
working-directory: packages/mpt
5959

6060
- name: Test Tx
6161
run: npm run test:node

package-lock.json

Lines changed: 48 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/block/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"dependencies": {
5050
"@ethereumjs/common": "^4.4.0",
5151
"@ethereumjs/rlp": "^5.0.2",
52-
"@ethereumjs/trie": "^6.2.1",
52+
"@ethereumjs/mpt": "^6.2.2",
5353
"@ethereumjs/tx": "^5.4.0",
5454
"@ethereumjs/util": "^9.1.0",
5555
"ethereum-cryptography": "^3.0.0"

packages/block/src/block/block.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ConsensusType } from '@ethereumjs/common'
2+
import { MerklePatriciaTrie } from '@ethereumjs/mpt'
23
import { RLP } from '@ethereumjs/rlp'
3-
import { MerklePatriciaTrie } from '@ethereumjs/trie'
44
import { Blob4844Tx, Capability } from '@ethereumjs/tx'
55
import {
66
BIGINT_0,

packages/block/src/block/constructors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { MerklePatriciaTrie } from '@ethereumjs/mpt'
12
import { RLP } from '@ethereumjs/rlp'
2-
import { MerklePatriciaTrie } from '@ethereumjs/trie'
33
import {
44
type TxOptions,
55
createTx,

packages/block/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { MerklePatriciaTrie } from '@ethereumjs/mpt'
12
import { RLP } from '@ethereumjs/rlp'
2-
import { MerklePatriciaTrie } from '@ethereumjs/trie'
33
import { Blob4844Tx } from '@ethereumjs/tx'
44
import { BIGINT_0, BIGINT_1, TypeOutput, isHexString, toType } from '@ethereumjs/util'
55

packages/block/tsconfig.prod.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"references": [
1111
{ "path": "../common/tsconfig.prod.cjs.json" },
1212
{ "path": "../rlp/tsconfig.prod.cjs.json" },
13-
{ "path": "../trie/tsconfig.prod.cjs.json" },
13+
{ "path": "../mpt/tsconfig.prod.cjs.json" },
1414
{ "path": "../tx/tsconfig.prod.cjs.json" },
1515
{ "path": "../util/tsconfig.prod.cjs.json" }
1616
]

packages/block/tsconfig.prod.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"references": [
1111
{ "path": "../common/tsconfig.prod.esm.json" },
1212
{ "path": "../rlp/tsconfig.prod.esm.json" },
13-
{ "path": "../trie/tsconfig.prod.esm.json" },
13+
{ "path": "../mpt/tsconfig.prod.esm.json" },
1414
{ "path": "../tx/tsconfig.prod.esm.json" },
1515
{ "path": "../util/tsconfig.prod.esm.json" }
1616
]

0 commit comments

Comments
 (0)