Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade mandala node to support eip 2930 #937

Merged
merged 2 commits into from
Feb 7, 2024
Merged
Changes from all commits
Commits
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 docker-compose.yml
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ services:
# ---------- No Subql Realm ---------- #
# ------------------------------------ #
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
ports:
- 9944:9944
healthcheck:
2 changes: 1 addition & 1 deletion examples/docker-compose-bodhi-stack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
container_name: mandala-node
ports:
- 9944:9944
2 changes: 1 addition & 1 deletion examples/viem/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
container_name: mandala-node
ports:
- 9944:9944
4 changes: 2 additions & 2 deletions examples/waffle/scheduler/test/Scheduler.test.ts
Original file line number Diff line number Diff line change
@@ -161,10 +161,10 @@ describe('Schedule', () => {
expect((await erc20.balanceOf(recurringPayment.address)).toNumber()).to.equal(0);
if (!process.argv.includes('--with-ethereum-compatibility')) {
expect((await provider.getBalance(transferTo)).toString()).to.equal(
formatAmount('4_999_969_004_075_107_000_000')
formatAmount('4999968960671632000000')
);

expect((await erc20.balanceOf(transferTo)).toString()).to.equal(formatAmount('4_999_969_004_075_107'));
expect((await erc20.balanceOf(transferTo)).toString()).to.equal(formatAmount('4999968960671632'));
} else {
expect((await provider.getBalance(transferTo)).toString()).to.equal(dollar.mul(5000000000).toString());
expect((await erc20.balanceOf(transferTo)).toString()).to.equal(dollar.mul(5000).toString());
2 changes: 1 addition & 1 deletion packages/eth-rpc-adapter/README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ A node service that provides [JSON-RPC](https://eth.wiki/json-rpc/API) for [Acal
## Run
First run a Mandala node locally
```
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-06e988b --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

Then there are 3 ways to run an RPC adapter:
2 changes: 1 addition & 1 deletion packages/eth-rpc-adapter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ version: '3'

services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
ports:
- 9944:9944
command:
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@ exports[`endpoint > eth_getTransactionByHash > finds correct tx when hash exist
"blockNumber": "0xa",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gas": "0x1fd91",
"gasPrice": "0x25315050a8",
"gasPrice": "0x25315050b1",
"input": "0x3d8d96200000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000001",
"nonce": "0x6",
"r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
@@ -277,7 +277,7 @@ exports[`endpoint > eth_getTransactionByHash > finds correct tx when hash exist
"blockNumber": "0x9",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gas": "0x25a7f",
"gasPrice": "0x22a22ed349",
"gasPrice": "0x22a22ed358",
"input": "0x3d8d962000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000e8d4a510000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000010000000000000000000000000000000000000000000100000000000000000002",
"nonce": "0x5",
"r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
@@ -294,7 +294,7 @@ exports[`endpoint > eth_getTransactionByHash > finds correct tx when hash exist
"blockNumber": "0x6",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gas": "0x1fdca",
"gasPrice": "0x252f21c070",
"gasPrice": "0x252f21c079",
"input": "0x6fc4b4e50000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000e8d4a510000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000100000000000000000001",
"nonce": "0x2",
"r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
@@ -311,7 +311,7 @@ exports[`endpoint > eth_getTransactionByHash > finds correct tx when hash exist
"blockNumber": "0x14",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gas": "0x200b20",
"gasPrice": "0x41d4ad9224",
"gasPrice": "0x41d4ad924b",
"input": "0x",
"nonce": "0x10",
"r": "0x1b5e176d927f8e9ab405058b2d2457392da3e20f328b16ddabcebc33eaac5fea",
@@ -467,7 +467,7 @@ exports[`endpoint > eth_getTransactionReceipt > returns correct result when hash
"blockNumber": "0xa",
"contractAddress": null,
"cumulativeGasUsed": "0x0",
"effectiveGasPrice": "0x25315050a8",
"effectiveGasPrice": "0x25315050b1",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gasUsed": "0x1a8a4",
"logs": [
@@ -496,7 +496,7 @@ exports[`endpoint > eth_getTransactionReceipt > returns correct result when hash
"blockNumber": "0x9",
"contractAddress": null,
"cumulativeGasUsed": "0x0",
"effectiveGasPrice": "0x22a22ed349",
"effectiveGasPrice": "0x22a22ed358",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gasUsed": "0x1f615",
"logs": [
@@ -525,7 +525,7 @@ exports[`endpoint > eth_getTransactionReceipt > returns correct result when hash
"blockNumber": "0x6",
"contractAddress": null,
"cumulativeGasUsed": "0x0",
"effectiveGasPrice": "0x252f21c070",
"effectiveGasPrice": "0x252f21c079",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gasUsed": "0x1a8d3",
"logs": [
@@ -554,7 +554,7 @@ exports[`endpoint > eth_getTransactionReceipt > returns correct result when hash
"blockNumber": "0x14",
"contractAddress": null,
"cumulativeGasUsed": "0x0",
"effectiveGasPrice": "0x41d4ad9224",
"effectiveGasPrice": "0x41d4ad924b",
"from": "0x82a258cb20e2adb4788153cd5eb5839615ece9a0",
"gasUsed": "0xcbbd",
"logs": [
Original file line number Diff line number Diff line change
@@ -1250,7 +1250,7 @@ describe('endpoint', () => {

describe('eth_getBalance', () => {
it('get correct balance', async () => {
const block8Balance = 8999995192339995117000000n; // edit me for different mandala version
const block8Balance = 8999995192313663934000000n; // edit me for different mandala version
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, 8])).data.result)).to.equal(block8Balance);
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, '0x8'])).data.result)).to.equal(block8Balance);
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, { blockNumber: 8 }])).data.result)).to.equal(block8Balance);
2 changes: 1 addition & 1 deletion packages/evm-subql/README.md
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ npm i -g @subql/node@1.21.2 @subql/query@1.4.0
If you already have a node running elsewhere, you can skip this step.

```shell
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-06e988b --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

3. Run a Postgres service and listen to port number 5432 (in the second terminal)
2 changes: 1 addition & 1 deletion packages/evm-subql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ version: '3.9'

services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
ports:
- 9944:9944
healthcheck:
2 changes: 1 addition & 1 deletion packages/evm-subql/project.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ schema:
file: ./schema.graphql
network:
# local mandala
chainId: '0x6808cd9b5035f8983328e7ddb7efa0da77ecc2e180de504d13d0e5789724e8b7'
chainId: '0x6b4acf5a0264399326a45d79037b1fcd4c4f3259589bd7642f1272b6adf0e00d'
endpoint: ws://localhost:9944
chaintypes:
# TODO: can generate this dynamically with `yarn build` using `@acala-network/types`
2 changes: 1 addition & 1 deletion scripts/e2e-tests/docker-compose-subway.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4
image: ghcr.io/acalanetwork/mandala-node:sha-06e988b
container_name: mandala-node
ports:
- 9944:9944
2 changes: 1 addition & 1 deletion scripts/new-rpc-benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# New Eth RPC Benchmark
first start a local mandala with normal sealing
```
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-7ae4bf4 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-06e988b --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive
```

then start an old rpc adapter