From ef2c3e59ac0c0115d2c2aa29b65ba6a08616634d Mon Sep 17 00:00:00 2001 From: KaoImin Date: Wed, 6 Dec 2023 14:54:34 +0800 Subject: [PATCH 1/5] style: unify workspace code style --- .changelog/v0.2.0-beta.2/summary.md | 2 +- CHANGELOG.md | 3 +- Makefile | 50 +- SECURITY.md | 2 +- builtin-contract/crosschain/.gitignore | 2 +- common/apm/README.md | 21 +- core/api/README.md | 2336 ++++++++++----------- core/executor/src/debugger/create2.rs | 14 +- core/executor/src/precompiles/tests.rs | 30 +- core/executor/src/tests/mod.rs | 16 +- devtools/axon-tools/README.md | 4 +- devtools/axon-tools/src/tests/proof.json | 10 +- devtools/docker/health_check.sh | 2 +- tests/e2e/src/create_test_data/ERC20.json | 658 +++--- 14 files changed, 1521 insertions(+), 1629 deletions(-) diff --git a/.changelog/v0.2.0-beta.2/summary.md b/.changelog/v0.2.0-beta.2/summary.md index f39a362a2..426ed9b49 100644 --- a/.changelog/v0.2.0-beta.2/summary.md +++ b/.changelog/v0.2.0-beta.2/summary.md @@ -3,5 +3,5 @@ If you don't change this message, or if this file is empty, the release will not be created. --> - + This release contains some important bugfixes from the previous 0.2.0-beta.1 version. diff --git a/CHANGELOG.md b/CHANGELOG.md index fa01f3aa6..88c484808 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,7 +60,7 @@ If you don't change this message, or if this file is empty, the release will not be created. --> - + This release contains some important bugfixes from the previous 0.2.0-beta.1 version. ### BUG FIXES @@ -227,4 +227,3 @@ Release 0.2.0-beta.1 version. ([\#1300](https://github.com/axonweb3/axon/pull/1300)) Changelogs before 0.2.0 can be found [here](./CHANGELOG_OLD.md). - diff --git a/Makefile b/Makefile index e9d56061a..00ad3c1b2 100644 --- a/Makefile +++ b/Makefile @@ -5,75 +5,75 @@ COMMIT := $(shell git rev-parse --short HEAD) CARGO := cargo test: - ${CARGO} test ${VERBOSE} --all -- --nocapture + ${CARGO} test ${VERBOSE} --all -- --nocapture # Since Axon uses global variables, run all tests in one process may cause unexpected errors. test-in-separate-processes: - cargo nextest run --workspace --no-fail-fast --hide-progress-bar --failure-output final + cargo nextest run --workspace --no-fail-fast --hide-progress-bar --failure-output final doc: - cargo doc --all --no-deps + cargo doc --all --no-deps doc-deps: - cargo doc --all + cargo doc --all check: - ${CARGO} check ${VERBOSE} --all + ${CARGO} check ${VERBOSE} --all build: - ${CARGO} build ${VERBOSE} --release + ${CARGO} build ${VERBOSE} --release check-fmt: - cargo +nightly fmt ${VERBOSE} --all -- --check + cargo +nightly fmt ${VERBOSE} --all -- --check fmt: - cargo +nightly fmt ${VERBOSE} --all + cargo +nightly fmt ${VERBOSE} --all clippy: axon-clippy axon-tools-clippy axon-clippy: - ${CARGO} clippy ${VERBOSE} --all --all-targets --all-features -- \ - -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use + ${CARGO} clippy ${VERBOSE} --all --all-targets --all-features -- \ + -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use axon-tools-clippy: - ${CARGO} clippy ${VERBOSE} --manifest-path=devtools/axon-tools/Cargo.toml --all-features -- \ - -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use + ${CARGO} clippy ${VERBOSE} --manifest-path=devtools/axon-tools/Cargo.toml --all-features -- \ + -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use sort: - cargo sort -gw + cargo sort -gw check-sort: - cargo sort -gwc + cargo sort -gwc ci: check-fmt clippy test info: - date - pwd - env + date + pwd + env # For counting lines of code stats: - @cargo count --version || cargo +nightly install --git https://github.com/kbknapp/cargo-count - @cargo count --separator , --unsafe-statistics + @cargo count --version || cargo +nightly install --git https://github.com/kbknapp/cargo-count + @cargo count --separator , --unsafe-statistics # Use cargo-audit to audit Cargo.lock for crates with security vulnerabilities # expecting to see "Success No vulnerable packages found" security-audit: - @cargo audit --version || cargo install cargo-audit - @cargo audit + @cargo audit --version || cargo install cargo-audit + @cargo audit crosschain-test: - cd builtin-contract/crosschain \ - && yarn --from-lock-file && yarn run compile && yarn run test + cd builtin-contract/crosschain \ + && yarn --from-lock-file && yarn run compile && yarn run test crosschain-genesis-deploy: - cd builtin-contract/crosschain && yarn run deploy + cd builtin-contract/crosschain && yarn run deploy unit-test: test crosschain-test schema: - make -C core/cross-client/ schema + make -C core/cross-client/ schema .PHONY: build prod prod-test .PHONY: fmt test clippy doc doc-deps doc-api check stats diff --git a/SECURITY.md b/SECURITY.md index a9f18412d..bb66f8162 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -29,4 +29,4 @@ This process can take some time, especially when coordination is required with m If you require prior notification of vulnerabilities please subscribe to the [Nervos Security mailing list](https://groups.google.com/u/0/a/nervos.org/g/security-mailing-list). The mailing list is very low traffic, and it receives the public notifications the moment the embargo is lifted. -If you have any suggestions to improve this policy, please send an email to [Nervos Security Team](mailto:security@nervos.org). \ No newline at end of file +If you have any suggestions to improve this policy, please send an email to [Nervos Security Team](mailto:security@nervos.org). diff --git a/builtin-contract/crosschain/.gitignore b/builtin-contract/crosschain/.gitignore index 21f1df07d..6080f3371 100644 --- a/builtin-contract/crosschain/.gitignore +++ b/builtin-contract/crosschain/.gitignore @@ -9,4 +9,4 @@ scripts/*.json cache artifacts .openzeppelin -*.log \ No newline at end of file +*.log diff --git a/common/apm/README.md b/common/apm/README.md index 08697e5d7..8f91a014f 100644 --- a/common/apm/README.md +++ b/common/apm/README.md @@ -1,15 +1,17 @@ # Metrics documentation for prometheus + All current metrics and usage -## API -| Metric name | Metric types | Related Grafana panel | -|---|---|---| -| axon_api_request_total | counter | | -| axon_api_request_result_total | counter | processed_tx_request | -| axon_api_request_time_cost_seconds | histogram | | +## API +| Metric name | Metric types | Related Grafana panel | +| ---------------------------------- | ------------ | --------------------- | +| axon_api_request_total | counter | | +| axon_api_request_result_total | counter | processed_tx_request | +| axon_api_request_time_cost_seconds | histogram | | ## Consensus + @@ -71,7 +73,8 @@ All current metrics and usage
-## Mempool +## Mempool + @@ -114,7 +117,8 @@ All current metrics and usage
-## Network +## Network + @@ -206,6 +210,7 @@ All current metrics and usage
## Storage + diff --git a/core/api/README.md b/core/api/README.md index 8782f4a20..0d25bdcac 100644 --- a/core/api/README.md +++ b/core/api/README.md @@ -1,204 +1,201 @@ # Axon JSON-RPC Protocols -This section lists the Axon JSON-RPC API endpoints. + +This section lists the Axon JSON-RPC API endpoints. Axon JSON-RPC allow you to interact with a local or remote axon node using HTTP, IPC or WebSocket. ## JSONRPC Deprecation Process - - - ## Table of Contents - [Axon JSON-RPC Protocols](#axon-json-rpc-protocols) - - [JSONRPC Deprecation Process](#jsonrpc-deprecation-process) - - [Table of Contents](#table-of-contents) - - [RPC Methods](#rpc-methods) - - [Gossip-Methods](#gossip-methods) - - [Method `eth_sendRawTransaction`](#method-eth_sendrawtransaction) - - [Params](#params) - - [Returns](#returns) - - [Examples](#examples) - - [Method `eth_blockNumber`](#method-eth_blocknumber) - - [Params](#params-1) - - [Returns](#returns-1) - - [Examples](#examples-1) - - [Method `eth_submitWork`](#method-eth_submitwork) - - [Params](#params-2) - - [Returns](#returns-2) - - [Examples](#examples-2) - - [Method `eth_submitHashrate`](#method-eth_submithashrate) - - [Params](#params-3) - - [Returns](#returns-3) - - [Examples](#examples-3) - - [History-Methods](#history-methods) - - [Method `eth_getBlockByHash`](#method-eth_getblockbyhash) - - [Params](#params-4) - - [Returns](#returns-4) - - [Examples](#examples-4) - - [Method `eth_getTransactionByHash`](#method-eth_gettransactionbyhash) - - [Params](#params-5) - - [Returns](#returns-5) - - [Examples](#examples-5) - - [Method `eth_getBlockTransactionCountByNumber`](#method-eth_getblocktransactioncountbynumber) - - [Params](#params-6) - - [Returns](#returns-6) - - [Examples](#examples-6) - - [Method `eth_getTransactionReceipt`](#method-eth_gettransactionreceipt) - - [Params](#params-7) - - [Returns](#returns-7) - - [Examples](#examples-7) - - [Method `eth_feeHistory`](#method-eth_feehistory) - - [Params](#params-8) - - [Returns](#returns-8) - - [Examples](#examples-8) - - [Method `eth_getBlockTransactionCountByHash`](#method-eth_getblocktransactioncountbyhash) - - [Params](#params-9) - - [Returns](#returns-9) - - [Examples](#examples-9) - - [Method `eth_getTransactionByBlockHashAndIndex`](#method-eth_gettransactionbyblockhashandindex) - - [Params](#params-10) - - [Returns](#returns-10) - - [Examples](#examples-10) - - [Method `eth_getTransactionByBlockNumberAndIndex`](#method-eth_gettransactionbyblocknumberandindex) - - [Params](#params-11) - - [Returns](#returns-11) - - [Examples](#examples-11) - - [Method `eth_getBlockByNumber`](#method-eth_getblockbynumber) - - [Params](#params-12) - - [Returns](#returns-12) - - [Examples](#examples-12) - - [Method `eth_getProof`](#method-eth_getproof) - - [Params](#params-13) - - [Returns](#returns-13) - - [Examples](#examples-13) - - [State-Methods](#state-methods) - - [Method `eth_getTransactionCount`](#method-eth_gettransactioncount) - - [Params](#params-14) - - [Returns](#returns-14) - - [Examples](#examples-14) - - [Method `eth_getBalance`](#method-eth_getbalance) - - [Params](#params-15) - - [Returns](#returns-15) - - [Examples](#examples-15) - - [Method `eth_chainId`](#method-eth_chainid) - - [Params](#params-16) - - [Returns](#returns-16) - - [Examples](#examples-16) - - [Method `net_version`](#method-net_version) - - [Params](#params-17) - - [Returns](#returns-17) - - [Examples](#examples-17) - - [Method `eth_call`](#method-eth_call) - - [Params](#params-18) - - [Returns](#returns-18) - - [Examples](#examples-18) - - [Method `eth_estimateGas`](#method-eth_estimategas) - - [Params](#params-19) - - [Returns](#returns-19) - - [Examples](#examples-19) - - [Method `eth_getCode`](#method-eth_getcode) - - [Params](#params-20) - - [Returns](#returns-20) - - [Examples](#examples-20) - - [Method `eth_gasPrice`](#method-eth_gasprice) - - [Params](#params-21) - - [Returns](#returns-21) - - [Examples](#examples-21) - - [Method `net_listening`](#method-net_listening) - - [Params](#params-22) - - [Returns](#returns-22) - - [Examples](#examples-22) - - [Method `eth_mining`](#method-eth_mining) - - [Params](#params-23) - - [Returns](#returns-23) - - [Examples](#examples-23) - - [Method `net_peerCount`](#method-net_peercount) - - [Params](#params-24) - - [Returns](#returns-24) - - [Examples](#examples-24) - - [Method `eth_syncing`](#method-eth_syncing) - - [Params](#params-25) - - [Returns](#returns-25) - - [Examples](#examples-25) - - [Method `eth_getLogs`](#method-eth_getlogs) - - [Params](#params-26) - - [Returns](#returns-26) - - [Examples](#examples-26) - - [Method `web3_clientVersion`](#method-web3_clientversion) - - [Params](#params-27) - - [Returns](#returns-27) - - [Examples](#examples-27) - - [Method `eth_accounts`](#method-eth_accounts) - - [Params](#params-28) - - [Returns](#returns-28) - - [Examples](#examples-28) - - [Method `web3_sha3`](#method-web3_sha3) - - [Params](#params-29) - - [Returns](#returns-29) - - [Examples](#examples-29) - - [Method `eth_getStorageAt`](#method-eth_getstorageat) - - [Params](#params-30) - - [Returns](#returns-30) - - [Examples](#examples-30) - - [Method `eth_coinbase`](#method-eth_coinbase) - - [Params](#params-31) - - [Returns](#returns-31) - - [Examples](#examples-31) - - [Method `eth_hashrate`](#method-eth_hashrate) - - [Params](#params-32) - - [Returns](#returns-32) - - [Examples](#examples-32) - - [Method `axon_getCurrentMetadata`](#method-axon_getcurrentmetadata) - - [Params](#params-33) - - [Returns](#returns-33) - - [Examples](#examples-33) - - [Method `axon_getHardforkInfo`](#method-axon_gethardforkinfo) - - [Params](#params-34) - - [Returns](#returns-34) - - [Examples](#examples-34) - - [RPC Types](#rpc-types) - - [Type `Web3Filter`](#type-web3filter) - - [Fields](#fields) - - [Type `Web3Log`](#type-web3log) - - [Fields](#fields-1) - - [Type `Web3SyncStatus`](#type-web3syncstatus) - - [Fields](#fields-2) - - [Type `Web3CallRequest`](#type-web3callrequest) - - [Fields](#fields-3) - - [Type `AccessList`](#type-accesslist) - - [Fields](#fields-4) - - [Type `AccessListItem`](#type-accesslistitem) - - [Fields](#fields-5) - - [Type `BlockView`](#type-blockview) - - [Fields](#fields-6) - - [Type `Web3FeeHistory`](#type-web3feehistory) - - [Fields](#fields-7) - - [Type `Web3Receipt`](#type-web3receipt) - - [Fields](#fields-8) - - [Type `Web3ReceiptLog`](#type-web3receiptlog) - - [Fields](#fields-9) - - [Type `BlockId`](#type-blockid) - - [Type `H256`](#type-h256) - - [Examples](#examples-35) - - [Type `H160`](#type-h160) - - [Examples](#examples-36) - - [Type `Hex`](#type-hex) - - [Examples](#examples-37) - - [Type `Hash`](#type-hash) - - [Examples](#examples-38) - - [Type `String`](#type-string) - - [Examples](#examples-39) - - [Type `bool`](#type-bool) - - [Examples](#examples-40) - - [Type `f64`](#type-f64) - - [Type `Bloom`](#type-bloom) - - [Type `U64`](#type-u64) - - [Type `U256`](#type-u256) - - [Type `TransactionView`](#type-transactionview) - - [Fields](#fields-10) - - [Examples](#examples-41) - + - [JSONRPC Deprecation Process](#jsonrpc-deprecation-process) + - [Table of Contents](#table-of-contents) + - [RPC Methods](#rpc-methods) + - [Gossip-Methods](#gossip-methods) + - [Method `eth_sendRawTransaction`](#method-eth_sendrawtransaction) + - [Params](#params) + - [Returns](#returns) + - [Examples](#examples) + - [Method `eth_blockNumber`](#method-eth_blocknumber) + - [Params](#params-1) + - [Returns](#returns-1) + - [Examples](#examples-1) + - [Method `eth_submitWork`](#method-eth_submitwork) + - [Params](#params-2) + - [Returns](#returns-2) + - [Examples](#examples-2) + - [Method `eth_submitHashrate`](#method-eth_submithashrate) + - [Params](#params-3) + - [Returns](#returns-3) + - [Examples](#examples-3) + - [History-Methods](#history-methods) + - [Method `eth_getBlockByHash`](#method-eth_getblockbyhash) + - [Params](#params-4) + - [Returns](#returns-4) + - [Examples](#examples-4) + - [Method `eth_getTransactionByHash`](#method-eth_gettransactionbyhash) + - [Params](#params-5) + - [Returns](#returns-5) + - [Examples](#examples-5) + - [Method `eth_getBlockTransactionCountByNumber`](#method-eth_getblocktransactioncountbynumber) + - [Params](#params-6) + - [Returns](#returns-6) + - [Examples](#examples-6) + - [Method `eth_getTransactionReceipt`](#method-eth_gettransactionreceipt) + - [Params](#params-7) + - [Returns](#returns-7) + - [Examples](#examples-7) + - [Method `eth_feeHistory`](#method-eth_feehistory) + - [Params](#params-8) + - [Returns](#returns-8) + - [Examples](#examples-8) + - [Method `eth_getBlockTransactionCountByHash`](#method-eth_getblocktransactioncountbyhash) + - [Params](#params-9) + - [Returns](#returns-9) + - [Examples](#examples-9) + - [Method `eth_getTransactionByBlockHashAndIndex`](#method-eth_gettransactionbyblockhashandindex) + - [Params](#params-10) + - [Returns](#returns-10) + - [Examples](#examples-10) + - [Method `eth_getTransactionByBlockNumberAndIndex`](#method-eth_gettransactionbyblocknumberandindex) + - [Params](#params-11) + - [Returns](#returns-11) + - [Examples](#examples-11) + - [Method `eth_getBlockByNumber`](#method-eth_getblockbynumber) + - [Params](#params-12) + - [Returns](#returns-12) + - [Examples](#examples-12) + - [Method `eth_getProof`](#method-eth_getproof) + - [Params](#params-13) + - [Returns](#returns-13) + - [Examples](#examples-13) + - [State-Methods](#state-methods) + - [Method `eth_getTransactionCount`](#method-eth_gettransactioncount) + - [Params](#params-14) + - [Returns](#returns-14) + - [Examples](#examples-14) + - [Method `eth_getBalance`](#method-eth_getbalance) + - [Params](#params-15) + - [Returns](#returns-15) + - [Examples](#examples-15) + - [Method `eth_chainId`](#method-eth_chainid) + - [Params](#params-16) + - [Returns](#returns-16) + - [Examples](#examples-16) + - [Method `net_version`](#method-net_version) + - [Params](#params-17) + - [Returns](#returns-17) + - [Examples](#examples-17) + - [Method `eth_call`](#method-eth_call) + - [Params](#params-18) + - [Returns](#returns-18) + - [Examples](#examples-18) + - [Method `eth_estimateGas`](#method-eth_estimategas) + - [Params](#params-19) + - [Returns](#returns-19) + - [Examples](#examples-19) + - [Method `eth_getCode`](#method-eth_getcode) + - [Params](#params-20) + - [Returns](#returns-20) + - [Examples](#examples-20) + - [Method `eth_gasPrice`](#method-eth_gasprice) + - [Params](#params-21) + - [Returns](#returns-21) + - [Examples](#examples-21) + - [Method `net_listening`](#method-net_listening) + - [Params](#params-22) + - [Returns](#returns-22) + - [Examples](#examples-22) + - [Method `eth_mining`](#method-eth_mining) + - [Params](#params-23) + - [Returns](#returns-23) + - [Examples](#examples-23) + - [Method `net_peerCount`](#method-net_peercount) + - [Params](#params-24) + - [Returns](#returns-24) + - [Examples](#examples-24) + - [Method `eth_syncing`](#method-eth_syncing) + - [Params](#params-25) + - [Returns](#returns-25) + - [Examples](#examples-25) + - [Method `eth_getLogs`](#method-eth_getlogs) + - [Params](#params-26) + - [Returns](#returns-26) + - [Examples](#examples-26) + - [Method `web3_clientVersion`](#method-web3_clientversion) + - [Params](#params-27) + - [Returns](#returns-27) + - [Examples](#examples-27) + - [Method `eth_accounts`](#method-eth_accounts) + - [Params](#params-28) + - [Returns](#returns-28) + - [Examples](#examples-28) + - [Method `web3_sha3`](#method-web3_sha3) + - [Params](#params-29) + - [Returns](#returns-29) + - [Examples](#examples-29) + - [Method `eth_getStorageAt`](#method-eth_getstorageat) + - [Params](#params-30) + - [Returns](#returns-30) + - [Examples](#examples-30) + - [Method `eth_coinbase`](#method-eth_coinbase) + - [Params](#params-31) + - [Returns](#returns-31) + - [Examples](#examples-31) + - [Method `eth_hashrate`](#method-eth_hashrate) + - [Params](#params-32) + - [Returns](#returns-32) + - [Examples](#examples-32) + - [Method `axon_getCurrentMetadata`](#method-axon_getcurrentmetadata) + - [Params](#params-33) + - [Returns](#returns-33) + - [Examples](#examples-33) + - [Method `axon_getHardforkInfo`](#method-axon_gethardforkinfo) + - [Params](#params-34) + - [Returns](#returns-34) + - [Examples](#examples-34) + - [RPC Types](#rpc-types) + - [Type `Web3Filter`](#type-web3filter) + - [Fields](#fields) + - [Type `Web3Log`](#type-web3log) + - [Fields](#fields-1) + - [Type `Web3SyncStatus`](#type-web3syncstatus) + - [Fields](#fields-2) + - [Type `Web3CallRequest`](#type-web3callrequest) + - [Fields](#fields-3) + - [Type `AccessList`](#type-accesslist) + - [Fields](#fields-4) + - [Type `AccessListItem`](#type-accesslistitem) + - [Fields](#fields-5) + - [Type `BlockView`](#type-blockview) + - [Fields](#fields-6) + - [Type `Web3FeeHistory`](#type-web3feehistory) + - [Fields](#fields-7) + - [Type `Web3Receipt`](#type-web3receipt) + - [Fields](#fields-8) + - [Type `Web3ReceiptLog`](#type-web3receiptlog) + - [Fields](#fields-9) + - [Type `BlockId`](#type-blockid) + - [Type `H256`](#type-h256) + - [Examples](#examples-35) + - [Type `H160`](#type-h160) + - [Examples](#examples-36) + - [Type `Hex`](#type-hex) + - [Examples](#examples-37) + - [Type `Hash`](#type-hash) + - [Examples](#examples-38) + - [Type `String`](#type-string) + - [Examples](#examples-39) + - [Type `bool`](#type-bool) + - [Examples](#examples-40) + - [Type `f64`](#type-f64) + - [Type `Bloom`](#type-bloom) + - [Type `U64`](#type-u64) + - [Type `U256`](#type-u256) + - [Type `TransactionView`](#type-transactionview) + - [Fields](#fields-10) + - [Examples](#examples-41) ## RPC Methods @@ -206,18 +203,17 @@ Axon JSON-RPC allow you to interact with a local or remote axon node using HTTP, These methods track the head of the chain. This is how transactions make their way around the network, find their way into blocks, and how clients find out about new blocks. - #### Method `eth_sendRawTransaction` -* `eth_sendRawTransaction(data)` - * `data`: [`Hex`](#type-Hex) -* result: [`H256`](#type-H256) + +- `eth_sendRawTransaction(data)` + - `data`: [`Hex`](#type-Hex) +- result: [`H256`](#type-H256) Submits a pre-signed transaction for broadcast to the Axon network. ##### Params -* `data` - The signed transaction data. - +- `data` - The signed transaction data. ##### Returns @@ -227,40 +223,37 @@ TRANSACTION HASH - 32 Bytes - the transaction hash. Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": [ - "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" + "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" ] } ``` - Response - ``` { "id": 1, "jsonrpc": "2.0", - "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" + "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" } ``` #### Method `eth_blockNumber` -* `eth_blockNumber()` -* result: [`U256`](#type-U256) + +- `eth_blockNumber()` +- result: [`U256`](#type-U256) Returns the current "latest" block number. ##### Params -* None - +- None ##### Returns @@ -270,7 +263,6 @@ BLOCK NUMBER - a hex code of an integer representing the current block number th Request - ``` { "id": 1, @@ -281,57 +273,54 @@ Request } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x3466", - "id": 2 + "jsonrpc": "2.0", + "result": "0x3466", + "id": 2 } ``` #### Method `eth_submitWork` -* `eth_submitWork(nc,hash,summary)` - * `nc`: [`U256`](#type-U256) - * `hash`: [`H256`](#type-H256) - * `summary`: [`Hex`](#type-Hex) -* result: [`bool`](#type-bool) + +- `eth_submitWork(nc,hash,summary)` + - `nc`: [`U256`](#type-U256) + - `hash`: [`H256`](#type-H256) + - `summary`: [`Hex`](#type-Hex) +- result: [`bool`](#type-bool) Used for submitting a proof-of-work solution. Since the axon does not use it, so returns true forever. ##### Params -* `nc` - 8 Bytes - The nonce found (64 bits) -* `hash` - 32 Bytes - The header's pow-hash (256 bits) -* `summary` - 32 Bytes - The mix digest (256 bits) +- `nc` - 8 Bytes - The nonce found (64 bits) +- `hash` - 32 Bytes - The header's pow-hash (256 bits) +- `summary` - 32 Bytes - The mix digest (256 bits) + ##### Returns - Boolean - returns true if the provided solution is valid, otherwise false.Since the axon does not use it, so return true forever. +Boolean - returns true if the provided solution is valid, otherwise false.Since the axon does not use it, so return true forever. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_submitWork", - "params": [ - "0x0000000000000001", - "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000" - ], - "id": 64 + "jsonrpc": "2.0", + "method": "eth_submitWork", + "params": [ + "0x0000000000000001", + "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1GE5700000000000000000000000000D1GE5700000000000000000000000000" + ], + "id": 64 } ``` - Response - ``` { "id":64, @@ -342,41 +331,40 @@ Response ``` #### Method `eth_submitHashrate` -* `eth_submitHashrate(hash_rate,client_id)` - * `hash_rate`: [`Hex`](#type-Hex) - * `client_id`: [`Hex`](#type-Hex) -* result: [`bool`](#type-bool) + +- `eth_submitHashrate(hash_rate,client_id)` + - `hash_rate`: [`Hex`](#type-Hex) + - `client_id`: [`Hex`](#type-Hex) +- result: [`bool`](#type-bool) Used for submitting mining hashrate. This method always returns true. ##### Params -* `hash_rate` - Hashrate, a hexadecimal string representation (32 bytes) of the hash rate -* `client_id` - ID, String - A random hexadecimal(32 bytes) ID identifying the client +- `hash_rate` - Hashrate, a hexadecimal string representation (32 bytes) of the hash rate +- `client_id` - ID, String - A random hexadecimal(32 bytes) ID identifying the client + ##### Returns - Boolean - returns true if submitting went through successfully and false otherwise. +Boolean - returns true if submitting went through successfully and false otherwise. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_submitHashrate", - "params": [ - "0x0000000000000000000000000000000000000000000000000000000000500000", "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" - ], - "id": 64 + "jsonrpc": "2.0", + "method": "eth_submitHashrate", + "params": [ + "0x0000000000000000000000000000000000000000000000000000000000500000", "0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c" + ], + "id": 64 } ``` - Response - ``` { "id":64, @@ -386,130 +374,125 @@ Response ``` - - ### History-Methods + Fetches historical records of every block back to genesis. This is like one large append-only file, and includes all block headers, block bodies, uncle blocks, and transaction receipts. #### Method `eth_getBlockByHash` -* `eth_getBlockByHash(hash,show_rich_tx)` - * `hash`: [`H256`](#type-H256) - * `show_rich_tx`: [`bool`](#type-bool) -* result: [`BlockView`](#type-BlockView) -Returns information about a block by hash. +- `eth_getBlockByHash(hash,show_rich_tx)` + - `hash`: [`H256`](#type-H256) + - `show_rich_tx`: [`bool`](#type-bool) +- result: [`BlockView`](#type-BlockView) +Returns information about a block by hash. ##### Params -* `block_hash` - DATA, 32 Bytes - Hash of a block. -* `show_rich_tx` - Boolean, If true it returns the full transaction objects, if false only the hashes of the transactions. - +- `block_hash` - DATA, 32 Bytes - Hash of a block. +- `show_rich_tx` - Boolean, If true it returns the full transaction objects, if false only the hashes of the transactions. ##### Returns + The RPC returns the block details by block hash. ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ - "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - true + "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + true ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "hash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "parentHash": "0xd619791daa02617ae2825a4ad7f2eb1379a069ac7b96b1628e75e1e654d5163c", - "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", - "author": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", - "miner": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", - "stateRoot": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", - "transactionsRoot": "0x30fe4f21201c335b4501d517872d4d26bec39d350f987ee94e46e27bf7c48aae", - "receiptsRoot": "0x77f8178b9f5a0e4aa59ee10d3d96cacfd0d6137fd3728cc01b5e5d6d74f6813f", - "number": "0x1b4", - "gasUsed": "0xc665442", - "gasLimit": "0x1c9c380", - "extraData": "0x", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000", - "timestamp": "0x62e00014", - "difficulty": "0x1", - "totalDifficulty": null, - "sealFields": [], - "baseFeePerGas": "0x539", - "uncles": [], - "transactions": [{ - "type": "0x2", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "hash": "0xde3e1e12fb3f1a5b6ca32f580f0e7f170195f7a5233eb7d7095c53d7f5c519f5", - "nonce": "0x2", - "transactionIndex": "0x1b71", - "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", - "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "value": "0x0", - "gas": "0x0", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8af05028477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a07bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6a033e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d355f97070", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0x7bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6", - "s": "0x33e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3" - }], - "size": "0x28f", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "hash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "parentHash": "0xd619791daa02617ae2825a4ad7f2eb1379a069ac7b96b1628e75e1e654d5163c", + "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", + "author": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", + "miner": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", + "stateRoot": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", + "transactionsRoot": "0x30fe4f21201c335b4501d517872d4d26bec39d350f987ee94e46e27bf7c48aae", + "receiptsRoot": "0x77f8178b9f5a0e4aa59ee10d3d96cacfd0d6137fd3728cc01b5e5d6d74f6813f", + "number": "0x1b4", + "gasUsed": "0xc665442", + "gasLimit": "0x1c9c380", + "extraData": "0x", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000", + "timestamp": "0x62e00014", + "difficulty": "0x1", + "totalDifficulty": null, + "sealFields": [], + "baseFeePerGas": "0x539", + "uncles": [], + "transactions": [{ + "type": "0x2", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "hash": "0xde3e1e12fb3f1a5b6ca32f580f0e7f170195f7a5233eb7d7095c53d7f5c519f5", + "nonce": "0x2", + "transactionIndex": "0x1b71", + "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", + "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "value": "0x0", + "gas": "0x0", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8af05028477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a07bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6a033e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d355f97070", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0x7bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6", + "s": "0x33e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3" + }], + "size": "0x28f", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0" + }, + "id": 2 } ``` - #### Method `eth_getTransactionByHash` -* `eth_getTransactionByHash(blockHash)` - * `blockHash`: [`H256`](#type-H256) -* result: [`TransactionView`](#type-TransactionView) -Returns the information about a transaction requested by transaction hash. +- `eth_getTransactionByHash(blockHash)` + - `blockHash`: [`H256`](#type-H256) +- result: [`TransactionView`](#type-TransactionView) +Returns the information about a transaction requested by transaction hash. ##### Params -* `blockHash` - Hash of a transaction. - +- `blockHash` - Hash of a transaction. ##### Returns Object - A transaction object, or null when no transaction was found: + - blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. - blockNumber: QUANTITY - block number where this transaction was in. null when its pending. - from: DATA, 20 Bytes - address of the sender. - gas: QUANTITY - gas provided by the sender. - gasPrice: QUANTITY - gas price provided by the sender in Wei. - hash: DATA, 32 Bytes - hash of the transaction. -- input: DATA - the data send along with the transaction. -- nonce: QUANTITY - the number of transactions made by the sender prior to this one. +- input: DATA - the data send along with the transaction. +- nonce: QUANTITY - the number of transactions made by the sender prior to this one. - to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. - value: QUANTITY - value transferred in Wei. @@ -521,259 +504,243 @@ Object - A transaction object, or null when no transaction was found: Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getTransactionByHash", "params": [ - "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" + "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "type": "0x2", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "hash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", - "nonce": "0x1", - "transactionIndex": "0x1b70", - "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", - "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "value": "0x0", - "gas": "0x73a9", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8af05018477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0fa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3da06079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d456798989", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0xfa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3d", - "s": "0x6079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "type": "0x2", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "hash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", + "nonce": "0x1", + "transactionIndex": "0x1b70", + "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", + "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "value": "0x0", + "gas": "0x73a9", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8af05018477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0fa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3da06079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d456798989", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0xfa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3d", + "s": "0x6079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2" + }, + "id": 2 } ``` #### Method `eth_getBlockTransactionCountByNumber` -* `eth_getBlockTransactionCountByNumber(number)` - * `number`: [`BlockId`](#type-BlockId) -* result: [`U256`](#type-U256) - -Returns the number of transactions in a block matching the given block number. - +- `eth_getBlockTransactionCountByNumber(number)` + - `number`: [`BlockId`](#type-BlockId) +- result: [`U256`](#type-U256) +Returns the number of transactions in a block matching the given block number. ##### Params -* `number` - A block number. +- `number` - A block number. ##### Returns + Integer of the number of transactions in this block. ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByNumber", "params": [ - "0xe90" + "0xe90" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x1bb6", - "id": 2 + "jsonrpc": "2.0", + "result": "0x1bb6", + "id": 2 } ``` #### Method `eth_getTransactionReceipt` -* `eth_getTransactionReceipt(hash)` - * `hash`: [`H256`](#type-H256) -* result: [`Web3Receipt`](#type-Web3Receipt) -Returns the receipt of a transaction by transaction hash. +- `eth_getTransactionReceipt(hash)` + - `hash`: [`H256`](#type-H256) +- result: [`Web3Receipt`](#type-Web3Receipt) -*Note:* That the receipt is not available for pending transactions. +Returns the receipt of a transaction by transaction hash. +_Note:_ That the receipt is not available for pending transactions. ##### Params -* `hash` - 32 Bytes - hash of a transaction. - +- `hash` - 32 Bytes - hash of a transaction. ##### Returns -* Object - A transaction receipt object, or null when no receipt was found. - * transactionHash : DATA, 32 Bytes - hash of the transaction. - * transactionIndex: QUANTITY - integer of the transactions index position in the block. - * blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. - * blockNumber: QUANTITY - block number where this transaction was in. - * from: DATA, 20 Bytes - address of the sender. - * to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - * cumulativeGasUsed : QUANTITY - The total amount of gas used when this transaction was executed in the block. - * gasUsed : QUANTITY - The amount of gas used by this specific transaction alone. - * contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a * contract creation, otherwise null. - * logs: Array - Array of log objects, which this transaction generated. - * logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. It also returns either : - * root : DATA 32 bytes of post-transaction stateroot (pre Byzantium) - * status: QUANTITY either 1 (success) or 0 (failure) + +- Object - A transaction receipt object, or null when no receipt was found. + - transactionHash : DATA, 32 Bytes - hash of the transaction. + - transactionIndex: QUANTITY - integer of the transactions index position in the block. + - blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. + - blockNumber: QUANTITY - block number where this transaction was in. + - from: DATA, 20 Bytes - address of the sender. + - to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. + - cumulativeGasUsed : QUANTITY - The total amount of gas used when this transaction was executed in the block. + - gasUsed : QUANTITY - The amount of gas used by this specific transaction alone. + - contractAddress : DATA, 20 Bytes - The contract address created, if the transaction was a \* contract creation, otherwise null. + - logs: Array - Array of log objects, which this transaction generated. + - logsBloom: DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. It also returns either : + - root : DATA 32 bytes of post-transaction stateroot (pre Byzantium) + - status: QUANTITY either 1 (success) or 0 (failure) ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": [ - "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" + "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "contractAddress": null, - "cumulativeGasUsed": "0x73a9", - "effectiveGasPrice": "0x73a9", - "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", - "gasUsed": "0x73a9", - "logs": [{ - "address": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000092df69a492c93d22c90247434b8d80944daa38fa", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "transactionHash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", - "transactionIndex": "0x1b70", - "logIndex": "0x0", - "removed": false - }], - "logsBloom": "0x20000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000002000000000000000008000000000000000000040000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000", - "root": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", - "status": "0x1", - "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "transactionHash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", - "transactionIndex": "0x1b70", - "type": "0x2" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "contractAddress": null, + "cumulativeGasUsed": "0x73a9", + "effectiveGasPrice": "0x73a9", + "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", + "gasUsed": "0x73a9", + "logs": [{ + "address": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x00000000000000000000000092df69a492c93d22c90247434b8d80944daa38fa", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "transactionHash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", + "transactionIndex": "0x1b70", + "logIndex": "0x0", + "removed": false + }], + "logsBloom": "0x20000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000002008000000000000000000000000000000002000000000000000008000000000000000000040000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000", + "root": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", + "status": "0x1", + "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "transactionHash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", + "transactionIndex": "0x1b70", + "type": "0x2" + }, + "id": 2 } ``` #### Method `eth_feeHistory` -* `eth_feeHistory(block_count,newest_block,reward_percentiles)` - * `block_count`: [`U256`](#type-U256) - * `newest_block`: [`BlockId`](#type-BlockId) - * `reward_percentiles`: `Array<`[`f64`](#type-f64)`>` -* result: [`Web3FeeHistory`](#type-Web3FeeHistory) +- `eth_feeHistory(block_count,newest_block,reward_percentiles)` + - `block_count`: [`U256`](#type-U256) + - `newest_block`: [`BlockId`](#type-BlockId) + - `reward_percentiles`: `Array<`[`f64`](#type-f64)`>` +- result: [`Web3FeeHistory`](#type-Web3FeeHistory) Returns base fee per gas and transaction effective priority fee per gas history for the requested block range if available. The range between headBlock-4 and headBlock is guaranteed to be available while retrieving data from the pending block and older history are optional to support. For pre-EIP-1559 blocks, the gas prices are returned as rewards and zeroes are returned for the base fee per gas. blockCount and newestBlock are both required parameters - ##### Params -* `block_count` - 256-bit unsigned integer. -* `newest_block` - A block number. -* `reward_percentiles` - (optional) A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used. - +- `block_count` - 256-bit unsigned integer. +- `newest_block` - A block number. +- `reward_percentiles` - (optional) A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used. ##### Returns -* oldestBlock - Lowest number block of the returned range expressed as a hexidecimal number. -* baseFeePerGas - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks. -* gasUsedRatio - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. -* reward - An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. + +- oldestBlock - Lowest number block of the returned range expressed as a hexidecimal number. +- baseFeePerGas - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks. +- gasUsedRatio - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. +- reward - An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_feeHistory", "params": [ - "0x1", - "latest" - [20, 30], + "0x1", + "latest" + [20, 30], ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "oldestBlock": "0x0", - "baseFeePerGas": ["0x539","0x539"], - "gasUsedRatio": [0.0], - "reward": [["0x0"]] - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "oldestBlock": "0x0", + "baseFeePerGas": ["0x539","0x539"], + "gasUsedRatio": [0.0], + "reward": [["0x0"]] + }, + "id": 2 } ``` #### Method `eth_getBlockTransactionCountByHash` -* `eth_getBlockTransactionCountByHash(hash)` - * `hash`: [`Hash`](#type-Hash) -* result: [`U256`](#type-U256) -Returns the number of transactions in a block from a block matching the given block hash. +- `eth_getBlockTransactionCountByHash(hash)` + - `hash`: [`Hash`](#type-Hash) +- result: [`U256`](#type-U256) +Returns the number of transactions in a block from a block matching the given block hash. ##### Params -* `hash` - 32 Bytes - hash of a block - - +- `hash` - 32 Bytes - hash of a block ##### Returns @@ -783,297 +750,277 @@ Integer of the number of transactions in this block. Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getBlockTransactionCountByHash", "params": [ - "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" + "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x1b72", - "id": 2 + "jsonrpc": "2.0", + "result": "0x1b72", + "id": 2 } ``` #### Method `eth_getTransactionByBlockHashAndIndex` -* `eth_getTransactionByBlockHashAndIndex(hash,position)` - * `hash`: [`Hash`](#type-Hash) - * `position`: [`U256`](#type-U256) -* result: [`TransactionView`](#type-TransactionView) -Returns information about a transaction by block hash and transaction index position. +- `eth_getTransactionByBlockHashAndIndex(hash,position)` + - `hash`: [`Hash`](#type-Hash) + - `position`: [`U256`](#type-U256) +- result: [`TransactionView`](#type-TransactionView) +Returns information about a transaction by block hash and transaction index position. ##### Params -* `hash` - 32 Bytes - hash of a block -* `position` - integer of the transaction index position. - - +- `hash` - 32 Bytes - hash of a block +- `position` - integer of the transaction index position. ##### Returns -* Object - A transaction object, or null when no transaction was found: - * blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. - * blockNumber: QUANTITY - block number where this transaction was in. null when its pending. - * from: DATA, 20 Bytes - address of the sender. - * gas: QUANTITY - gas provided by the sender. - * gasPrice: QUANTITY - gas price provided by the sender in Wei. - * hash: DATA, 32 Bytes - hash of the transaction. - * input: DATA - the data send along with the transaction. - * nonce: QUANTITY - the number of transactions made by the sender prior to this one. - * to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - * transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. - * value: QUANTITY - value transferred in Wei. - * v: QUANTITY - ECDSA recovery id - * r: QUANTITY - ECDSA signature r - * s: QUANTITY - ECDSA signature s - +- Object - A transaction object, or null when no transaction was found: + - blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. + - blockNumber: QUANTITY - block number where this transaction was in. null when its pending. + - from: DATA, 20 Bytes - address of the sender. + - gas: QUANTITY - gas provided by the sender. + - gasPrice: QUANTITY - gas price provided by the sender in Wei. + - hash: DATA, 32 Bytes - hash of the transaction. + - input: DATA - the data send along with the transaction. + - nonce: QUANTITY - the number of transactions made by the sender prior to this one. + - to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. + - transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. + - value: QUANTITY - value transferred in Wei. + - v: QUANTITY - ECDSA recovery id + - r: QUANTITY - ECDSA signature r + - s: QUANTITY - ECDSA signature s ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ - "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", - "0x8" + "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", + "0x8" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "type": "0x2", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "hash": "0x0f7c17ba06dcb8106dd6956bfdb131cd48cfeaf2dfa21b4f16384d0a872441a2", - "nonce": "0x8", - "transactionIndex": "0x8", - "from": "0xae32a32bdad774608ab473d7ca1993e9921b6a7a", - "to": "0x057ef64e23666f000b34ae31332854acbd1c8544", - "value": "0x0", - "gas": "0x73a9", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8af05088477359400847735940082ea6094057ef64e23666f000b34ae31332854acbd1c854480b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0bd71f0ff2689b002dd58512713d91321266f23dcb0900e2b20f33e2be2222627a051f87230181b70d4736f907defbe505b2a3048e50113881c2254814c3f4ccb47", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x5651add842f3f79235ca3958f6fafa300d9c54b0632d9bbfb5d8eb926caabdf08a78e3492537223efb295324aae4080348c86bffaa4235867f10766f12345678", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0xbd71f0ff2689b002dd58512713d91321266f23dcb0900e2b20f33e2be2222627", - "s": "0x51f87230181b70d4736f907defbe505b2a3048e50113881c2254814c3f4ccb47" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "type": "0x2", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "hash": "0x0f7c17ba06dcb8106dd6956bfdb131cd48cfeaf2dfa21b4f16384d0a872441a2", + "nonce": "0x8", + "transactionIndex": "0x8", + "from": "0xae32a32bdad774608ab473d7ca1993e9921b6a7a", + "to": "0x057ef64e23666f000b34ae31332854acbd1c8544", + "value": "0x0", + "gas": "0x73a9", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8af05088477359400847735940082ea6094057ef64e23666f000b34ae31332854acbd1c854480b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0bd71f0ff2689b002dd58512713d91321266f23dcb0900e2b20f33e2be2222627a051f87230181b70d4736f907defbe505b2a3048e50113881c2254814c3f4ccb47", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x5651add842f3f79235ca3958f6fafa300d9c54b0632d9bbfb5d8eb926caabdf08a78e3492537223efb295324aae4080348c86bffaa4235867f10766f12345678", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0xbd71f0ff2689b002dd58512713d91321266f23dcb0900e2b20f33e2be2222627", + "s": "0x51f87230181b70d4736f907defbe505b2a3048e50113881c2254814c3f4ccb47" + }, + "id": 2 } ``` #### Method `eth_getTransactionByBlockNumberAndIndex` -* `eth_getTransactionByBlockNumberAndIndex(number,position)` - * `number`: [`BlockId`](#type-BlockId) - * `position`: [`U256`](#type-U256) -* result: [`TransactionView`](#type-TransactionView) -Returns information about a transaction by block number and transaction index position. +- `eth_getTransactionByBlockNumberAndIndex(number,position)` + - `number`: [`BlockId`](#type-BlockId) + - `position`: [`U256`](#type-U256) +- result: [`TransactionView`](#type-TransactionView) +Returns information about a transaction by block number and transaction index position. ##### Params -* `number` - A block number. -* `position` - integer of the transaction index position. - - +- `number` - A block number. +- `position` - integer of the transaction index position. ##### Returns -* Object - A transaction object, or null when no transaction was found: - * blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. - * blockNumber: QUANTITY - block number where this transaction was in. null when its pending. - * from: DATA, 20 Bytes - address of the sender. - * gas: QUANTITY - gas provided by the sender. - * gasPrice: QUANTITY - gas price provided by the sender in Wei. - * hash: DATA, 32 Bytes - hash of the transaction. - * input: DATA - the data send along with the transaction. - * nonce: QUANTITY - the number of transactions made by the sender prior to this one. - * to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. - * transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. - * value: QUANTITY - value transferred in Wei. - * v: QUANTITY - ECDSA recovery id - * r: QUANTITY - ECDSA signature r - * s: QUANTITY - ECDSA signature s - +- Object - A transaction object, or null when no transaction was found: + - blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending. + - blockNumber: QUANTITY - block number where this transaction was in. null when its pending. + - from: DATA, 20 Bytes - address of the sender. + - gas: QUANTITY - gas provided by the sender. + - gasPrice: QUANTITY - gas price provided by the sender in Wei. + - hash: DATA, 32 Bytes - hash of the transaction. + - input: DATA - the data send along with the transaction. + - nonce: QUANTITY - the number of transactions made by the sender prior to this one. + - to: DATA, 20 Bytes - address of the receiver. null when its a contract creation transaction. + - transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending. + - value: QUANTITY - value transferred in Wei. + - v: QUANTITY - ECDSA recovery id + - r: QUANTITY - ECDSA signature r + - s: QUANTITY - ECDSA signature s ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": [ - "0xb14", - "0x8" + "0xb14", + "0x8" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "type": "0x2", - "blockNumber": "0xb14", - "blockHash": "0xcaca33a66b32c99d157af1a9f1940c878e37dab6a95c0496a44852c91218658a", - "hash": "0x401ee5194c6628800c3437618fe47645d065fae5dcf43c540ebe7d76aa7d4be0", - "nonce": "0x123", - "transactionIndex": "0x8", - "from": "0x12247217ada7661c30a92425b62c756f54bfb5fc", - "to": "0x5fbdb2315678afecb367f032d93f642f64180aa3", - "value": "0x0", - "gas": "0x73a9", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8b1058201238477359400847735940082ea60945fbdb2315678afecb367f032d93f642f64180aa380b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0df97bdb5395f8a6a78133ea75b2dfa1fe0edd54710efe1af5766478b472b2719a036d810b450963968711e03c7b7032a1ca9d4cd5f507dbcd6a5299ab46042871d", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x5d29609b19fc299039853e319d7be4a153c4c464beca159bef943bef4d50c6fc1180058d25a56d824a32725040d394bb4251c935e834ae2bc7174361fff4dc86", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0xdf97bdb5395f8a6a78133ea75b2dfa1fe0edd54710efe1af5766478b472b2719", - "s": "0x36d810b450963968711e03c7b7032a1ca9d4cd5f507dbcd6a5299ab46042871d" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "type": "0x2", + "blockNumber": "0xb14", + "blockHash": "0xcaca33a66b32c99d157af1a9f1940c878e37dab6a95c0496a44852c91218658a", + "hash": "0x401ee5194c6628800c3437618fe47645d065fae5dcf43c540ebe7d76aa7d4be0", + "nonce": "0x123", + "transactionIndex": "0x8", + "from": "0x12247217ada7661c30a92425b62c756f54bfb5fc", + "to": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "value": "0x0", + "gas": "0x73a9", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8b1058201238477359400847735940082ea60945fbdb2315678afecb367f032d93f642f64180aa380b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0df97bdb5395f8a6a78133ea75b2dfa1fe0edd54710efe1af5766478b472b2719a036d810b450963968711e03c7b7032a1ca9d4cd5f507dbcd6a5299ab46042871d", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x5d29609b19fc299039853e319d7be4a153c4c464beca159bef943bef4d50c6fc1180058d25a56d824a32725040d394bb4251c935e834ae2bc7174361fff4dc86", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0xdf97bdb5395f8a6a78133ea75b2dfa1fe0edd54710efe1af5766478b472b2719", + "s": "0x36d810b450963968711e03c7b7032a1ca9d4cd5f507dbcd6a5299ab46042871d" + }, + "id": 2 } ``` - - #### Method `eth_getBlockByNumber` -* `eth_getBlockByNumber(number,show_rich_tx)` - * `number`: [`BlockId`](#type-BlockId) `|` `"earliest"``|` `"latest"``|` `"pending"` - * `show_rich_tx`: [`bool`](#type-bool) -* result: [`BlockView`](#type-Blockview) -Returns information about a block by block number. +- `eth_getBlockByNumber(number,show_rich_tx)` + - `number`: [`BlockId`](#type-BlockId) `|` ` "earliest"``| ` ` "latest"``| ` `"pending"` + - `show_rich_tx`: [`bool`](#type-bool) +- result: [`BlockView`](#type-Blockview) +Returns information about a block by block number. ##### Params -* `number` - A block number. -* `show_rich_tx` - Boolean,If true it returns the full transaction objects, if false only the hashes of the transactions. - +- `number` - A block number. +- `show_rich_tx` - Boolean,If true it returns the full transaction objects, if false only the hashes of the transactions. ##### Returns + The RPC returns the block details. ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": [ - "0x1b4", - true + "0x1b4", + true ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "hash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "parentHash": "0xd619791daa02617ae2825a4ad7f2eb1379a069ac7b96b1628e75e1e654d5163c", - "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", - "author": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", - "miner": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", - "stateRoot": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", - "transactionsRoot": "0x30fe4f21201c335b4501d517872d4d26bec39d350f987ee94e46e27bf7c48aae", - "receiptsRoot": "0x77f8178b9f5a0e4aa59ee10d3d96cacfd0d6137fd3728cc01b5e5d6d74f6813f", - "number": "0x1b4", - "gasUsed": "0xc665442", - "gasLimit": "0x1c9c380", - "extraData": "0x", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000", - "timestamp": "0x62e00014", - "difficulty": "0x1", - "totalDifficulty": null, - "sealFields": [], - "baseFeePerGas": "0x539", - "uncles": [], - "transactions": [{ - "type": "0x2", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "hash": "0xde3e1e12fb3f1a5b6ca32f580f0e7f170195f7a5233eb7d7095c53d7f5c519f5", - "nonce": "0x2", - "transactionIndex": "0x1b71", - "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", - "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "value": "0x0", - "gas": "0x0", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8af05028477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a07bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6a033e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d355f97070", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0x7bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6", - "s": "0x33e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3" - }], - "size": "0x28f", - "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "nonce": "0x0" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "hash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "parentHash": "0xd619791daa02617ae2825a4ad7f2eb1379a069ac7b96b1628e75e1e654d5163c", + "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", + "author": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", + "miner": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", + "stateRoot": "0xbd8e37758ba2c1d73f0c1dc3ea255f5b7c037f0e8e1ee9feb012461d58be236d", + "transactionsRoot": "0x30fe4f21201c335b4501d517872d4d26bec39d350f987ee94e46e27bf7c48aae", + "receiptsRoot": "0x77f8178b9f5a0e4aa59ee10d3d96cacfd0d6137fd3728cc01b5e5d6d74f6813f", + "number": "0x1b4", + "gasUsed": "0xc665442", + "gasLimit": "0x1c9c380", + "extraData": "0x", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000", + "timestamp": "0x62e00014", + "difficulty": "0x1", + "totalDifficulty": null, + "sealFields": [], + "baseFeePerGas": "0x539", + "uncles": [], + "transactions": [{ + "type": "0x2", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "hash": "0xde3e1e12fb3f1a5b6ca32f580f0e7f170195f7a5233eb7d7095c53d7f5c519f5", + "nonce": "0x2", + "transactionIndex": "0x1b71", + "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", + "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "value": "0x0", + "gas": "0x0", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8af05028477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a07bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6a033e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d355f97070", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0x7bf93b22eb0b40a85d0f8044d1b0201750ee1d8c27d558ae683509b13d8282e6", + "s": "0x33e17c1e2b01fed2d742a37704530cd902754d726b96d41e24b5adc7be4dcdd3" + }], + "size": "0x28f", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0" + }, + "id": 2 } ``` @@ -1082,131 +1029,131 @@ Response ##### Params -* `DATA`, 20 Bytes - address of the account. -* `ARRAY`, 32 Bytes - array of storage-keys which should be proofed and included. See eth_getStorageAt -* `QUANTITY|TAG` - integer block number, or the string "latest" or "earliest", see the default block parameter +- `DATA`, 20 Bytes - address of the account. +- `ARRAY`, 32 Bytes - array of storage-keys which should be proofed and included. See eth_getStorageAt +- `QUANTITY|TAG` - integer block number, or the string "latest" or "earliest", see the default block parameter ##### Returns Object - A account object: -* `balance`: `QUANTITY` - the balance of the account. -* `codeHash`: `DATA`, 32 Bytes - hash of the code of the account. For a simple Account without code it will return "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" -* `nonce`: `QUANTITY`, - nonce of the account. -* `storageHash`: `DATA`, 32 Bytes - SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash. -* `accountProof`: `ARRAY` - Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key. +- `balance`: `QUANTITY` - the balance of the account. +- `codeHash`: `DATA`, 32 Bytes - hash of the code of the account. For a simple Account without code it will return "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" +- `nonce`: `QUANTITY`, - nonce of the account. +- `storageHash`: `DATA`, 32 Bytes - SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash. +- `accountProof`: `ARRAY` - Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key. -* `storageProof`: `ARRAY` - Array of storage-entries as requested. Each entry is a object with these properties: - `key`: `QUANTITY` - the requested storage key - `value`: `QUANTITY` - the storage value - `proof`: `ARRAY` - Array of rlp-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path. +- `storageProof`: `ARRAY` - Array of storage-entries as requested. Each entry is a object with these properties: + `key`: `QUANTITY` - the requested storage key + `value`: `QUANTITY` - the storage value + `proof`: `ARRAY` - Array of rlp-serialized MerkleTree-Nodes, starting with the storageHash-Node, following the path of the SHA3 (key) as path. ##### Examples Request + ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getProof", "params": [ - "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", - [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], - "latest" + "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", + [ "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ], + "latest" ] } ``` Response + ``` { - "jsonrpc":"2.0", - "result":{ - "balance":"0x0", - "codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", - "nonce":"0x1", - "storageHash":"0x6fcd3e8e97da273711ccefb79abdd246c5663c7d61057f82bae745ceac5dcc75", - "accountProof":[ - "0xf9011180a063017aec481298bbc5df01d044f2a85b25f35f565864f285f88355b48332e07da0b01d7c543eaa8e9ae61ef41d6a73e4bc00010807523108be4146c01fb2812163a011deb9627b74106f9b5a605e9a5d7982e217ab4fde0acd3cf40def9010470373808080a06cd5cbddd2b22b17026df25fe3153d555656298115795903ecaa813684bc21e7a021c9bcb004c74f63f386e6cf04a0c59d425c5f8c9e28e9bf172402b431aa249ca005550a2b2f338a7daa477729d59ddecc3852e2821d920b0e4414f801abee27b8a01d65e6a5eb57de1c0b7990e75ed2f39ecb56ed7b18182d00ada8f2088893c32c80808080a0c8487d369704a81bd26ff351c89f333ae51a6adf7676739ba0995f6f97c6b31080", - "0xf85d943ab0cf264df99d83525e9e11c7e4db01558ae1b1b846f8440180a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" - ], - "storageProof":[ - { - "key" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", - "proof" : [], - "value" : "0x0" - } - ] - }, - "id":1 + "jsonrpc":"2.0", + "result":{ + "balance":"0x0", + "codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "nonce":"0x1", + "storageHash":"0x6fcd3e8e97da273711ccefb79abdd246c5663c7d61057f82bae745ceac5dcc75", + "accountProof":[ + "0xf9011180a063017aec481298bbc5df01d044f2a85b25f35f565864f285f88355b48332e07da0b01d7c543eaa8e9ae61ef41d6a73e4bc00010807523108be4146c01fb2812163a011deb9627b74106f9b5a605e9a5d7982e217ab4fde0acd3cf40def9010470373808080a06cd5cbddd2b22b17026df25fe3153d555656298115795903ecaa813684bc21e7a021c9bcb004c74f63f386e6cf04a0c59d425c5f8c9e28e9bf172402b431aa249ca005550a2b2f338a7daa477729d59ddecc3852e2821d920b0e4414f801abee27b8a01d65e6a5eb57de1c0b7990e75ed2f39ecb56ed7b18182d00ada8f2088893c32c80808080a0c8487d369704a81bd26ff351c89f333ae51a6adf7676739ba0995f6f97c6b31080", + "0xf85d943ab0cf264df99d83525e9e11c7e4db01558ae1b1b846f8440180a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ], + "storageProof":[ + { + "key" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "proof" : [], + "value" : "0x0" + } + ] + }, + "id":1 } ``` ### State-Methods + Methods that report the current state of all the data stored. The "state" is like one big shared piece of RAM, and includes account balances, contract data, and gas estimations. #### Method `eth_getTransactionCount` -* `eth_getTransactionCount(address,number)` - * `address`: [`H160`](#type-H160) - * `number`: [`BlockId`](#type-BlockId) -* result: [`U256`](#type-U256) -Returns the number of transactions sent from an address. +- `eth_getTransactionCount(address,number)` + - `address`: [`H160`](#type-H160) + - `number`: [`BlockId`](#type-BlockId) +- result: [`U256`](#type-U256) +Returns the number of transactions sent from an address. ##### Params -* `address` - 20 Bytes - address. -* `number` - Integer block number +- `address` - 20 Bytes - address. +- `number` - Integer block number ##### Returns - integer of the number of transactions send from this address. +integer of the number of transactions send from this address. ##### Examples Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getTransactionCount", "params": [ - "0x92df69a492c93d22c90247434b8d80944daa38fa" + "0x92df69a492c93d22c90247434b8d80944daa38fa" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x12c", - "id": 2 + "jsonrpc": "2.0", + "result": "0x12c", + "id": 2 } ``` #### Method `eth_getBalance` -* `eth_getBalance(address,number)` - * `address`: [`H160`](#type-H160) - * `number`: [`BlockId`](#type-BlockId) -* result: [`U256`](#type-U256) -Returns the balance of the account of given address. +- `eth_getBalance(address,number)` + - `address`: [`H160`](#type-H160) + - `number`: [`BlockId`](#type-BlockId) +- result: [`U256`](#type-U256) +Returns the balance of the account of given address. ##### Params -* `address` - 20 Bytes - address to check for balance. -* `block_number` - A block number. +- `address` - 20 Bytes - address to check for balance. +- `block_number` - A block number. ##### Returns @@ -1216,41 +1163,38 @@ Integer of the current balance in wei. Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_getBalance", "params": [ - "0x92df69a492c93d22c90247434b8d80944daa38fa" + "0x92df69a492c93d22c90247434b8d80944daa38fa" ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x8459515c8443cde72e000", - "id": 2 + "jsonrpc": "2.0", + "result": "0x8459515c8443cde72e000", + "id": 2 } ``` #### Method `eth_chainId` -* `eth_chainId()` -* result: [`U256`](#type-U256) -Returns the chain_id of axon network. +- `eth_chainId()` +- result: [`U256`](#type-U256) +Returns the chain_id of axon network. ##### Params -* None +- None ##### Returns @@ -1260,40 +1204,38 @@ Current chain id. Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "eth_chainId", "params": [ - + ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x5", - "id": 2 + "jsonrpc": "2.0", + "result": "0x5", + "id": 2 } ``` + #### Method `net_version` -* `net_version()` -* result: [`U256`](#type-U256) -Returns the current network id. +- `net_version()` +- result: [`U256`](#type-U256) +Returns the current network id. ##### Params -* None +- None ##### Returns @@ -1303,75 +1245,71 @@ String - The current network id. Request - ``` { "id": 1, "jsonrpc": "2.0", "method": "net_version", "params": [ - + ] } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x5", - "id": 2 + "jsonrpc": "2.0", + "result": "0x5", + "id": 2 } ``` + #### Method `eth_call` -* `eth_call(req,number)` - * `req`: [`Web3CallRequest`](#type-Web3CallRequest) - * `number`: [`BlockId`](#type-BlockId) -* result: [`Hex`](#type-Hex) -Executes a new message call immediately without creating a transaction on the block chain. +- `eth_call(req,number)` + - `req`: [`Web3CallRequest`](#type-Web3CallRequest) + - `number`: [`BlockId`](#type-BlockId) +- result: [`Hex`](#type-Hex) +Executes a new message call immediately without creating a transaction on the block chain. ##### Params -* `req` - The transaction call object +- `req` - The transaction call object + + - from: DATA, 20 Bytes - (optional) The address the transaction is sent from. + - to: DATA, 20 Bytes - The address the transaction is directed to. + - gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. + - gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas + - value: QUANTITY - (optional) Integer of the value sent with this transaction + - data: DATA - (optional) Hash of the method signature and encoded parameters. - * from: DATA, 20 Bytes - (optional) The address the transaction is sent from. - * to: DATA, 20 Bytes - The address the transaction is directed to. - * gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. - * gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas - * value: QUANTITY - (optional) Integer of the value sent with this transaction - * data: DATA - (optional) Hash of the method signature and encoded parameters. -* `number` - A block number. +- `number` - A block number. ##### Returns - DATA - the return value of executed contract. +DATA - the return value of executed contract. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_call", - "params": [{ - see above - }], - "id": 1 + "jsonrpc": "2.0", + "method": "eth_call", + "params": [{ + see above + }], + "id": 1 } ``` - Response - ``` { "id":1, @@ -1380,51 +1318,50 @@ Response } ``` + #### Method `eth_estimateGas` -* `eth_estimateGas(req,number)` - * `req`: [`Web3CallRequest`](#type-Web3CallRequest) - * `number`: [`BlockId`](#type-BlockId) -* result: [`U256`](#type-U256) -Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance. +- `eth_estimateGas(req,number)` + - `req`: [`Web3CallRequest`](#type-Web3CallRequest) + - `number`: [`BlockId`](#type-BlockId) +- result: [`U256`](#type-U256) +Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance. ##### Params -* `req` - The transaction call object. Expect all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit. +- `req` - The transaction call object. Expect all properties are optional. If no gas limit is specified geth uses the block gas limit from the pending block as an upper bound. As a result the returned estimate might not be enough to executed the call/transaction when the amount of gas is higher than the pending block gas limit. + + - from: DATA, 20 Bytes - (optional) The address the transaction is sent from. + - to: DATA, 20 Bytes - The address the transaction is directed to. + - gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. + - gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas + - value: QUANTITY - (optional) Integer of the value sent with this transaction + - data: DATA - (optional) Hash of the method signature and encoded parameters. - * from: DATA, 20 Bytes - (optional) The address the transaction is sent from. - * to: DATA, 20 Bytes - The address the transaction is directed to. - * gas: QUANTITY - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. - * gasPrice: QUANTITY - (optional) Integer of the gasPrice used for each paid gas - * value: QUANTITY - (optional) Integer of the value sent with this transaction - * data: DATA - (optional) Hash of the method signature and encoded parameters. -* `number` - A block number. +- `number` - A block number. ##### Returns - The amount of gas used. +The amount of gas used. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_call", - "params": [{ - see above - }], - "id": 1 + "jsonrpc": "2.0", + "method": "eth_call", + "params": [{ + see above + }], + "id": 1 } ``` - Response - ``` { "id":1, @@ -1433,45 +1370,43 @@ Response } ``` + #### Method `eth_getCode` -* `eth_getCode(address,block_number)` - * `address`: [`H160`](#type-H160) - * `block_number`: [`BlockId`](#type-BlockId) -* result: [`Hex`](#type-Hex) -Returns code at a given address. +- `eth_getCode(address,block_number)` + - `address`: [`H160`](#type-H160) + - `block_number`: [`BlockId`](#type-BlockId) +- result: [`Hex`](#type-Hex) +Returns code at a given address. ##### Params -* `address` - DATA, 20 Bytes - address. -* `block_number` -A block number. +- `address` - DATA, 20 Bytes - address. +- `block_number` -A block number. ##### Returns - The code from the given address. +The code from the given address. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_getCode", - "params": [{ - "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", - "0x2", - }], - "id": 1 + "jsonrpc": "2.0", + "method": "eth_getCode", + "params": [{ + "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x2", + }], + "id": 1 } ``` - Response - ``` { "id":1, @@ -1482,224 +1417,211 @@ Response ``` #### Method `eth_gasPrice` -* `eth_gasPrice()` - -* result: [`U256`](#type-U256) -Returns the current price per gas in wei. +- `eth_gasPrice()` +- result: [`U256`](#type-U256) + +Returns the current price per gas in wei. ##### Params -* None +- None ##### Returns - Integer of the current gas price in wei. +Integer of the current gas price in wei. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_gasPrice", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "eth_gasPrice", + "params": [], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x8", - "id": 2 + "jsonrpc": "2.0", + "result": "0x8", + "id": 2 } ``` #### Method `net_listening` -* `net_listening()` - -* result: [`bool`](#type-bool) -Returns true if client is actively listening for network connections. Always return true in Axon network. +- `net_listening()` +- result: [`bool`](#type-bool) + +Returns true if client is actively listening for network connections. Always return true in Axon network. ##### Params -* None +- None ##### Returns - Boolean - true when listening, otherwise false. +Boolean - true when listening, otherwise false. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "net_listening", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "net_listening", + "params": [], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": true, - "id": 2 + "jsonrpc": "2.0", + "result": true, + "id": 2 } ``` + #### Method `eth_mining` -* `eth_mining()` - -* result: [`bool`](#type-bool) -Returns true if client is actively mining new blocks. +- `eth_mining()` + +- result: [`bool`](#type-bool) -*Note:* Always return false in Axon network. +Returns true if client is actively mining new blocks. +_Note:_ Always return false in Axon network. ##### Params -* None +- None ##### Returns - Boolean - returns true of the client is mining, otherwise false. Always return false in Axon network. +Boolean - returns true of the client is mining, otherwise false. Always return false in Axon network. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_mining", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "eth_mining", + "params": [], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": false, - "id": 2 + "jsonrpc": "2.0", + "result": false, + "id": 2 } ``` #### Method `net_peerCount` -* `net_peerCount()` - -* result: [`U256`](#type-U256) -Returns number of peers currently connected to the client. +- `net_peerCount()` + +- result: [`U256`](#type-U256) +Returns number of peers currently connected to the client. ##### Params -* None +- None ##### Returns - Integer of the number of connected peers. +Integer of the number of connected peers. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "net_peerCount", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "net_peerCount", + "params": [], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x7", - "id": 2 + "jsonrpc": "2.0", + "result": "0x7", + "id": 2 } ``` #### Method `eth_syncing` -* `eth_syncing()` - -* result: [`Web3SyncStatus`](#type-Web3SyncStatus) `|` `false` -Returns an object with data about the sync status or false. +- `eth_syncing()` +- result: [`Web3SyncStatus`](#type-Web3SyncStatus) `|` `false` + +Returns an object with data about the sync status or false. ##### Params -* None +- None ##### Returns -* Object|Boolean, An object with sync status data or FALSE, when not syncing: - * startingBlock: QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) - * currentBlock: QUANTITY - The current block, same as eth_blockNumber - * highestBlock: QUANTITY - The estimated highest block +- Object|Boolean, An object with sync status data or FALSE, when not syncing: + - startingBlock: QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) + - currentBlock: QUANTITY - The current block, same as eth_blockNumber + - highestBlock: QUANTITY - The estimated highest block ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "net_peerCount", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "net_peerCount", + "params": [], + "id": 2 } ``` - Response - ``` { "id":1, "jsonrpc": "2.0", "result": { - startingBlock: '0x384', - currentBlock: '0x386', - highestBlock: '0x454' + startingBlock: '0x384', + currentBlock: '0x386', + highestBlock: '0x454' } } ``` Or when not syncing + ``` { "id":1, @@ -1710,89 +1632,85 @@ Or when not syncing ``` #### Method `eth_getLogs` -* `eth_getLogs(filter)` - * `filter`: [`Web3Filter`](#type-Web3Filter) -* result: `Arrary`[`Web3Log`](#type-Web3Log) -Returns an array of all logs matching a given filter object. +- `eth_getLogs(filter)` + - `filter`: [`Web3Filter`](#type-Web3Filter) +- result: `Arrary`[`Web3Log`](#type-Web3Log) +Returns an array of all logs matching a given filter object. ##### Params -* Object - The filter options: - * fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. - * toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. - * address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. - * topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options. - * blockhash: DATA, 32 Bytes - (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in in the filter criteria, then neither fromBlock nor toBlock are allowed. +- Object - The filter options: + - fromBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. + - toBlock: QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions. + - address: DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate. + - topics: Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options. + - blockhash: DATA, 32 Bytes - (optional, future) With the addition of EIP-234, blockHash will be a new filter option which restricts the logs returned to the single block with the 32-byte hash blockHash. Using blockHash is equivalent to fromBlock = toBlock = the block number with hash blockHash. If blockHash is present in in the filter criteria, then neither fromBlock nor toBlock are allowed. ##### Returns -* Object An object with web3 log data. See [`Web3Log`](#type-Web3Log). - +- Object An object with web3 log data. See [`Web3Log`](#type-Web3Log). ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_getLogs", - "params": [ - { - topics: [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - ], + "jsonrpc": "2.0", + "method": "eth_getLogs", + "params": [ + { + topics: [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + ], }, - ], - "id": 2 + ], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": [{ - "address": "0xf44bb5018bfa4a65165595f5e41f4c7456cd3575", - "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000f44bb5018bfa4a65165595f5e41f4c7456cd3575", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfbda8b37d5d004653dc18623db2467836b64b24d4880ba4e49ba18a1668f440e", - "blockNumber": "0x5d54", - "transactionHash": "0x12f6f4c0cbf388f87ef3d54e8e9a4988746edd9cf773895997cd355f74e2f635", - "transactionIndex": "0x0", - "logIndex": "0x0", - "removed": false - }, { - "address": "0xf44bb5018bfa4a65165595f5e41f4c7456cd3575", - "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000f44bb5018bfa4a65165595f5e41f4c7456cd3575", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xfbda8b37d5d004653dc18623db2467836b64b24d4880ba4e49ba18a1668f440e", - "blockNumber": "0x5d54", - "transactionHash": "0x5829bfbd0a1752441c5eaca366506757684b99071402448c39c9ae8c1f48b104", - "transactionIndex": "0x1", - "logIndex": "0x0", - "removed": false - }], - "id": 2 + "jsonrpc": "2.0", + "result": [{ + "address": "0xf44bb5018bfa4a65165595f5e41f4c7456cd3575", + "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000f44bb5018bfa4a65165595f5e41f4c7456cd3575", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfbda8b37d5d004653dc18623db2467836b64b24d4880ba4e49ba18a1668f440e", + "blockNumber": "0x5d54", + "transactionHash": "0x12f6f4c0cbf388f87ef3d54e8e9a4988746edd9cf773895997cd355f74e2f635", + "transactionIndex": "0x0", + "logIndex": "0x0", + "removed": false + }, { + "address": "0xf44bb5018bfa4a65165595f5e41f4c7456cd3575", + "topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000f44bb5018bfa4a65165595f5e41f4c7456cd3575", "0x0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e8915"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xfbda8b37d5d004653dc18623db2467836b64b24d4880ba4e49ba18a1668f440e", + "blockNumber": "0x5d54", + "transactionHash": "0x5829bfbd0a1752441c5eaca366506757684b99071402448c39c9ae8c1f48b104", + "transactionIndex": "0x1", + "logIndex": "0x0", + "removed": false + }], + "id": 2 } ``` #### Method `web3_clientVersion` -* `web3_clientVersion()` -* result: [`String`](#type-String) -Returns the current client version. +- `web3_clientVersion()` +- result: [`String`](#type-String) +Returns the current client version. ##### Params -* None +- None ##### Returns @@ -1802,37 +1720,35 @@ String - The current client version Request - ``` { - "jsonrpc": "2.0", - "method": "web3_clientVersion", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "web3_clientVersion", + "params": [], + "id": 2 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0.1.0", - "id": 2 + "jsonrpc": "2.0", + "result": "0.1.0", + "id": 2 } ``` + #### Method `eth_accounts` -* `eth_accounts()` -* result: `Array<`[`Hex`](#type-Hex)`>` -Returns a list of addresses owned by client. +- `eth_accounts()` +- result: `Array<`[`Hex`](#type-Hex)`>` +Returns a list of addresses owned by client. ##### Params -* None +- None ##### Returns @@ -1842,20 +1758,17 @@ Array of DATA, 20 Bytes - addresses owned by the client. Request - ``` { - "jsonrpc": "2.0", - "method": "eth_accounts", - "params": [], - "id": 2 + "jsonrpc": "2.0", + "method": "eth_accounts", + "params": [], + "id": 2 } ``` - Response - ``` { "id":1, @@ -1865,131 +1778,124 @@ Response ``` #### Method `web3_sha3` -* `web3_sha3(data)` - * `data`: [`Hex`](#type-Hex) -* result: [`Hash`](#type-Hash) -Returns Keccak-256 (not the standardized SHA3-256) of the given data. +- `web3_sha3(data)` + - `data`: [`Hex`](#type-Hex) +- result: [`Hash`](#type-Hash) +Returns Keccak-256 (not the standardized SHA3-256) of the given data. ##### Params -* `data` - the data to convert into a SHA3 hash +- `data` - the data to convert into a SHA3 hash ##### Returns - DATA - The SHA3 result of the given string. +DATA - The SHA3 result of the given string. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "web3_sha3", - "params": ["0x68656c6c6f20776f726c64"], - "id": 64 + "jsonrpc": "2.0", + "method": "web3_sha3", + "params": ["0x68656c6c6f20776f726c64"], + "id": 64 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", - "id": 2 + "jsonrpc": "2.0", + "result": "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", + "id": 2 } ``` #### Method `eth_getStorageAt` -* `eth_getStorageAt(address,position,number)` - * `address`: [`H160`](#type-H160) - * `position`: [`U256`](#type-U256) - * `number`: [`BlockId`](#type-BlockId) -* result: [`Hex`](#type-Hex) -Returns the value from a storage position at a given address. +- `eth_getStorageAt(address,position,number)` + - `address`: [`H160`](#type-H160) + - `position`: [`U256`](#type-U256) + - `number`: [`BlockId`](#type-BlockId) +- result: [`Hex`](#type-Hex) +Returns the value from a storage position at a given address. ##### Params -* `address` - 20 Bytes - address of the storage. -* `position` - integer of the position in the storage. -* `number` - A block number. +- `address` - 20 Bytes - address of the storage. +- `position` - integer of the position in the storage. +- `number` - A block number. + ##### Returns - The value at this storage position. +The value at this storage position. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "web3_sha3", - "params": [ - "0x295a70b2de5e3953354a6a8344e616ed314d7251", - "0x0", - "latest" - ], - "id": 64 + "jsonrpc": "2.0", + "method": "web3_sha3", + "params": [ + "0x295a70b2de5e3953354a6a8344e616ed314d7251", + "0x0", + "latest" + ], + "id": 64 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": "0x0000000000000000000000000000000000000000000000000000000000000000", - "id": 2 + "jsonrpc": "2.0", + "result": "0x0000000000000000000000000000000000000000000000000000000000000000", + "id": 2 } ``` #### Method `eth_coinbase` -* `eth_coinbase()` -* result: [`H160`](#type-H160) -Returns the client coinbase address. +- `eth_coinbase()` +- result: [`H160`](#type-H160) +Returns the client coinbase address. ##### Params -* None +- None + ##### Returns - DATA, 20 bytes - the current coinbase address. +DATA, 20 bytes - the current coinbase address. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_coinbase", - "params": [ - ], - "id": 64 + "jsonrpc": "2.0", + "method": "eth_coinbase", + "params": [ + ], + "id": 64 } ``` - Response - ``` { "id":64, @@ -1997,44 +1903,41 @@ Response "result": "0x407d73d8a49eeb85d32cf465507dd71d507100c1" } - ``` #### Method `eth_hashrate` -* `eth_hashrate()` -* result: [`U256`](#type-U256) -Returns the number of hashes per second that the node is mining with. +- `eth_hashrate()` +- result: [`U256`](#type-U256) -*Note:* Always return 1 in Axon network. +Returns the number of hashes per second that the node is mining with. +_Note:_ Always return 1 in Axon network. ##### Params -* None +- None + ##### Returns - QUANTITY - number of hashes per second. +QUANTITY - number of hashes per second. ##### Examples Request - ``` { - "jsonrpc": "2.0", - "method": "eth_hashrate", - "params": [ - ], - "id": 64 + "jsonrpc": "2.0", + "method": "eth_hashrate", + "params": [ + ], + "id": 64 } ``` - Response - ``` { "id":64, @@ -2042,18 +1945,18 @@ Response "result": "0x38a" } - ``` #### Method `axon_getCurrentMetadata` -* `axon_getCurrentMetadata()` -* result: [`Metadata`](#Metadata) + +- `axon_getCurrentMetadata()` +- result: [`Metadata`](#Metadata) Returns axon current metadata info. ##### Params -* None +- None ##### Returns @@ -2063,66 +1966,64 @@ Returns axon current metadata info. Request - ``` { - "jsonrpc": "2.0", - "method": "axon_getCurrentMetadata", - "params": [ - ], - "id": 64 + "jsonrpc": "2.0", + "method": "axon_getCurrentMetadata", + "params": [ + ], + "id": 64 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "version": { - "start": "0x1", - "end": "0x5f5e100" - }, - "epoch": "0x0", - "verifier_list": [{ - "bls_pub_key": "0xa26e3fe1cf51bd4822072c61bdc315ac32e3d3c2e2484bb92942666399e863b4bf56cf2926383cc706ffc15dfebc85c6", - "pub_key": "0x031ddc35212b7fc7ff6685b17d91f77c972535aee5c7ae5684d3e72b986f08834b", - "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", - "propose_weight": "0x1", - "vote_weight": "0x1" - }], - "propose_counter": [{ - "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", - "count": "0xb4" - }], - "consensus_config": { - "gas_limit": "0x3e7fffffc18", - "interval": "0xbb8", - "propose_ratio": "0xf", - "prevote_ratio": "0xa", - "precommit_ratio": "0xa", - "brake_ratio": "0xa", - "tx_num_limit": "0x4e20", - "max_tx_size": "0x186a0000", - "max_contract_limit": "0x8000" - } - }, - "id": 73 + "jsonrpc": "2.0", + "result": { + "version": { + "start": "0x1", + "end": "0x5f5e100" + }, + "epoch": "0x0", + "verifier_list": [{ + "bls_pub_key": "0xa26e3fe1cf51bd4822072c61bdc315ac32e3d3c2e2484bb92942666399e863b4bf56cf2926383cc706ffc15dfebc85c6", + "pub_key": "0x031ddc35212b7fc7ff6685b17d91f77c972535aee5c7ae5684d3e72b986f08834b", + "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", + "propose_weight": "0x1", + "vote_weight": "0x1" + }], + "propose_counter": [{ + "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", + "count": "0xb4" + }], + "consensus_config": { + "gas_limit": "0x3e7fffffc18", + "interval": "0xbb8", + "propose_ratio": "0xf", + "prevote_ratio": "0xa", + "precommit_ratio": "0xa", + "brake_ratio": "0xa", + "tx_num_limit": "0x4e20", + "max_tx_size": "0x186a0000", + "max_contract_limit": "0x8000" + } + }, + "id": 73 } ``` #### Method `axon_getHardforkInfo` -* `axon_getHardforkInfo()` -* result: [`HardforkInfos`](#HardforkInfos) + +- `axon_getHardforkInfo()` +- result: [`HardforkInfos`](#HardforkInfos) Returns axon current hardfork infos. ##### Params -* None +- None ##### Returns @@ -2132,28 +2033,25 @@ Returns axon current hardfork infos. Request - ``` { - "jsonrpc": "2.0", - "method": "axon_getHardforkInfo", - "params": [ - ], - "id": 64 + "jsonrpc": "2.0", + "method": "axon_getHardforkInfo", + "params": [ + ], + "id": 64 } ``` - Response - ``` { - "jsonrpc": "2.0", - "result": { - "Andromeda":"enabled" - }, - "id": 73 + "jsonrpc": "2.0", + "result": { + "Andromeda":"enabled" + }, + "id": 73 } ``` @@ -2167,27 +2065,27 @@ The Web3Filter objects. `Web3Filter` is a JSON object with the following fields. -* `from_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] +- `from_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] - hexadecimal block number, or the string "latest", "earliest" or "pending" + hexadecimal block number, or the string "latest", "earliest" or "pending" -* `to_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] +- `to_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] - hexadecimal block number, or the string "latest", "earliest" or "pending" + hexadecimal block number, or the string "latest", "earliest" or "pending" -* `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. +- `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. - UsingblockHash is equivalent to. + UsingblockHash is equivalent to. -* `address`: [`H256`](#type-H256) - [optional] - a string representing the address (20 bytes) to check for balance +- `address`: [`H256`](#type-H256) - [optional] - a string representing the address (20 bytes) to check for balance - null when its pending. + null when its pending. - null when its pending log. + null when its pending log. -* `topics`: `Array<`[`Hash`](#type-Hash)`>` - [optional] - Array of 32 Bytes DATA topics. +- `topics`: `Array<`[`Hash`](#type-Hash)`>` - [optional] - Array of 32 Bytes DATA topics. - Topics are order-dependent. + Topics are order-dependent. ### Type `Web3Log` @@ -2197,36 +2095,35 @@ The Web3Log log objects. `Web3Log` is a JSON object with the following fields. -* `address`: [`H160`](#type-H160) - Hex encoded 20 Bytes - address from which this log originated. - -* `topics`: `Array<`[`H256`](#type-H256)`>` - Array of 0 to 4 32 Bytes of indexed log arguments. +- `address`: [`H160`](#type-H160) - Hex encoded 20 Bytes - address from which this log originated. - In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier. +- `topics`: `Array<`[`H256`](#type-H256)`>` - Array of 0 to 4 32 Bytes of indexed log arguments. -* `data`: [`Hex`](#type-Hex) - contains one or more 32 Bytes non-indexed arguments of the log. + In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier. -* `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. +- `data`: [`Hex`](#type-Hex) - contains one or more 32 Bytes non-indexed arguments of the log. - UsingblockHash is equivalent to. +- `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. -* `block_number`: [`U256`](#type-U256) - the block number where this log was in. + UsingblockHash is equivalent to. - null when its pending. +- `block_number`: [`U256`](#type-U256) - the block number where this log was in. - null when its pending log. + null when its pending. -* `transaction_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes, hash of the transactions this log was created from. null when its pending log.. + null when its pending log. -* `transaction_index`: [`U256`](#type-U256) - hexadecimal of the transactions index position log was created from. +- `transaction_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes, hash of the transactions this log was created from. null when its pending log.. - null when its pending log. +- `transaction_index`: [`U256`](#type-U256) - hexadecimal of the transactions index position log was created from. -* `log_index`: [`U256`](#type-U256) - hexadecimal of the log index position in the block. + null when its pending log. - null when its pending log. +- `log_index`: [`U256`](#type-U256) - hexadecimal of the log index position in the block. -* `removed`: [`bool`](#type-bool) - true when the log was removed, due to a chain reorganization. false if it's a valid log. + null when its pending log. +- `removed`: [`bool`](#type-bool) - true when the log was removed, due to a chainreorganization. false if it's a valid log. ### Type `Web3SyncStatus` @@ -2236,12 +2133,11 @@ The Web3SyncStatus objects. `Web3SyncStatus` is a JSON object with the following fields. -* `starting_block`: [`U256`](#type-U256) - QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) +- `starting_block`: [`U256`](#type-U256) - QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) -* `current_block`: [`U256`](#type-U256) - QUANTITY - The current block, same as eth_blockNumber. - -* `highest_block`: [`U256`](#type-U256) -QUANTITY - The estimated highest block. +- `current_block`: [`U256`](#type-U256) - QUANTITY - The current block, same as eth_blockNumber. +- `highest_block`: [`U256`](#type-U256) -QUANTITY - The estimated highest block. ### Type `Web3CallRequest` @@ -2251,31 +2147,31 @@ The Web3CallRequest objects. `Web3CallRequest` is a JSON object with the following fields. -* `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. +- `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. -* `from`:[`H160`](#type-H256) - Hex encoded 20 Bytes - The address the transaction is sent from. +- `from`:[`H160`](#type-H256) - Hex encoded 20 Bytes - The address the transaction is sent from. -* `to`: [`H160`](#type-H160) - Hex encoded 20 Bytes - The address the transaction is directed to. +- `to`: [`H160`](#type-H160) - Hex encoded 20 Bytes - The address the transaction is directed to. -* `gas_price`: [`U256`](#type-U256) - [optional] hexadecimal value of the gasPrice used for each paid gas. +- `gas_price`: [`U256`](#type-U256) - [optional] hexadecimal value of the gasPrice used for each paid gas. -* `max_fee_per_gas`: [`U256`](#type-U256) - [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. +- `max_fee_per_gas`: [`U256`](#type-U256) - [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. -* `gas`: [`U256`](#type-U256) - [optional] hexadecimal value of the gas provided for the transaction execution. +- `gas`: [`U256`](#type-U256) - [optional] hexadecimal value of the gas provided for the transaction execution. - eth_call consumes zero gas, but this parameter may be needed by some executions. + eth_call consumes zero gas, but this parameter may be needed by some executions. -* `value`: [`U256`](#type-U256) - [optional] hexadecimal value of the value sent with this transaction. +- `value`: [`U256`](#type-U256) - [optional] hexadecimal value of the value sent with this transaction. -* `data`: [`Hex`](#type-Hex) - [optional] Hash of the method signature and encoded parameters. +- `data`: [`Hex`](#type-Hex) - [optional] Hash of the method signature and encoded parameters. -* `nonce`: [`U256`](#type-U256) - Nonce is a sequence number, issued by the originating externally owned account, used to prevent message replay. +- `nonce`: [`U256`](#type-U256) - Nonce is a sequence number, issued by the originating externally owned account, used to prevent message replay. -* `access_list`: `Array<` [`AccessList`](#type-AccessList)`>` - The accessList specifies a list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. +- `access_list`: `Array<` [`AccessList`](#type-AccessList)`>` - The accessList specifies a list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. -* `chain_id`: [`U64`](#type-U64) - QUANTITY - The id of the chain. +- `chain_id`: [`U64`](#type-U64) - QUANTITY - The id of the chain. -* `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. +- `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. ### Type `AccessList` @@ -2285,8 +2181,7 @@ The AccessList objects. `AccessList` is a JSON object with the following fields. -* `AccessList`: `Arrar<`[`AccessListItem`]`>`(#type-AccessListItem) - A list of addresses and storage keys. - +- `AccessList`: `Arrar<`[`AccessListItem`]`>`(#type-AccessListItem) - A list of addresses and storage keys. ### Type `AccessListItem` @@ -2296,10 +2191,9 @@ The AccessListItem objects. `AccessListItem` is a JSON object with the following fields. -* `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The addresses is added into the accessed_addresses global sets. - -* `storage_keys`: `Arrar<`[`H256`]`>`(#type-H256) - DATA, Hex encoded 32 Bytes - The storage keys is added into the accessed_storage_keys global sets. +- `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The addresses is added into the accessed_addresses global sets. +- `storage_keys`: `Arrar<`[`H256`]`>`(#type-H256) - DATA, Hex encoded 32 Bytes - The storage keys is added into the accessed_storage_keys global sets. ### Type `BlockView` @@ -2309,50 +2203,49 @@ The BlockView objects. `BlockView` is a JSON object with the following fields. -* `hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block. null when its pending block. - -* `parent_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the parent block. +- `hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block. null when its pending block. -* `sha3_uncles`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - SHA3 of the uncles data in the block. +- `parent_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the parent block. -* `author`: [`H169`](#type-H160) - Hex encoded 20 Bytes - the creator of the block. +- `sha3_uncles`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - SHA3 of the uncles data in the block. -* `miner`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - the address of the beneficiary to whom the mining rewards were given. +- `author`: [`H169`](#type-H160) - Hex encoded 20 Bytes - the creator of the block. -* `state_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the final state trie of the block. +- `miner`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - the address of the beneficiary to whom the mining rewards were given. -* `transactions_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the transaction trie of the block. +- `state_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the final state trie of the block. -* `receipts_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the receipts trie of the block. +- `transactions_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the transaction trie of the block. -* `number`: [`U256`](#type-U256) - QUANTITY - the block number. null when its pending block. +- `receipts_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the receipts trie of the block. -* `gas_used`: [`U256`](#type-U256) - QUANTITY - the total used gas by all transactions in this block. +- `number`: [`U256`](#type-U256) - QUANTITY - the block number. null when its pending block. -* `gas_limit`: [`U256`](#type-U256) - QUANTITY - the maximum gas allowed in this block. +- `gas_used`: [`U256`](#type-U256) - QUANTITY - the total used gas by all transactions in this block. -* `extra_data`: [`Hex`](#type-Hex) - DATA - the "extra data" field of this block. +- `gas_limit`: [`U256`](#type-U256) - QUANTITY - the maximum gas allowed in this block. -* `logs_bloom`: [`Boolom`](#type-Boolom) - DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block. +- `extra_data`: [`Hex`](#type-Hex) - DATA - the "extra data" field of this block. -* `timestamp`: [`U256`](#type-U256) - QUANTITY - the unix timestamp for when the block was collated. +- `logs_bloom`: [`Boolom`](#type-Boolom) - DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block. -* `difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the difficulty for this block. +- `timestamp`: [`U256`](#type-U256) - QUANTITY - the unix timestamp for when the block was collated. -* `total_difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the total difficulty of the chain until this block. +- `difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the difficulty for this block. -* `base_fee_per_gas`: [`U256`](#type-U256) - he minimum fee per gas required for a transaction to be included in the block. +- `total_difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the total difficulty of the chain until this block. -* `uncles`: `Array<`[`U256`](#type-U256)`>` - Array - Array of uncle hashes. +- `base_fee_per_gas`: [`U256`](#type-U256) - he minimum fee per gas required for a transaction to be included in the block. -* `transactions`:`Array<`[`RichTransactionOrHash`](#type-RichTransactionOrHash)`>` - The transactions in the block body. +- `uncles`: `Array<`[`U256`](#type-U256)`>` - Array - Array of uncle hashes. -* `size`: [`U256`](#type-U256) - QUANTITY - integer the size of this block in bytes. +- `transactions`:`Array<`[`RichTransactionOrHash`](#type-RichTransactionOrHash)`>` - The transactions in the block body. -* `mix_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes - a unique identifier for that block. +- `size`: [`U256`](#type-U256) - QUANTITY - integer the size of this block in bytes. -* `nonce`: [`U256`](#type-U256) - DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block. +- `mix_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes - a unique identifier for that block. +- `nonce`: [`U256`](#type-U256) - DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block. ### Type `Web3FeeHistory` @@ -2362,14 +2255,14 @@ The Web3FeeHistory objects. `Web3FeeHistory` is a JSON object with the following fields. -* `oldest_block`: [`U256`](#type-U256) - Lowest number block of the returned range. +- `oldest_block`: [`U256`](#type-U256) - Lowest number block of the returned range. -* `reward`: `Arrary<`[`U256`](#type-U256)`>` - (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. +- `reward`: `Arrary<`[`U256`](#type-U256)`>` - (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. -* `base_fee_per_gas`: `Arrary<`[`U256`](#type-U256)`>` - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. - Zeroes are returned for pre-EIP-1559 blocks. +- `base_fee_per_gas`: `Arrary<`[`U256`](#type-U256)`>` - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. + Zeroes are returned for pre-EIP-1559 blocks. -* `gas_used_ratio`: `Arrary<`[`U256`](#type-U256)`>` - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. +- `gas_used_ratio`: `Arrary<`[`U256`](#type-U256)`>` - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. ### Type `Web3Receipt` @@ -2379,36 +2272,35 @@ The Web3Receipt objects. `Web3Receipt` is a JSON object with the following fields. -* `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. - -* `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. +- `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. -* `contract_address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. +- `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. -* `cumulative_gas_used`: [`U256`](#type-U256) - QUANTITY - The total amount of gas used when this transaction was executed in the block. +- `contract_address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. -* `effective_gas_price`: [`U256`](#type-U256) - QUANTITY - the price per gas at the time of your transaction, so the total gas cost of your transaction is effectiveGasPrice * gasUsed +- `cumulative_gas_used`: [`U256`](#type-U256) - QUANTITY - The total amount of gas used when this transaction was executed in the block. -* `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. +- `effective_gas_price`: [`U256`](#type-U256) - QUANTITY - the price per gas at the time of your transaction, so the total gas cost of your transaction is effectiveGasPrice \* gasUsed -* `gas_used`: [`U256`](#type-U256) - QUANTITY - The amount of gas used by this specific transaction alone. +- `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. -* `logs`: `Arrary<`[`Web3ReceiptLog`](#type-Web3ReceiptLog)`>` - Array - Array of log objects, which this transaction generated. +- `gas_used`: [`U256`](#type-U256) - QUANTITY - The amount of gas used by this specific transaction alone. -* `logs_bloom`: [`Bloom`](#type-Bloom) - DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. +- `logs`: `Arrary<`[`Web3ReceiptLog`](#type-Web3ReceiptLog)`>` - Array - Array of log objects, which this transaction generated. -* `state_root`: [`Hash`](#type-Hash) - DATA 32 bytes of post-transaction stateroot (pre Byzantium) +- `logs_bloom`: [`Bloom`](#type-Bloom) - DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. -* `status`: [`U256`](#type-U256) - QUANTITY either 1 (success) or 0 (failure) +- `state_root`: [`Hash`](#type-Hash) - DATA 32 bytes of post-transaction stateroot (pre Byzantium) -* `to`: [`H160`](#type-H160)- DATA, Hex encoded 20 Bytes - address of the receiver. null when its a contract creation transaction. +- `status`: [`U256`](#type-U256) - QUANTITY either 1 (success) or 0 (failure) -* `transaction_hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. +- `to`: [`H160`](#type-H160)- DATA, Hex encoded 20 Bytes - address of the receiver. null when its a contract creation transaction. -* `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position in the block. +- `transaction_hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. -* `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. +- `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position in the block. +- `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. ### Type `Web3ReceiptLog` @@ -2418,38 +2310,37 @@ The Web3ReceiptLog objects. `Web3ReceiptLog` is a JSON object with the following fields. -* `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address from which this log originated. +- `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address from which this log originated. -* `topics`: `Arrary<`[`H256`](#type-H256)`>` - rray of DATA - Array of 0 to 4 Hex encode 32 Bytes DATA of indexed log arguments. - * In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier. +- `topics`: `Arrary<`[`H256`](#type-H256)`>` - rray of DATA - Array of 0 to 4 Hex encode 32 Bytes DATA of indexed log arguments. -* `data`: [`Hex`](#type-Hex)`>` - DATA - contains one or more 32 Bytes non-indexed arguments of the log. + - In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier. -* `block_number`: [`U256`](#type-U256) - QUANTITY - the block number where this log was in. null when its pending. null when its pending log. +- `data`: [`Hex`](#type-Hex)`>` - DATA - contains one or more 32 Bytes non-indexed arguments of the log. -* `block_hash`: [`Hash`](#type-Hash) - DATA, Hex encode 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log. +- `block_number`: [`U256`](#type-U256) - QUANTITY - the block number where this log was in. null when its pending. null when its pending log. -* `transaction_hash`: [`Hash`](#type-Hash)`>` - DATA, Hex encoded 32 Bytes - hash of the transactions this log was created from. null when its pending log. +- `block_hash`: [`Hash`](#type-Hash) - DATA, Hex encode 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log. -* `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position log was created from. null when its pending log. +- `transaction_hash`: [`Hash`](#type-Hash)`>` - DATA, Hex encoded 32 Bytes - hash of the transactions this log was created from. null when its pending log. -* `log_index`: [`U256`](#type-U256)`>` - QUANTITY - integer of the log index position in the block. null when its pending log. +- `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position log was created from. null when its pending log. -* `removed`: [`bool`](#type-bool) - TAG - true when the log was removed, due to a chain reorganization. false if its a valid log. +- `log_index`: [`U256`](#type-U256)`>` - QUANTITY - integer of the log index position in the block. null when its pending log. +- `removed`: [`bool`](#type-bool) - TAG - true when the log was removed, due to a chain reorganization. false if its a valid log. ### Type `BlockId` Default block parameters can be one of the following: -* Number|BN|BigNumber: A block number starting from 0.This is a 64-bit unsigned integer type encoded as the 0x-prefixed hex string in JSON. +- Number|BN|BigNumber: A block number starting from 0.This is a 64-bit unsigned integer type encoded as the 0x-prefixed hex string in JSON. -* "earliest" - String: The genesis block +- "earliest" - String: The genesis block -* "latest" - String: The latest block (current head of the blockchain) - -* "pending" - String: The currently mined block (including pending transactions) +- "latest" - String: The latest block (current head of the blockchain) +- "pending" - String: The currently mined block (including pending transactions) ### Type `H256` @@ -2457,7 +2348,6 @@ The Hex encoded 32-bytes fixed-length binary data. The name comes from the number of bits in the data. - #### Examples ``` @@ -2519,7 +2409,9 @@ The bool represents a value, which could only be either true or false. If you ca ``` true ``` + or + ``` 1 ``` @@ -2542,7 +2434,6 @@ Unsigned 64-bit integer. Little-endian large integer type 256-bit unsigned integer. - ### Type `TransactionView` The TransactionView objects. @@ -2551,77 +2442,74 @@ The TransactionView objects. `TransactionView` is a JSON object with the following fields. +- `type_`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. -* `type_`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. - -* `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. null when it's pending. - -* `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. null when its pending. +- `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. null when it's pending. -* `hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. +- `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. null when its pending. -* `nonce`: [`U256`](#type-U256) - QUANTITY - the number of transactions made by the sender prior to this one. +- `hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. -* `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. +- `nonce`: [`U256`](#type-U256) - QUANTITY - the number of transactions made by the sender prior to this one. -* `to`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the receiver. null when it's a contract creation transaction. +- `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. -* `value`: [`U256`](#type-U256) - QUANTITY - value transferred in Wei. +- `to`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the receiver. null when it's a contract creation transaction. -* `gas`: [`U256`](#type-U256) - QUANTITY - gas provided by the sender. +- `value`: [`U256`](#type-U256) - QUANTITY - value transferred in Wei. -* `gas_price`: [`U256`](#type-U256) - QUANTITY - gas price provided by the sender in Wei. +- `gas`: [`U256`](#type-U256) - QUANTITY - gas provided by the sender. -* `max_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - the absolute maximum you are willing to pay per unit of gas to get your transaction included in a block. For brevity and clarity, we will refer to this as the Max Fee. +- `gas_price`: [`U256`](#type-U256) - QUANTITY - gas price provided by the sender in Wei. -* `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. +- `max_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - the absolute maximum you are willing to pay per unit of gas to get your transaction included in a block. For brevity and clarity, we will refer to this as the Max Fee. -* `raw`: [`Hex`](#type-Hex) - The raw is the signed transaction in Recursive Length Prefix (RLP) encoded form +- `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. -* `input`: [`Hex`](#type-Hex) - DATA - The input of the transaction. +- `raw`: [`Hex`](#type-Hex) - The raw is the signed transaction in Recursive Length Prefix (RLP) encoded form -* `public_key`: [`Input`](#type-Input) - The public key of the transaction sender. +- `input`: [`Hex`](#type-Hex) - DATA - The input of the transaction. -* `access_list`: [`AccessList`](#type-AccessList) - A list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. +- `public_key`: [`Input`](#type-Input) - The public key of the transaction sender. -* `chain_id`: [`U256`](#type-U256) - QUANTITY - The id of the chain. +- `access_list`: [`AccessList`](#type-AccessList) - A list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. -* `v`: [`U256`](#type-U256) - QUANTITY - ECDSA recovery id. +- `chain_id`: [`U256`](#type-U256) - QUANTITY - The id of the chain. -* `r`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature r. +- `v`: [`U256`](#type-U256) - QUANTITY - ECDSA recovery id. -* `s`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature s. +- `r`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature r. +- `s`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature s. ##### Examples - ``` { - "jsonrpc": "2.0", - "result": { - "type": "0x2", - "blockNumber": "0x1b4", - "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", - "hash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", - "nonce": "0x1", - "transactionIndex": "0x1b70", - "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", - "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", - "value": "0x0", - "gas": "0x73a9", - "gasPrice": "0x77359400", - "maxFeePerGas": "0x539", - "maxPriorityFeePerGas": "0x77359400", - "raw": "0x02f8af05018477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0fa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3da06079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2", - "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", - "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d312345678", - "accessList": [], - "chainId": "0x5", - "v": "0x0", - "r": "0xfa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3d", - "s": "0x6079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2" - }, - "id": 2 + "jsonrpc": "2.0", + "result": { + "type": "0x2", + "blockNumber": "0x1b4", + "blockHash": "0x9a13208ce76c32638f509064545765c8341db9178b77b4f47b458a66325494fd", + "hash": "0x41e946c6f4dd97ad2828c056af973087b53044bf567caf0ea870ab45460afd65", + "nonce": "0x1", + "transactionIndex": "0x1b70", + "from": "0x92df69a492c93d22c90247434b8d80944daa38fa", + "to": "0xef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca", + "value": "0x0", + "gas": "0x73a9", + "gasPrice": "0x77359400", + "maxFeePerGas": "0x539", + "maxPriorityFeePerGas": "0x77359400", + "raw": "0x02f8af05018477359400847735940082ea6094ef11d1c2aa48826d4c41e54ab82d1ff5ad8a64ca80b844a9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000c080a0fa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3da06079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2", + "input": "0xa9059cbb0000000000000000000000005cf83df52a32165a7f392168ac009b168c9e89150000000000000000000000000000000000000000000000000000000000000000", + "publicKey": "0x1113b46c2c52050fb9fd29cf88d4a9f8d253e17515dc142f72d8bb2cd18fdb3e45098e11811bcdd1487bafb7b24bf35c174cf6ede558059e23ad60d312345678", + "accessList": [], + "chainId": "0x5", + "v": "0x0", + "r": "0xfa9bc76185d06c6e3178c66c40c195f374e80a78179392a84c1db731ce4d2d3d", + "s": "0x6079373330aa2c6d420267d83d8cd685db20638c7935f02a26fdf99dd010bfa2" + }, + "id": 2 } ``` diff --git a/core/executor/src/debugger/create2.rs b/core/executor/src/debugger/create2.rs index a11ea0c72..65463914b 100644 --- a/core/executor/src/debugger/create2.rs +++ b/core/executor/src/debugger/create2.rs @@ -34,13 +34,13 @@ async fn test_create2_gas() { fn mock_create2_tx(nonce: U64, sender: H160) -> SignedTransaction { let tx = LegacyTransaction { - nonce, - gas_price: 8u64.into(), - gas_limit: MAX_BLOCK_GAS_LIMIT.into(), - action: TransactionAction::Create, - value: U256::zero(), - data: hex_decode("60806040523480156200001157600080fd5b506040516200002090620000ef565b604051809103906000f0801580156200003d573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040516200008b90620000fd565b604051809103906000f080158015620000a8573d6000803e3d6000fd5b50600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200010b565b61064d806200198583390190565b610be28062001fd283390190565b61186a806200011b6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063107aa604146100675780631cf41a81146100715780634d290d3e1461008d578063d62d311514610097578063efbcc6b4146100b5578063f95f2142146100bf575b600080fd5b61006f6100ef565b005b61008b6004803603810190610086919061111e565b6103f2565b005b61009561059d565b005b61009f610821565b6040516100ac9190611354565b60405180910390f35b6100bd610b79565b005b6100d960048036038101906100d4919061111e565b610e84565b6040516100e691906112e7565b60405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b815260040161014f929190611302565b60006040518083038186803b15801561016757600080fd5b505afa15801561017b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101a491906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d083650bef7717b3b06040518363ffffffff1660e01b815260040161020b92919061139f565b602060405180830381600087803b15801561022557600080fd5b505af1158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025d91906110a8565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16639cb8a26a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156102ac57600080fd5b505af11580156102c0573d6000803e3d6000fd5b505050506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d085650bef7717b3b06040518363ffffffff1660e01b815260040161032992919061139f565b602060405180830381600087803b15801561034357600080fd5b505af1158015610357573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037b91906110a8565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146103ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e3906114ea565b60405180910390fd5b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc33846040518363ffffffff1660e01b815260040161045192919061132b565b60006040518083038186803b15801561046957600080fd5b505afa15801561047d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906104a691906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08362bbe2236040518363ffffffff1660e01b815260040161050a92919061136f565b602060405180830381600087803b15801561052457600080fd5b505af1158015610538573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055c91906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d60018260405161059092919061142f565b60405180910390a1505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b81526004016105fd929190611302565b60006040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061065291906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d0836501318be8c52b6040518363ffffffff1660e01b81526004016106b99291906113cf565b602060405180830381600087803b1580156106d357600080fd5b505af11580156106e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070b91906110a8565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16639cb8a26a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561075a57600080fd5b505af115801561076e573d6000803e3d6000fd5b505050507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d6003836040516107a4929190611481565b60405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108139061150a565b60405180910390fd5b505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b8152600401610882929190611302565b60006040518083038186803b15801561089a57600080fd5b505afa1580156108ae573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108d791906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166394ca2cb58360016040518363ffffffff1660e01b81526004016109399291906113ff565b60206040518083038186803b15801561095157600080fd5b505afa158015610965573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098991906110a8565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08460016040518363ffffffff1660e01b81526004016109eb9291906113ff565b602060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d91906110a8565b90508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa49061152a565b60405180910390fd5b600081905060018173ffffffffffffffffffffffffffffffffffffffff1663243dc8da6040518163ffffffff1660e01b815260040160206040518083038186803b158015610afa57600080fd5b505afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b32919061114b565b14610b72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b69906114aa565b60405180910390fd5b5050505090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b8152600401610bd9929190611302565b60006040518083038186803b158015610bf157600080fd5b505afa158015610c05573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c2e91906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08362bbe2236040518363ffffffff1660e01b8152600401610c9292919061136f565b602060405180830381600087803b158015610cac57600080fd5b505af1158015610cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce491906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d600182604051610d1892919061142f565b60405180910390a16000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08462bbe2236040518363ffffffff1660e01b8152600401610d8292919061136f565b602060405180830381600087803b158015610d9c57600080fd5b505af1158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d600282604051610e08929190611458565b60405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e76906114ca565b60405180910390fd5b505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc33856040518363ffffffff1660e01b8152600401610ee492919061132b565b60006040518083038186803b158015610efc57600080fd5b505afa158015610f10573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610f3991906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166394ca2cb58362bbe2236040518363ffffffff1660e01b8152600401610f9d92919061136f565b60206040518083038186803b158015610fb557600080fd5b505afa158015610fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fed91906110a8565b90508092505050919050565b600061100c6110078461156f565b61154a565b90508281526020810184848401111561102857611027611719565b5b611033848285611681565b509392505050565b60008151905061104a81611806565b92915050565b600082601f83011261106557611064611714565b5b8151611075848260208601610ff9565b91505092915050565b60008135905061108d8161181d565b92915050565b6000815190506110a28161181d565b92915050565b6000602082840312156110be576110bd611723565b5b60006110cc8482850161103b565b91505092915050565b6000602082840312156110eb576110ea611723565b5b600082015167ffffffffffffffff8111156111095761110861171e565b5b61111584828501611050565b91505092915050565b60006020828403121561113457611133611723565b5b60006111428482850161107e565b91505092915050565b60006020828403121561116157611160611723565b5b600061116f84828501611093565b91505092915050565b611181816115cd565b82525050565b611190816115df565b82525050565b60006111a1826115a0565b6111ab81856115ab565b93506111bb818560208601611681565b6111c481611728565b840191505092915050565b6111d881611615565b82525050565b6111e781611627565b82525050565b6111f681611639565b82525050565b6112058161164b565b82525050565b6112148161165d565b82525050565b6112238161166f565b82525050565b6000611236600b836115bc565b915061124182611739565b602082019050919050565b6000611259600b836115bc565b915061126482611762565b60208201905091").unwrap().into(), - }; + nonce, + gas_price: 8u64.into(), + gas_limit: MAX_BLOCK_GAS_LIMIT.into(), + action: TransactionAction::Create, + value: U256::zero(), + data: hex_decode("60806040523480156200001157600080fd5b506040516200002090620000ef565b604051809103906000f0801580156200003d573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040516200008b90620000fd565b604051809103906000f080158015620000a8573d6000803e3d6000fd5b50600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200010b565b61064d806200198583390190565b610be28062001fd283390190565b61186a806200011b6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063107aa604146100675780631cf41a81146100715780634d290d3e1461008d578063d62d311514610097578063efbcc6b4146100b5578063f95f2142146100bf575b600080fd5b61006f6100ef565b005b61008b6004803603810190610086919061111e565b6103f2565b005b61009561059d565b005b61009f610821565b6040516100ac9190611354565b60405180910390f35b6100bd610b79565b005b6100d960048036038101906100d4919061111e565b610e84565b6040516100e691906112e7565b60405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b815260040161014f929190611302565b60006040518083038186803b15801561016757600080fd5b505afa15801561017b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101a491906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d083650bef7717b3b06040518363ffffffff1660e01b815260040161020b92919061139f565b602060405180830381600087803b15801561022557600080fd5b505af1158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025d91906110a8565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16639cb8a26a6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156102ac57600080fd5b505af11580156102c0573d6000803e3d6000fd5b505050506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d085650bef7717b3b06040518363ffffffff1660e01b815260040161032992919061139f565b602060405180830381600087803b15801561034357600080fd5b505af1158015610357573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037b91906110a8565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146103ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103e3906114ea565b60405180910390fd5b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc33846040518363ffffffff1660e01b815260040161045192919061132b565b60006040518083038186803b15801561046957600080fd5b505afa15801561047d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906104a691906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08362bbe2236040518363ffffffff1660e01b815260040161050a92919061136f565b602060405180830381600087803b15801561052457600080fd5b505af1158015610538573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061055c91906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d60018260405161059092919061142f565b60405180910390a1505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b81526004016105fd929190611302565b60006040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061065291906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d0836501318be8c52b6040518363ffffffff1660e01b81526004016106b99291906113cf565b602060405180830381600087803b1580156106d357600080fd5b505af11580156106e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070b91906110a8565b905060008190508073ffffffffffffffffffffffffffffffffffffffff16639cb8a26a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561075a57600080fd5b505af115801561076e573d6000803e3d6000fd5b505050507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d6003836040516107a4929190611481565b60405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561081c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108139061150a565b60405180910390fd5b505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b8152600401610882929190611302565b60006040518083038186803b15801561089a57600080fd5b505afa1580156108ae573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108d791906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166394ca2cb58360016040518363ffffffff1660e01b81526004016109399291906113ff565b60206040518083038186803b15801561095157600080fd5b505afa158015610965573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098991906110a8565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08460016040518363ffffffff1660e01b81526004016109eb9291906113ff565b602060405180830381600087803b158015610a0557600080fd5b505af1158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d91906110a8565b90508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa49061152a565b60405180910390fd5b600081905060018173ffffffffffffffffffffffffffffffffffffffff1663243dc8da6040518163ffffffff1660e01b815260040160206040518083038186803b158015610afa57600080fd5b505afa158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b32919061114b565b14610b72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b69906114aa565b60405180910390fd5b5050505090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc3360016040518363ffffffff1660e01b8152600401610bd9929190611302565b60006040518083038186803b158015610bf157600080fd5b505afa158015610c05573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c2e91906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08362bbe2236040518363ffffffff1660e01b8152600401610c9292919061136f565b602060405180830381600087803b158015610cac57600080fd5b505af1158015610cc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce491906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d600182604051610d1892919061142f565b60405180910390a16000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c4ae2d08462bbe2236040518363ffffffff1660e01b8152600401610d8292919061136f565b602060405180830381600087803b158015610d9c57600080fd5b505af1158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906110a8565b90507f35e3089d2d7a4ec5640ff07c04690a010b43060749c201136090c4ef49967c1d600282604051610e08929190611458565b60405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e76906114ca565b60405180910390fd5b505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166381871cbc33856040518363ffffffff1660e01b8152600401610ee492919061132b565b60006040518083038186803b158015610efc57600080fd5b505afa158015610f10573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610f3991906110d5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166394ca2cb58362bbe2236040518363ffffffff1660e01b8152600401610f9d92919061136f565b60206040518083038186803b158015610fb557600080fd5b505afa158015610fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fed91906110a8565b90508092505050919050565b600061100c6110078461156f565b61154a565b90508281526020810184848401111561102857611027611719565b5b611033848285611681565b509392505050565b60008151905061104a81611806565b92915050565b600082601f83011261106557611064611714565b5b8151611075848260208601610ff9565b91505092915050565b60008135905061108d8161181d565b92915050565b6000815190506110a28161181d565b92915050565b6000602082840312156110be576110bd611723565b5b60006110cc8482850161103b565b91505092915050565b6000602082840312156110eb576110ea611723565b5b600082015167ffffffffffffffff8111156111095761110861171e565b5b61111584828501611050565b91505092915050565b60006020828403121561113457611133611723565b5b60006111428482850161107e565b91505092915050565b60006020828403121561116157611160611723565b5b600061116f84828501611093565b91505092915050565b611181816115cd565b82525050565b611190816115df565b82525050565b60006111a1826115a0565b6111ab81856115ab565b93506111bb818560208601611681565b6111c481611728565b840191505092915050565b6111d881611615565b82525050565b6111e781611627565b82525050565b6111f681611639565b82525050565b6112058161164b565b82525050565b6112148161165d565b82525050565b6112238161166f565b82525050565b6000611236600b836115bc565b915061124182611739565b602082019050919050565b6000611259600b836115bc565b915061126482611762565b60208201905091").unwrap().into(), + }; let utx = UnverifiedTransaction { unsigned: UnsignedTransaction::Legacy(tx), diff --git a/core/executor/src/precompiles/tests.rs b/core/executor/src/precompiles/tests.rs index 89833bb51..578d75ccc 100644 --- a/core/executor/src/precompiles/tests.rs +++ b/core/executor/src/precompiles/tests.rs @@ -95,11 +95,11 @@ fn test_identity() { fn test_modexp() { let input = &hex_decode( "0000000000000000000000000000000000000000000000000000000000000001\ - 0000000000000000000000000000000000000000000000000000000000000001\ - 0000000000000000000000000000000000000000000000000000000000000001\ - 03\ - 05\ - 07", + 0000000000000000000000000000000000000000000000000000000000000001\ + 0000000000000000000000000000000000000000000000000000000000000001\ + 03\ + 05\ + 07", ) .unwrap(); let output = vec![5u8]; @@ -107,11 +107,11 @@ fn test_modexp() { let input = &hex_decode( "0000000000000000000000000000000000000000000000000000000000000020\ - 0000000000000000000000000000000000000000000000000000000000000020\ - 0000000000000000000000000000000000000000000000000000000000000020\ - 000000000000000000000000000000000000000000000000000000000000EA5F\ - 0000000000000000000000000000000000000000000000000000000000000015\ - 0000000000000000000000000000000000000000000000000000000000003874", + 0000000000000000000000000000000000000000000000000000000000000020\ + 0000000000000000000000000000000000000000000000000000000000000020\ + 000000000000000000000000000000000000000000000000000000000000EA5F\ + 0000000000000000000000000000000000000000000000000000000000000015\ + 0000000000000000000000000000000000000000000000000000000000003874", ) .unwrap(); let mut output = vec![0u8; 32]; @@ -120,11 +120,11 @@ fn test_modexp() { let input = &hex_decode( "0000000000000000000000000000000000000000000000000000000000000001\ - 0000000000000000000000000000000000000000000000000000000000000020\ - 0000000000000000000000000000000000000000000000000000000000000020\ - 03\ - fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\ - fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", + 0000000000000000000000000000000000000000000000000000000000000020\ + 0000000000000000000000000000000000000000000000000000000000000020\ + 03\ + fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e\ + fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f", ) .unwrap(); let mut output = vec![0u8; 32]; diff --git a/core/executor/src/tests/mod.rs b/core/executor/src/tests/mod.rs index c39b55d44..9d6461642 100644 --- a/core/executor/src/tests/mod.rs +++ b/core/executor/src/tests/mod.rs @@ -76,14 +76,14 @@ fn gen_tx(sender: H160, addr: H160, value: u64, data: Vec) -> SignedTransact fn test_ackermann31() { let mut state = BTreeMap::new(); state.insert( - H160::from_str("0x1000000000000000000000000000000000000000").unwrap(), - MemoryAccount { - nonce: U256::one(), - balance: U256::max_value(), - storage: BTreeMap::new(), - code: hex_decode("60e060020a6000350480632839e92814601e57806361047ff414603457005b602a6004356024356047565b8060005260206000f35b603d6004356099565b8060005260206000f35b600082600014605457605e565b8160010190506093565b81600014606957607b565b60756001840360016047565b90506093565b609060018403608c85600186036047565b6047565b90505b92915050565b6000816000148060a95750816001145b60b05760b7565b81905060cf565b60c1600283036099565b60cb600184036099565b0190505b91905056").unwrap(), - } - ); + H160::from_str("0x1000000000000000000000000000000000000000").unwrap(), + MemoryAccount { + nonce: U256::one(), + balance: U256::max_value(), + storage: BTreeMap::new(), + code: hex_decode("60e060020a6000350480632839e92814601e57806361047ff414603457005b602a6004356024356047565b8060005260206000f35b603d6004356099565b8060005260206000f35b600082600014605457605e565b8160010190506093565b81600014606957607b565b60756001840360016047565b90506093565b609060018403608c85600186036047565b6047565b90505b92915050565b6000816000148060a95750816001145b60b05760b7565b81905060cf565b60c1600283036099565b60cb600184036099565b0190505b91905056").unwrap(), + } + ); state.insert( H160::from_str("0xf000000000000000000000000000000000000000").unwrap(), MemoryAccount { diff --git a/devtools/axon-tools/README.md b/devtools/axon-tools/README.md index 2b236bbb9..5cb45f43e 100644 --- a/devtools/axon-tools/README.md +++ b/devtools/axon-tools/README.md @@ -1,3 +1,3 @@ -This crate is used by forcerelay. +This crate is used by forcerelay. - Data structures like Block, Proposal etc. -- Block and Transaction verification APIs. \ No newline at end of file +- Block and Transaction verification APIs. diff --git a/devtools/axon-tools/src/tests/proof.json b/devtools/axon-tools/src/tests/proof.json index f3d15cb66..2bfb2a296 100644 --- a/devtools/axon-tools/src/tests/proof.json +++ b/devtools/axon-tools/src/tests/proof.json @@ -1,7 +1,7 @@ { - "number": "0xe7c3", - "round": "0x0", - "proposal_hash": "0x6e48fa2d2002453abd9b51e4ac0342abb1f027b8272d6e27ce79a630b3f26673", - "signature": "0xb3e8e27db04baec18c04bc0b8ffe7fdbf2b5f7d6ef243c8be02bfd75defee32f1c0ff73a9fa67fee24630d2da5aa70f111ba41c0212be5d91b95f3bb84e5c0406b4742cca8c8f8362c07024fd8081d16875b01f43c6aa11c60b196af8c671a9b", - "bitmap": "0x70" + "number": "0xe7c3", + "round": "0x0", + "proposal_hash": "0x6e48fa2d2002453abd9b51e4ac0342abb1f027b8272d6e27ce79a630b3f26673", + "signature": "0xb3e8e27db04baec18c04bc0b8ffe7fdbf2b5f7d6ef243c8be02bfd75defee32f1c0ff73a9fa67fee24630d2da5aa70f111ba41c0212be5d91b95f3bb84e5c0406b4742cca8c8f8362c07024fd8081d16875b01f43c6aa11c60b196af8c671a9b", + "bitmap": "0x70" } diff --git a/devtools/docker/health_check.sh b/devtools/docker/health_check.sh index 68dbb5b61..dc9f4abd0 100755 --- a/devtools/docker/health_check.sh +++ b/devtools/docker/health_check.sh @@ -10,7 +10,7 @@ block_stats() { current_block=$(block_number) start_time=$(date +%s) wait_seconds=60 - + while true; do latest_block=$(block_number) if [ $current_block -lt $latest_block ] diff --git a/tests/e2e/src/create_test_data/ERC20.json b/tests/e2e/src/create_test_data/ERC20.json index b46a1d198..790d00d17 100755 --- a/tests/e2e/src/create_test_data/ERC20.json +++ b/tests/e2e/src/create_test_data/ERC20.json @@ -1,329 +1,329 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ERC20", - "sourceName": "contracts/ERC20.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "msgsender", - "type": "uint256" - } - ], - "name": "eventlog", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "get_allowances_msgSender", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b506040516200173138038062001731833981810160405260408110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011557600080fd5b838201915060208201858111156200012c57600080fd5b82518660018202830111640100000000821117156200014a57600080fd5b8083526020830192505050908051906020019080838360005b838110156200018057808201518184015260208101905062000163565b50505050905090810190601f168015620001ae5780820380516001836020036101000a031916815260200191505b506040525050508160039080519060200190620001cd9291906200020b565b508060049080519060200190620001e69291906200020b565b506012600560006101000a81548160ff021916908360ff1602179055505050620002ba565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200024e57805160ff19168380011785556200027f565b828001600101855582156200027f579182015b828111156200027e57825182559160200191906001019062000261565b5b5090506200028e919062000292565b5090565b620002b791905b80821115620002b357600081600090555060010162000299565b5090565b90565b61146780620002ca6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633e94dc0f116100715780633e94dc0f146102d057806370a082311461032857806395d89b4114610380578063a457c2d714610403578063a9059cbb14610469578063dd62ed3e146104cf576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a257806323b872dd146101c0578063313ce56714610246578063395093511461026a575b600080fd5b6100c1610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e9565b604051808215151515815260200191505060405180910390f35b6101aa610607565b6040518082815260200191505060405180910390f35b61022c600480360360608110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610611565b604051808215151515815260200191505060405180910390f35b61024e6108a5565b604051808260ff1660ff16815260200191505060405180910390f35b6102b66004803603604081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b604051808215151515815260200191505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096f565b6040518082815260200191505060405180910390f35b61036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109fc565b6040518082815260200191505060405180910390f35b610388610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c85780820151818401526020810190506103ad565b50505050905090810190601f1680156103f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603604081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae6565b604051808215151515815260200191505060405180910390f35b6104b56004803603604081101561047f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb3565b604051808215151515815260200191505060405180910390f35b610531600480360360408110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd1565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105df5780601f106105b4576101008083540402835291602001916105df565b820191906000526020600020905b8154815290600101906020018083116105c257829003601f168201915b5050505050905090565b60006105fd6105f6610c58565b8484610c60565b6001905092915050565b6000600254905090565b600061061e848484610e57565b7f2e0a96bc794d245890a5f292977c9101c651b93cb30a24ea2418d38b0bac2df6600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610688610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a161079a6040518060400160405280601781526020017f5f616c6c6f77616e6365735f616d6f756e74206973203a000000000000000000815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061075a610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110b3565b6107d96040518060400160405280600b81526020017f616d6f756e74206973203a000000000000000000000000000000000000000000815250836110b3565b61089a846107e5610c58565b6108958560405180606001604052806028815260200161139c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60006109656108c9610c58565b8461096085600160006108da610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b610c60565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ba610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610adc5780601f10610ab157610100808354040283529160200191610adc565b820191906000526020600020905b815481529060010190602001808311610abf57829003601f168201915b5050505050905090565b6000610ba9610af3610c58565b84610ba48560405180606001604052806025815260200161140d6025913960016000610b1d610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b6001905092915050565b6000610bc7610bc0610c58565b8484610e57565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806113e96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113546022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610edd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113316023913960400191505060405180910390fd5b610f6e838383611302565b610fd981604051806060016040528060268152602001611376602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6111b682826040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156111015780820151818401526020810190506110e6565b50505050905090810190601f16801561112e5780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040527f9710a9d0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611307565b5050565b6000838311158290611267576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561122c578082015181840152602081019050611211565b50505050905090810190601f1680156112595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156112f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b60008151905060006a636f6e736f6c652e6c6f679050602083016000808483855afa505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122062d8db539ee8f14a26ab4f8a9aa44f48479bb953fd294102deb5917a0af8494064736f6c63430006020033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80633e94dc0f116100715780633e94dc0f146102d057806370a082311461032857806395d89b4114610380578063a457c2d714610403578063a9059cbb14610469578063dd62ed3e146104cf576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a257806323b872dd146101c0578063313ce56714610246578063395093511461026a575b600080fd5b6100c1610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e9565b604051808215151515815260200191505060405180910390f35b6101aa610607565b6040518082815260200191505060405180910390f35b61022c600480360360608110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610611565b604051808215151515815260200191505060405180910390f35b61024e6108a5565b604051808260ff1660ff16815260200191505060405180910390f35b6102b66004803603604081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b604051808215151515815260200191505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096f565b6040518082815260200191505060405180910390f35b61036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109fc565b6040518082815260200191505060405180910390f35b610388610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c85780820151818401526020810190506103ad565b50505050905090810190601f1680156103f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603604081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae6565b604051808215151515815260200191505060405180910390f35b6104b56004803603604081101561047f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb3565b604051808215151515815260200191505060405180910390f35b610531600480360360408110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd1565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105df5780601f106105b4576101008083540402835291602001916105df565b820191906000526020600020905b8154815290600101906020018083116105c257829003601f168201915b5050505050905090565b60006105fd6105f6610c58565b8484610c60565b6001905092915050565b6000600254905090565b600061061e848484610e57565b7f2e0a96bc794d245890a5f292977c9101c651b93cb30a24ea2418d38b0bac2df6600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610688610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a161079a6040518060400160405280601781526020017f5f616c6c6f77616e6365735f616d6f756e74206973203a000000000000000000815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061075a610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110b3565b6107d96040518060400160405280600b81526020017f616d6f756e74206973203a000000000000000000000000000000000000000000815250836110b3565b61089a846107e5610c58565b6108958560405180606001604052806028815260200161139c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60006109656108c9610c58565b8461096085600160006108da610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b610c60565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ba610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610adc5780601f10610ab157610100808354040283529160200191610adc565b820191906000526020600020905b815481529060010190602001808311610abf57829003601f168201915b5050505050905090565b6000610ba9610af3610c58565b84610ba48560405180606001604052806025815260200161140d6025913960016000610b1d610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b6001905092915050565b6000610bc7610bc0610c58565b8484610e57565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806113e96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113546022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610edd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113316023913960400191505060405180910390fd5b610f6e838383611302565b610fd981604051806060016040528060268152602001611376602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6111b682826040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156111015780820151818401526020810190506110e6565b50505050905090810190601f16801561112e5780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040527f9710a9d0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611307565b5050565b6000838311158290611267576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561122c578082015181840152602081019050611211565b50505050905090810190601f1680156112595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156112f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b60008151905060006a636f6e736f6c652e6c6f679050602083016000808483855afa505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122062d8db539ee8f14a26ab4f8a9aa44f48479bb953fd294102deb5917a0af8494064736f6c63430006020033", - "linkReferences": {}, - "deployedLinkReferences": {} -} +{ + "_format": "hh-sol-artifact-1", + "contractName": "ERC20", + "sourceName": "contracts/ERC20.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "msgsender", + "type": "uint256" + } + ], + "name": "eventlog", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "get_allowances_msgSender", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506040516200173138038062001731833981810160405260408110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b838201915060208201858111156200006f57600080fd5b82518660018202830111640100000000821117156200008d57600080fd5b8083526020830192505050908051906020019080838360005b83811015620000c3578082015181840152602081019050620000a6565b50505050905090810190601f168015620000f15780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200011557600080fd5b838201915060208201858111156200012c57600080fd5b82518660018202830111640100000000821117156200014a57600080fd5b8083526020830192505050908051906020019080838360005b838110156200018057808201518184015260208101905062000163565b50505050905090810190601f168015620001ae5780820380516001836020036101000a031916815260200191505b506040525050508160039080519060200190620001cd9291906200020b565b508060049080519060200190620001e69291906200020b565b506012600560006101000a81548160ff021916908360ff1602179055505050620002ba565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200024e57805160ff19168380011785556200027f565b828001600101855582156200027f579182015b828111156200027e57825182559160200191906001019062000261565b5b5090506200028e919062000292565b5090565b620002b791905b80821115620002b357600081600090555060010162000299565b5090565b90565b61146780620002ca6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c80633e94dc0f116100715780633e94dc0f146102d057806370a082311461032857806395d89b4114610380578063a457c2d714610403578063a9059cbb14610469578063dd62ed3e146104cf576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a257806323b872dd146101c0578063313ce56714610246578063395093511461026a575b600080fd5b6100c1610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e9565b604051808215151515815260200191505060405180910390f35b6101aa610607565b6040518082815260200191505060405180910390f35b61022c600480360360608110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610611565b604051808215151515815260200191505060405180910390f35b61024e6108a5565b604051808260ff1660ff16815260200191505060405180910390f35b6102b66004803603604081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b604051808215151515815260200191505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096f565b6040518082815260200191505060405180910390f35b61036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109fc565b6040518082815260200191505060405180910390f35b610388610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c85780820151818401526020810190506103ad565b50505050905090810190601f1680156103f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603604081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae6565b604051808215151515815260200191505060405180910390f35b6104b56004803603604081101561047f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb3565b604051808215151515815260200191505060405180910390f35b610531600480360360408110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd1565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105df5780601f106105b4576101008083540402835291602001916105df565b820191906000526020600020905b8154815290600101906020018083116105c257829003601f168201915b5050505050905090565b60006105fd6105f6610c58565b8484610c60565b6001905092915050565b6000600254905090565b600061061e848484610e57565b7f2e0a96bc794d245890a5f292977c9101c651b93cb30a24ea2418d38b0bac2df6600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610688610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a161079a6040518060400160405280601781526020017f5f616c6c6f77616e6365735f616d6f756e74206973203a000000000000000000815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061075a610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110b3565b6107d96040518060400160405280600b81526020017f616d6f756e74206973203a000000000000000000000000000000000000000000815250836110b3565b61089a846107e5610c58565b6108958560405180606001604052806028815260200161139c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60006109656108c9610c58565b8461096085600160006108da610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b610c60565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ba610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610adc5780601f10610ab157610100808354040283529160200191610adc565b820191906000526020600020905b815481529060010190602001808311610abf57829003601f168201915b5050505050905090565b6000610ba9610af3610c58565b84610ba48560405180606001604052806025815260200161140d6025913960016000610b1d610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b6001905092915050565b6000610bc7610bc0610c58565b8484610e57565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806113e96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113546022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610edd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113316023913960400191505060405180910390fd5b610f6e838383611302565b610fd981604051806060016040528060268152602001611376602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6111b682826040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156111015780820151818401526020810190506110e6565b50505050905090810190601f16801561112e5780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040527f9710a9d0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611307565b5050565b6000838311158290611267576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561122c578082015181840152602081019050611211565b50505050905090810190601f1680156112595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156112f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b60008151905060006a636f6e736f6c652e6c6f679050602083016000808483855afa505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122062d8db539ee8f14a26ab4f8a9aa44f48479bb953fd294102deb5917a0af8494064736f6c63430006020033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80633e94dc0f116100715780633e94dc0f146102d057806370a082311461032857806395d89b4114610380578063a457c2d714610403578063a9059cbb14610469578063dd62ed3e146104cf576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a257806323b872dd146101c0578063313ce56714610246578063395093511461026a575b600080fd5b6100c1610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e9565b604051808215151515815260200191505060405180910390f35b6101aa610607565b6040518082815260200191505060405180910390f35b61022c600480360360608110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610611565b604051808215151515815260200191505060405180910390f35b61024e6108a5565b604051808260ff1660ff16815260200191505060405180910390f35b6102b66004803603604081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b604051808215151515815260200191505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096f565b6040518082815260200191505060405180910390f35b61036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109fc565b6040518082815260200191505060405180910390f35b610388610a44565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c85780820151818401526020810190506103ad565b50505050905090810190601f1680156103f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603604081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae6565b604051808215151515815260200191505060405180910390f35b6104b56004803603604081101561047f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bb3565b604051808215151515815260200191505060405180910390f35b610531600480360360408110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd1565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105df5780601f106105b4576101008083540402835291602001916105df565b820191906000526020600020905b8154815290600101906020018083116105c257829003601f168201915b5050505050905090565b60006105fd6105f6610c58565b8484610c60565b6001905092915050565b6000600254905090565b600061061e848484610e57565b7f2e0a96bc794d245890a5f292977c9101c651b93cb30a24ea2418d38b0bac2df6600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610688610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a161079a6040518060400160405280601781526020017f5f616c6c6f77616e6365735f616d6f756e74206973203a000000000000000000815250600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061075a610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110b3565b6107d96040518060400160405280600b81526020017f616d6f756e74206973203a000000000000000000000000000000000000000000815250836110b3565b61089a846107e5610c58565b6108958560405180606001604052806028815260200161139c60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061084b610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60006109656108c9610c58565b8461096085600160006108da610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b610c60565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ba610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610adc5780601f10610ab157610100808354040283529160200191610adc565b820191906000526020600020905b815481529060010190602001808311610abf57829003601f168201915b5050505050905090565b6000610ba9610af3610c58565b84610ba48560405180606001604052806025815260200161140d6025913960016000610b1d610c58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b610c60565b6001905092915050565b6000610bc7610bc0610c58565b8484610e57565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ce6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806113e96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113546022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610edd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113c46025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113316023913960400191505060405180910390fd5b610f6e838383611302565b610fd981604051806060016040528060268152602001611376602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ba9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061106c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461127a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6111b682826040516024018080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156111015780820151818401526020810190506110e6565b50505050905090810190601f16801561112e5780820380516001836020036101000a031916815260200191505b5093505050506040516020818303038152906040527f9710a9d0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611307565b5050565b6000838311158290611267576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561122c578082015181840152602081019050611211565b50505050905090810190601f1680156112595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156112f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b60008151905060006a636f6e736f6c652e6c6f679050602083016000808483855afa505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122062d8db539ee8f14a26ab4f8a9aa44f48479bb953fd294102deb5917a0af8494064736f6c63430006020033", + "linkReferences": {}, + "deployedLinkReferences": {} +} From 9a51527ceb458ccce9813d7dc9f18cad87606480 Mon Sep 17 00:00:00 2001 From: KaoImin Date: Wed, 6 Dec 2023 15:00:54 +0800 Subject: [PATCH 2/5] revert Makefile --- Makefile | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 00ad3c1b2..e9d56061a 100644 --- a/Makefile +++ b/Makefile @@ -5,75 +5,75 @@ COMMIT := $(shell git rev-parse --short HEAD) CARGO := cargo test: - ${CARGO} test ${VERBOSE} --all -- --nocapture + ${CARGO} test ${VERBOSE} --all -- --nocapture # Since Axon uses global variables, run all tests in one process may cause unexpected errors. test-in-separate-processes: - cargo nextest run --workspace --no-fail-fast --hide-progress-bar --failure-output final + cargo nextest run --workspace --no-fail-fast --hide-progress-bar --failure-output final doc: - cargo doc --all --no-deps + cargo doc --all --no-deps doc-deps: - cargo doc --all + cargo doc --all check: - ${CARGO} check ${VERBOSE} --all + ${CARGO} check ${VERBOSE} --all build: - ${CARGO} build ${VERBOSE} --release + ${CARGO} build ${VERBOSE} --release check-fmt: - cargo +nightly fmt ${VERBOSE} --all -- --check + cargo +nightly fmt ${VERBOSE} --all -- --check fmt: - cargo +nightly fmt ${VERBOSE} --all + cargo +nightly fmt ${VERBOSE} --all clippy: axon-clippy axon-tools-clippy axon-clippy: - ${CARGO} clippy ${VERBOSE} --all --all-targets --all-features -- \ - -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use + ${CARGO} clippy ${VERBOSE} --all --all-targets --all-features -- \ + -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use axon-tools-clippy: - ${CARGO} clippy ${VERBOSE} --manifest-path=devtools/axon-tools/Cargo.toml --all-features -- \ - -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use + ${CARGO} clippy ${VERBOSE} --manifest-path=devtools/axon-tools/Cargo.toml --all-features -- \ + -D warnings -D clippy::clone_on_ref_ptr -D clippy::enum_glob_use sort: - cargo sort -gw + cargo sort -gw check-sort: - cargo sort -gwc + cargo sort -gwc ci: check-fmt clippy test info: - date - pwd - env + date + pwd + env # For counting lines of code stats: - @cargo count --version || cargo +nightly install --git https://github.com/kbknapp/cargo-count - @cargo count --separator , --unsafe-statistics + @cargo count --version || cargo +nightly install --git https://github.com/kbknapp/cargo-count + @cargo count --separator , --unsafe-statistics # Use cargo-audit to audit Cargo.lock for crates with security vulnerabilities # expecting to see "Success No vulnerable packages found" security-audit: - @cargo audit --version || cargo install cargo-audit - @cargo audit + @cargo audit --version || cargo install cargo-audit + @cargo audit crosschain-test: - cd builtin-contract/crosschain \ - && yarn --from-lock-file && yarn run compile && yarn run test + cd builtin-contract/crosschain \ + && yarn --from-lock-file && yarn run compile && yarn run test crosschain-genesis-deploy: - cd builtin-contract/crosschain && yarn run deploy + cd builtin-contract/crosschain && yarn run deploy unit-test: test crosschain-test schema: - make -C core/cross-client/ schema + make -C core/cross-client/ schema .PHONY: build prod prod-test .PHONY: fmt test clippy doc doc-deps doc-api check stats From 17bf12f4925f65f43e78d802858c19925a2af8b6 Mon Sep 17 00:00:00 2001 From: KaoImin Date: Thu, 21 Dec 2023 16:15:36 +0800 Subject: [PATCH 3/5] fix some style --- .github/ISSUE_TEMPLATE/help.yml | 1 - .github/ISSUE_TEMPLATE/others.yml | 2 - .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/config/_labeler.yml | 38 ++- .github/release-drafter.yml | 52 +-- .github/workflows/axon-start-test.yml | 196 ++++++------ .github/workflows/axon-sync-test.yml | 206 ++++++------ .github/workflows/build_image.yml | 8 +- .github/workflows/build_image_ghcr.yml | 188 +++++------ .github/workflows/clippy.yml | 36 +-- .github/workflows/copy_config_to_devops.yml | 20 +- .github/workflows/coverage.yml | 12 +- .github/workflows/fmt.yml | 28 +- .github/workflows/generate_changlog_file.yml | 38 +-- .github/workflows/hardfork_test.yml | 218 ++++++------- .github/workflows/issue_comments.yml | 22 +- .github/workflows/openzeppelin_test_6_10.yml | 2 +- .github/workflows/pr_lint.yml | 4 +- .github/workflows/regression_testing.yml | 33 +- .github/workflows/remove_ci_caches.yml | 9 +- .github/workflows/unit_test.yml | 54 ++-- .github/workflows/v3_core_test.yml | 2 +- .gitignore | 2 + CONTRIBUTING.md | 6 +- common/apm/README.md | 2 +- common/logger/log.yml | 6 +- core/api/README.md | 314 +++++++++---------- core/cli/README.md | 30 +- devtools/axon-tools/src/tests/block.json | 54 ++-- devtools/axon-tools/src/tests/metadata.json | 100 +++--- devtools/chain/blockscan-explorer.env | 125 ++++---- devtools/chain/docker-compose.yml | 22 +- devtools/chain/quick-start.md | 6 +- devtools/ci/ansible/playbook.yml | 1 - devtools/ci/build-arm64.sh | 57 ++-- devtools/ci/terraform/ami.tf | 4 +- devtools/ci/terraform/main.tf | 6 +- devtools/ci/terraform/variables.tf | 14 +- devtools/docker/health_check.sh | 13 +- devtools/metadata-cli/README.md | 10 +- tests/e2e/.eslintrc.js | 38 +-- tests/e2e/CONTRIBUTING_en-Hans.md | 12 +- tests/e2e/config.json | 20 +- 43 files changed, 1009 insertions(+), 1004 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/help.yml b/.github/ISSUE_TEMPLATE/help.yml index f0f0fdea8..8ad914536 100644 --- a/.github/ISSUE_TEMPLATE/help.yml +++ b/.github/ISSUE_TEMPLATE/help.yml @@ -24,4 +24,3 @@ body: value: "Describe the problem details:" validations: required: true - diff --git a/.github/ISSUE_TEMPLATE/others.yml b/.github/ISSUE_TEMPLATE/others.yml index 5ab64f0e0..9432dcbf9 100644 --- a/.github/ISSUE_TEMPLATE/others.yml +++ b/.github/ISSUE_TEMPLATE/others.yml @@ -24,5 +24,3 @@ body: value: "Describe the problem details:" validations: required: true - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 09229627e..b8cd18af2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -43,7 +43,7 @@ See also: ### **CI Description** | CI Name | Description | -| ---------------------- | ------------------------------------------------------------------------------------------------------- | +|------------------------|---------------------------------------------------------------------------------------------------------| | *Web3 Compatible Test* | Test the Web3 compatibility of Axon | | *v3 Core Test* | Run the compatibility tests provided by Uniswap V3 | | *OpenZeppelin tests* | Run the compatibility tests provided by OpenZeppelin, including OCT 1-5 \| 6-10 \| 11 \| 12-15 \| 16-19 | diff --git a/.github/config/_labeler.yml b/.github/config/_labeler.yml index 6882091f2..83d9e592c 100644 --- a/.github/config/_labeler.yml +++ b/.github/config/_labeler.yml @@ -1,38 +1,50 @@ underlying: -- any: ['core/consensus/src/*', 'core/mempool/src/*', 'core/executor/src/*', 'core/network/src/*', 'core/storage/src/*'] + - any: + [ + "core/consensus/src/*", + "core/mempool/src/*", + "core/executor/src/*", + "core/network/src/*", + "core/storage/src/*", + ] API: -- core/api/src/* + - core/api/src/* interoperation: -- core/interoperation/src/* + - core/interoperation/src/* crosschain: -- any: ['core/cross-client/src/*', 'core/tx-assembler/src/*'] + - any: ["core/cross-client/src/*", "core/tx-assembler/src/*"] devtools: -- devtools/* + - devtools/* documents: -- any: ['docs/*', README.md, CHANGELOG.md] + - any: ["docs/*", README.md, CHANGELOG.md] e2e: -- tests/e2e/src/* + - tests/e2e/src/* contract: -- builtin-contract/* + - builtin-contract/* protocol: -- protocol/src/* + - protocol/src/* toolchain: -- rust-toolchain + - rust-toolchain ci: -- any: ['.github/actions/*', '.github/workflows/*'] + - any: [".github/actions/*", ".github/workflows/*"] apm: -- any: ['common/apm/src/*', 'common/apm-derive/src/*', 'common/memory-tracker/src/*'] + - any: + [ + "common/apm/src/*", + "common/apm-derive/src/*", + "common/memory-tracker/src/*", + ] config: -- any: ['common/config-parser/src/*'] + - any: ["common/config-parser/src/*"] diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 85e9db32c..c675712e3 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1,5 @@ -name-template: 'v$RESOLVED_VERSION-alpha.1' -tag-template: 'v$RESOLVED_VERSION-alpha.1' +name-template: "v$RESOLVED_VERSION-alpha.1" +tag-template: "v$RESOLVED_VERSION-alpha.1" template: | # What's Changed @@ -7,35 +7,35 @@ template: | **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION categories: - - title: '🚀 Features' - label: 'feature' - - title: '🔥 Enhancement' - label: 'enhancement' - - title: '🐛 Bug Fixes' - label: 'bugfix' - - title: '🐝 refactor' - label: 'refactor' - - title: '🧰 Chore' - label: 'chore' - - title: '📖 Documentation' - label: 'document' - - title: '✨ Other changes' - - title: '⬆️ Dependency Updates' - label: 'dependencies' - - title: '🌈 Style' - label: 'style' + - title: "🚀 Features" + label: "feature" + - title: "🔥 Enhancement" + label: "enhancement" + - title: "🐛 Bug Fixes" + label: "bugfix" + - title: "🐝 refactor" + label: "refactor" + - title: "🧰 Chore" + label: "chore" + - title: "📖 Documentation" + label: "document" + - title: "✨ Other changes" + - title: "⬆️ Dependency Updates" + label: "dependencies" + - title: "🌈 Style" + label: "style" version-resolver: minor: labels: - - 'feature' + - "feature" patch: labels: - - 'bug' - - 'maintenance' - - 'docs' - - 'dependencies' - - 'security' + - "bug" + - "maintenance" + - "docs" + - "dependencies" + - "security" exclude-labels: - - 'skip-changelog' + - "skip-changelog" diff --git a/.github/workflows/axon-start-test.yml b/.github/workflows/axon-start-test.yml index c309b846d..9b56cffa5 100644 --- a/.github/workflows/axon-start-test.yml +++ b/.github/workflows/axon-start-test.yml @@ -17,54 +17,54 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build - - name: Build Axon in the development profile - run: | - # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` - # related issue: https://github.com/axonweb3/axon/issues/1387 - lscpu - # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 - PORTABLE=1 USE_SSE=1 cargo build + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build + - name: Build Axon in the development profile + run: | + # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` + # related issue: https://github.com/axonweb3/axon/issues/1387 + lscpu + # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 + PORTABLE=1 USE_SSE=1 cargo build - - name: Start a single Axon node - env: - LOG_FILE: ${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log - run: | - target/debug/axon --version | tee ${{ env.LOG_FILE }} - target/debug/axon init \ - --config devtools/chain/config.toml \ - --chain-spec devtools/chain/specs/single_node/chain-spec.toml \ - | tee -a ${{ env.LOG_FILE }} - target/debug/axon run \ - --config devtools/chain/config.toml \ - | tee -a ${{ env.LOG_FILE }} & + - name: Start a single Axon node + env: + LOG_FILE: ${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log + run: | + target/debug/axon --version | tee ${{ env.LOG_FILE }} + target/debug/axon init \ + --config devtools/chain/config.toml \ + --chain-spec devtools/chain/specs/single_node/chain-spec.toml \ + | tee -a ${{ env.LOG_FILE }} + target/debug/axon run \ + --config devtools/chain/config.toml \ + | tee -a ${{ env.LOG_FILE }} & - npx zx <<'EOF' - import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' - await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2)) - EOF - timeout-minutes: 1 + npx zx <<'EOF' + import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' + await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2)) + EOF + timeout-minutes: 1 - - name: Archive logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: single-axon-node-logs - path: | - ${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log + - name: Archive logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: single-axon-node-logs + path: | + ${{ runner.temp }}/${{ matrix.os }}-single-axon-node.log multi-nodes: strategy: @@ -75,64 +75,64 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build - - name: Build Axon in the development profile - run: | - # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` - # related issue: https://github.com/axonweb3/axon/issues/1387 - lscpu - # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 - PORTABLE=1 USE_SSE=1 cargo build + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build + - name: Build Axon in the development profile + run: | + # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` + # related issue: https://github.com/axonweb3/axon/issues/1387 + lscpu + # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 + PORTABLE=1 USE_SSE=1 cargo build - - name: Start multiple Axon nodes - env: - LOG_PATH: ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes - run: | - mkdir -p ${{ env.LOG_PATH }} + - name: Start multiple Axon nodes + env: + LOG_PATH: ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes + run: | + mkdir -p ${{ env.LOG_PATH }} - target/debug/axon --version + target/debug/axon --version - for id in 1 2 3 4; do - target/debug/axon init \ - --config devtools/chain/nodes/node_${id}.toml \ - --chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \ - > ${{ env.LOG_PATH }}/node_${id}.log - done + for id in 1 2 3 4; do + target/debug/axon init \ + --config devtools/chain/nodes/node_${id}.toml \ + --chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \ + > ${{ env.LOG_PATH }}/node_${id}.log + done - for id in 1 2 3 4; do - target/debug/axon run \ - --config devtools/chain/nodes/node_${id}.toml \ - >> ${{ env.LOG_PATH }}/node_${id}.log & - done + for id in 1 2 3 4; do + target/debug/axon run \ + --config devtools/chain/nodes/node_${id}.toml \ + >> ${{ env.LOG_PATH }}/node_${id}.log & + done - npx zx <<'EOF' - import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' - await retry(3, '6s', () => Promise.all([ - waitXBlocksPassed('http://127.0.0.1:8001', 4), - waitXBlocksPassed('http://127.0.0.1:8002', 4), - waitXBlocksPassed('http://127.0.0.1:8003', 4), - waitXBlocksPassed('http://127.0.0.1:8004', 4), - ])) - EOF - timeout-minutes: 1 + npx zx <<'EOF' + import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' + await retry(3, '6s', () => Promise.all([ + waitXBlocksPassed('http://127.0.0.1:8001', 4), + waitXBlocksPassed('http://127.0.0.1:8002', 4), + waitXBlocksPassed('http://127.0.0.1:8003', 4), + waitXBlocksPassed('http://127.0.0.1:8004', 4), + ])) + EOF + timeout-minutes: 1 - - name: Archive logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: multi-axon-nodes-logs - path: | - ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes/ + - name: Archive logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: multi-axon-nodes-logs + path: | + ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes/ diff --git a/.github/workflows/axon-sync-test.yml b/.github/workflows/axon-sync-test.yml index d1f735f76..a7fd5cd4d 100644 --- a/.github/workflows/axon-sync-test.yml +++ b/.github/workflows/axon-sync-test.yml @@ -15,124 +15,120 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build - - - name: Build Axon - run: | - # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` - # related issue: https://github.com/axonweb3/axon/issues/1387 - lscpu - cargo build - - - - name: Archive Axon Artifacts - uses: actions/upload-artifact@v3 - with: - name: axon-dir - path: | - target/debug/axon - devtools/chain/default.db-options - devtools/chain/config.toml - devtools/chain/specs/alphanet_nodes/chain-spec.toml - devtools/ci/scripts/helper.js - - retention-days: 3 - - + - uses: actions/checkout@v4 + + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build + + - name: Build Axon + run: | + # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` + # related issue: https://github.com/axonweb3/axon/issues/1387 + lscpu + cargo build + + - name: Archive Axon Artifacts + uses: actions/upload-artifact@v3 + with: + name: axon-dir + path: | + target/debug/axon + devtools/chain/default.db-options + devtools/chain/config.toml + devtools/chain/specs/alphanet_nodes/chain-spec.toml + devtools/ci/scripts/helper.js + + retention-days: 3 + Download_and_Start_Axon_Sync: name: Download_and_Start_Axon_Sync - needs: Build_and_Archive_Axon + needs: Build_and_Archive_Axon runs-on: layer2-runners timeout-minutes: 1800 steps: - - name: Download Axon Binary for Build_and_Archive_Axon - uses: actions/download-artifact@v3 - with: - name: axon-dir - - name: Replacement configuration - run: | - sed -i 's@multi_address = "/ip4/127.0.0.1/tcp/8001/p2p/QmNk6bBwkLPuqnsrtxpp819XLZY3ymgjs3p1nKtxBVgqxj"@multi_address = "/dns4/axon1/tcp/8001/p2p/QmcgR2Jj6XJ4B9VDp3UaG3dcwFaeqwXikHco9nLq9Eand6"@' devtools/chain/config.toml - sed -i 's@bls_privkey_file = "bls.key"@bls_privkey_file = "bls_0.key"@' devtools/chain/config.toml - sed -i 's@net_privkey_file = "net.key"@net_privkey_file = "net_0.key"@' devtools/chain/config.toml - - - name: Start Axon Node - env: - LOG_FILE: ${{ runner.temp }}/layer2-runner-axon-node.log - run: | - chmod +x target/debug/axon - target/debug/axon generate-keypair -n 1 -p devtools/chain/ - target/debug/axon --version - target/debug/axon init \ - --config devtools/chain/config.toml \ - --chain-spec devtools/chain/specs/alphanet_nodes/chain-spec.toml - - nohup target/debug/axon run \ - --config devtools/chain/config.toml & - - - name: Wati for App to Start - run: sleep 15 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Compare Block Heights - run: | - npx zx <<'EOF' - #!/usr/bin/env zx - import { getLatestBlockNum } from './devtools/ci/scripts/helper.js'; - - async function main() { - let previousLocalHeight = null; - - while (true) { - const localHeight = await getLatestBlockNum('http://127.0.0.1:8000'); - const remoteHeight = await getLatestBlockNum('http://axon1:8000'); - - console.log(`localBlockNumber: ${localHeight}, remoteBlockNumber: ${remoteHeight}`); - - if (localHeight >= remoteHeight - 10 && localHeight <= remoteHeight) { - console.log(`localBlockNumber: ${localHeight}, remoteBlockNumber: ${remoteHeight}, localnode sync succeeded`); - return process.exit(0); - } - - if (localHeight === previousLocalHeight) { - console.error(`synchronization exception localBlockNumber: ${localHeight}`); - return process.exit(1); + - name: Download Axon Binary for Build_and_Archive_Axon + uses: actions/download-artifact@v3 + with: + name: axon-dir + - name: Replacement configuration + run: | + sed -i 's@multi_address = "/ip4/127.0.0.1/tcp/8001/p2p/QmNk6bBwkLPuqnsrtxpp819XLZY3ymgjs3p1nKtxBVgqxj"@multi_address = "/dns4/axon1/tcp/8001/p2p/QmcgR2Jj6XJ4B9VDp3UaG3dcwFaeqwXikHco9nLq9Eand6"@' devtools/chain/config.toml + sed -i 's@bls_privkey_file = "bls.key"@bls_privkey_file = "bls_0.key"@' devtools/chain/config.toml + sed -i 's@net_privkey_file = "net.key"@net_privkey_file = "net_0.key"@' devtools/chain/config.toml + + - name: Start Axon Node + env: + LOG_FILE: ${{ runner.temp }}/layer2-runner-axon-node.log + run: | + chmod +x target/debug/axon + target/debug/axon generate-keypair -n 1 -p devtools/chain/ + target/debug/axon --version + target/debug/axon init \ + --config devtools/chain/config.toml \ + --chain-spec devtools/chain/specs/alphanet_nodes/chain-spec.toml + + nohup target/debug/axon run \ + --config devtools/chain/config.toml & + + - name: Wati for App to Start + run: sleep 15 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Compare Block Heights + run: | + npx zx <<'EOF' + #!/usr/bin/env zx + import { getLatestBlockNum } from './devtools/ci/scripts/helper.js'; + + async function main() { + let previousLocalHeight = null; + + while (true) { + const localHeight = await getLatestBlockNum('http://127.0.0.1:8000'); + const remoteHeight = await getLatestBlockNum('http://axon1:8000'); + + console.log(`localBlockNumber: ${localHeight}, remoteBlockNumber: ${remoteHeight}`); + + if (localHeight >= remoteHeight - 10 && localHeight <= remoteHeight) { + console.log(`localBlockNumber: ${localHeight}, remoteBlockNumber: ${remoteHeight}, localnode sync succeeded`); + return process.exit(0); + } + + if (localHeight === previousLocalHeight) { + console.error(`synchronization exception localBlockNumber: ${localHeight}`); + return process.exit(1); + } + + previousLocalHeight = localHeight; + await new Promise(resolve => setTimeout(resolve, 600000)); } - - previousLocalHeight = localHeight; - await new Promise(resolve => setTimeout(resolve, 600000)); } - } - - main(); - EOF - timeout-minutes: 1800 - + main(); + EOF + timeout-minutes: 1800 notice: runs-on: ubuntu-latest - needs: Download_and_Start_Axon_Sync + needs: Download_and_Start_Axon_Sync if: success() || failure() steps: - - name: send Axon-sync-test status + - name: send Axon-sync-test status run: | curl -H "Content-Type: application/json" \ -X POST https://discord.com/api/webhooks/${{secrets.DISCORD_CHANNEL_ID}}/${{secrets.DISCORD_CHANNEL_TOKEN}} \ @@ -159,4 +155,4 @@ jobs: ] } ] - }' + }' diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml index fee2d78c7..5e56af085 100644 --- a/.github/workflows/build_image.yml +++ b/.github/workflows/build_image.yml @@ -3,7 +3,7 @@ name: Build docker image on: push: tags: - - '*' + - "*" workflow_dispatch: inputs: dispatch: @@ -60,7 +60,7 @@ jobs: env: AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} - AWS_EC2_TYPE: "c6g.xlarge" + AWS_EC2_TYPE: "c6g.xlarge" DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} AXON_TAG: arm64-${{needs.output_tag_name.outputs.tag_name}} @@ -77,10 +77,10 @@ jobs: env: JOB_ID: "build-arm64-image-${{ github.repository_owner }}-${{ steps.date.outputs.date }}-in-10h" run: | - ./devtools/ci/build-arm64.sh run + ./devtools/ci/build-arm64.sh run - name: clean up if: ${{ always() }} env: JOB_ID: "build-arm64-image-${{ github.repository_owner }}-${{ steps.date.outputs.date }}-in-10h" run: | - ./devtools/ci/build-arm64.sh clean + ./devtools/ci/build-arm64.sh clean diff --git a/.github/workflows/build_image_ghcr.yml b/.github/workflows/build_image_ghcr.yml index 917dc7c5d..36b0fb7d7 100644 --- a/.github/workflows/build_image_ghcr.yml +++ b/.github/workflows/build_image_ghcr.yml @@ -2,19 +2,19 @@ name: Build ghcr.io image on: push: - branches: [ 'main', '*dev*', '*alpha*', '*beta*', '*rc*' ] + branches: ["main", "*dev*", "*alpha*", "*beta*", "*rc*"] tags: workflow_dispatch: inputs: commit_sha: - description: 'Commit SHA to build' + description: "Commit SHA to build" required: true jobs: build-amd64-image-to-ghcr: runs-on: ubuntu-22.04 env: - REGISTRY: 'ghcr.io/' + REGISTRY: "ghcr.io/" IMAGE_NAME: axon # If you specify the access for any of these scopes, all of those that are not specified are set to none. permissions: @@ -22,63 +22,63 @@ jobs: packages: write steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.commit_sha || '' }} - - # Extract metadata (tags, labels) for the Docker image - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - flavor: | - latest=auto - tags: | - type=ref,event=tag - type=semver,pattern={{version}} - type=ref,event=branch - type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}} - type=ref,event=branch,suffix=-{{sha}} - # minimal (short sha) - type=sha,enable=true,prefix=sha-,format=short - - name: Echo steps.meta.outputs.bake-file - run: cat ${{ steps.meta.outputs.bake-file }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Github resgistry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push image to ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Check versions of the binaries in ${{ fromJSON(steps.meta.outputs.json).tags[0] }} - if: ${{ github.event_name != 'pull_request' }} - env: - IMAGE: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} - run: | - docker run --rm ${{ env.IMAGE }} /app/axon --version - - - name: Record image info to the outputs of this job - id: result - run: | - echo "image_name=`echo ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | awk -F ':' '{print $1}'`" >> $GITHUB_OUTPUT - echo "image_tag=`echo ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | awk -F ':' '{print $NF}'`" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.commit_sha || '' }} + + # Extract metadata (tags, labels) for the Docker image + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + flavor: | + latest=auto + tags: | + type=ref,event=tag + type=semver,pattern={{version}} + type=ref,event=branch + type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}} + type=ref,event=branch,suffix=-{{sha}} + # minimal (short sha) + type=sha,enable=true,prefix=sha-,format=short + - name: Echo steps.meta.outputs.bake-file + run: cat ${{ steps.meta.outputs.bake-file }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Github resgistry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push image to ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: Check versions of the binaries in ${{ fromJSON(steps.meta.outputs.json).tags[0] }} + if: ${{ github.event_name != 'pull_request' }} + env: + IMAGE: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} + run: | + docker run --rm ${{ env.IMAGE }} /app/axon --version + + - name: Record image info to the outputs of this job + id: result + run: | + echo "image_name=`echo ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | awk -F ':' '{print $1}'`" >> $GITHUB_OUTPUT + echo "image_tag=`echo ${{ fromJSON(steps.meta.outputs.json).tags[0] }} | awk -F ':' '{print $NF}'`" >> $GITHUB_OUTPUT # Map the meta step outputs to this job outputs outputs: @@ -93,37 +93,37 @@ jobs: working-directory: devtools/chain steps: - - name: Checkout devtools/chain - uses: actions/checkout@v4 - with: - sparse-checkout: | - devtools/chain - devtools/ci/scripts/helper.js - - - name: Modify the Axon image of in devtools/chain/docker-compose.yml - env: - AXON_IMAGE: "${{ needs.build-amd64-image-to-ghcr.outputs.image_name }}:${{ needs.build-amd64-image-to-ghcr.outputs.image_tag }}" - uses: mikefarah/yq@v4.40.5 - with: - cmd: yq -i '.services.axon.image = "${{ env.AXON_IMAGE }}"' 'devtools/chain/docker-compose.yml' - - - name: Review devtools/chain/docker-compose.yml - run: | - echo "====== devtools/chain/docker-compose.yml ======" - cat docker-compose.yml - echo "===============================================" - docker -v - - - name: Run docker compose (v2) up and check the Axon node's health - run: | - echo "start containers in detached mode and wait for them to become healthy" - docker compose up -d --wait - - docker compose ps - docker compose logs --tail 6 - - npx zx <<'EOF' - import { waitXBlocksPassed } from '../ci/scripts/helper.js' - await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2)) - EOF - timeout-minutes: 2 + - name: Checkout devtools/chain + uses: actions/checkout@v4 + with: + sparse-checkout: | + devtools/chain + devtools/ci/scripts/helper.js + + - name: Modify the Axon image of in devtools/chain/docker-compose.yml + env: + AXON_IMAGE: "${{ needs.build-amd64-image-to-ghcr.outputs.image_name }}:${{ needs.build-amd64-image-to-ghcr.outputs.image_tag }}" + uses: mikefarah/yq@v4.40.5 + with: + cmd: yq -i '.services.axon.image = "${{ env.AXON_IMAGE }}"' 'devtools/chain/docker-compose.yml' + + - name: Review devtools/chain/docker-compose.yml + run: | + echo "====== devtools/chain/docker-compose.yml ======" + cat docker-compose.yml + echo "===============================================" + docker -v + + - name: Run docker compose (v2) up and check the Axon node's health + run: | + echo "start containers in detached mode and wait for them to become healthy" + docker compose up -d --wait + + docker compose ps + docker compose logs --tail 6 + + npx zx <<'EOF' + import { waitXBlocksPassed } from '../ci/scripts/helper.js' + await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2)) + EOF + timeout-minutes: 2 diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 2c44e52e9..86eb6b25b 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -23,24 +23,24 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-clippy - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-clippy + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo - - name: Install cargo-clippy - run: rustup component add clippy + - name: Install cargo-clippy + run: rustup component add clippy - - name: Run cargo-clippy in Makefile - run: make clippy && git diff --exit-code Cargo.lock + - name: Run cargo-clippy in Makefile + run: make clippy && git diff --exit-code Cargo.lock diff --git a/.github/workflows/copy_config_to_devops.yml b/.github/workflows/copy_config_to_devops.yml index a1b91824e..1ea00cf52 100644 --- a/.github/workflows/copy_config_to_devops.yml +++ b/.github/workflows/copy_config_to_devops.yml @@ -4,8 +4,8 @@ on: branches: - main paths: - - 'devtools/chain/default.db-options' - - 'devtools/chain/specs/multi_nodes' + - "devtools/chain/default.db-options" + - "devtools/chain/specs/multi_nodes" jobs: build: runs-on: ubuntu-latest @@ -13,7 +13,7 @@ jobs: - name: Git checkout uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 2 - name: Git checkout devops uses: actions/checkout@v4 with: @@ -32,13 +32,13 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.TOKEN }} - path: ${{ github.workspace}}/axon-devops - signoff: false - commit-message: "feat: automated pr to change config files" - branch: bot-${{ github.repository }} - title: "feat: automated pr to change config files" - body: "Automated pr to changes config files by GitHub action" + token: ${{ secrets.TOKEN }} + path: ${{ github.workspace}}/axon-devops + signoff: false + commit-message: "feat: automated pr to change config files" + branch: bot-${{ github.repository }} + title: "feat: automated pr to change config files" + body: "Automated pr to changes config files by GitHub action" - name: Send some mail if: failure() uses: dawidd6/action-send-mail@v3 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d68df338a..dada1c6ae 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,8 +1,8 @@ name: Coverage Test on: # push: - # branches: - # - main + # branches: + # - main workflow_dispatch: inputs: dispatch: @@ -18,7 +18,7 @@ jobs: steps: - name: Generate axon-bot token if: contains(github.event_name, 'workflow_dispatch') && - github.repository_owner == 'axonweb3' + github.repository_owner == 'axonweb3' id: generate_axon_bot_token uses: wow-actions/use-app-token@v2 with: @@ -26,7 +26,7 @@ jobs: private_key: ${{ secrets.AXON_BOT_PRIVATE_KEY }} - name: Event is dispatch if: contains(github.event_name, 'workflow_dispatch') && - github.repository_owner == 'axonweb3' + github.repository_owner == 'axonweb3' uses: actions/github-script@v7 id: get_sha with: @@ -88,9 +88,9 @@ jobs: path: cobertura.xml finally: name: Finally - needs: [ Coverage ] + needs: [Coverage] if: always() && contains(github.event_name, 'workflow_dispatch') && - github.event.inputs.dispatch != 'regression' && github.repository_owner == 'axonweb3' + github.event.inputs.dispatch != 'regression' && github.repository_owner == 'axonweb3' runs-on: ubuntu-latest steps: - name: Generate axon-bot token diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 67c8a7ee9..4e5ea3a51 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -23,21 +23,21 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - components: rustfmt - toolchain: nightly + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + components: rustfmt + toolchain: nightly - - name: Cargo +nightly fmt --all -- --check - run: make check-fmt + - name: Cargo +nightly fmt --all -- --check + run: make check-fmt - - name: Install cargo-sort - run: | - which cargo-sort >/dev/null && echo "cargo-sort is installed" \ - || (echo "cargo-sort is not installed" && cargo install cargo-sort) + - name: Install cargo-sort + run: | + which cargo-sort >/dev/null && echo "cargo-sort is installed" \ + || (echo "cargo-sort is not installed" && cargo install cargo-sort) - - name: Ensure Cargo.toml dependency tables are sorted - run: make check-sort + - name: Ensure Cargo.toml dependency tables are sorted + run: make check-sort diff --git a/.github/workflows/generate_changlog_file.yml b/.github/workflows/generate_changlog_file.yml index 426f919e3..038833e43 100644 --- a/.github/workflows/generate_changlog_file.yml +++ b/.github/workflows/generate_changlog_file.yml @@ -9,11 +9,11 @@ jobs: outputs: changelog: ${{ steps.changelog.outputs.changelog }} steps: - - uses: actions/checkout@v4 - - name: "✏️ Generate release changelog" - id: changelog - uses: liya2017/auto-generator-changelog@main - with: + - uses: actions/checkout@v4 + - name: "✏️ Generate release changelog" + id: changelog + uses: liya2017/auto-generator-changelog@main + with: token: ${{ secrets.GITHUB_TOKEN }} headerLabel: "# 📑 Changelog" addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["document"]},"Features":{"prefix":"### 🚀 Features","labels":["feature"]},"Enhancement":{"prefix":"### 🔥 Enhancement","labels":["enhancement"]},"bugfix":{"prefix":"🐛 Bug Fixes","labels":["bugfix"]},"refactor":{"prefix":"### 🐝 refactor","labels":["refactor"]},"chore":{"prefix":"### 🧰 Chore","labels":["chore"]},"Otherchanges":{"prefix":"✨ Other changes","labels":[""]},"dependencies":{"prefix":"⬆️ Dependency Updates","labels":["dependencies"]},"style":{"prefix":"🌈 Style","labels":["style"]}}' @@ -24,17 +24,17 @@ jobs: runs-on: ubuntu-latest needs: generate-changelog steps: - - uses: actions/checkout@v4 - with: - ref: main - - run: | - echo "${{ needs.generate-changelog.outputs.changelog }}" >${{ github.workspace }}/CHANGELOG.md - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.TOKEN }} - signoff: false - commit-message: "docs: automated update CHANGELOG.md" - branch: bot-${{ github.repository }} - title: "docs: automated update CHANGELOG.md" - body: "automated pr to change log" + - uses: actions/checkout@v4 + with: + ref: main + - run: | + echo "${{ needs.generate-changelog.outputs.changelog }}" >${{ github.workspace }}/CHANGELOG.md + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.TOKEN }} + signoff: false + commit-message: "docs: automated update CHANGELOG.md" + branch: bot-${{ github.repository }} + title: "docs: automated update CHANGELOG.md" + body: "automated pr to change log" diff --git a/.github/workflows/hardfork_test.yml b/.github/workflows/hardfork_test.yml index 91143244e..6e4e746e4 100644 --- a/.github/workflows/hardfork_test.yml +++ b/.github/workflows/hardfork_test.yml @@ -16,112 +16,112 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - - name: Cache of Cargo - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build - - name: Build Axon in the development profile - run: | - # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` - # related issue: https://github.com/axonweb3/axon/issues/1387 - lscpu - # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 - PORTABLE=1 USE_SSE=1 cargo build - - - name: Start multiple Axon nodes - env: - LOG_PATH: ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes - run: | - echo "LOG_PATH: ${{ env.LOG_PATH }}" - mkdir -p ${{ env.LOG_PATH }} - - target/debug/axon --version - - sed -i 's/hardforks = \[\]/hardforks = ["None"]/g' devtools/chain/specs/multi_nodes/chain-spec.toml - grep "hardforks" devtools/chain/specs/multi_nodes/chain-spec.toml - - for id in 1 2 3 4; do - target/debug/axon init \ - --config devtools/chain/nodes/node_${id}.toml \ - --chain-spec devtools/chain/specs/multi_nodes/chain-spec.toml \ - > ${{ env.LOG_PATH }}/node_${id}.log - done - - for id in 1 2 3 4; do - target/debug/axon run \ - --config devtools/chain/nodes/node_${id}.toml \ - >> ${{ env.LOG_PATH }}/node_${id}.log & - done - - npx zx <<'EOF' - import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' - await retry(3, '6s', () => Promise.all([ - waitXBlocksPassed('http://127.0.0.1:8001', 4), - waitXBlocksPassed('http://127.0.0.1:8002', 4), - waitXBlocksPassed('http://127.0.0.1:8003', 4), - waitXBlocksPassed('http://127.0.0.1:8004', 4), - ])) - EOF - timeout-minutes: 1 - - - name: Checkout axonweb3/system-contract-test - uses: actions/checkout@v4 - with: - repository: axonweb3/system-contract-test - ref: 69293ac366991cf5830ab8366a85d72449daeadc - path: system-contract-test - - - name: Choose network - working-directory: system-contract-test - run: | - node_ids=(1 2 3 4) - random_value=$(( (RANDOM % ${#node_ids[@]}) + 1 )) - network=node_"$random_value" - echo "choose network: $network" - sed -i "s/defaultNetwork: \"node_1\"/defaultNetwork: \"$network\"/" hardhat.config.ts - - grep "defaultNetwork" hardhat.config.ts - - - name: Run test cases before hardfork - working-directory: system-contract-test - run: | - npm install - npx hardhat test --grep "deploy a normal contract" - npx hardhat test --grep "deploy a big contract larger than max_contract_limit" - npx hardhat test --grep "check hardfork info before hardfork" - - - name: Run test cases to verify proof - working-directory: system-contract-test - run: | - npx hardhat test --grep "transfer demo" - npx hardhat test test/verifyProof.ts --network proof - - - name: Hardfork - working-directory: system-contract-test - run: | - bash hardfork.sh ../ - - - name: Run test cases after hardfork - working-directory: system-contract-test - run: | - npx hardhat test --grep "check hardfork info after hardfork" - npx hardhat test --grep "update max_contract_limit" - npx hardhat test --grep "deploy a big contract smaller than max_contract_limit" - - - name: Archive logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: multi-axon-nodes-logs - path: | - ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes/ + - uses: actions/checkout@v4 + + - name: Cache of Cargo + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build + - name: Build Axon in the development profile + run: | + # check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu` + # related issue: https://github.com/axonweb3/axon/issues/1387 + lscpu + # PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2 + PORTABLE=1 USE_SSE=1 cargo build + + - name: Start multiple Axon nodes + env: + LOG_PATH: ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes + run: | + echo "LOG_PATH: ${{ env.LOG_PATH }}" + mkdir -p ${{ env.LOG_PATH }} + + target/debug/axon --version + + sed -i 's/hardforks = \[\]/hardforks = ["None"]/g' devtools/chain/specs/multi_nodes/chain-spec.toml + grep "hardforks" devtools/chain/specs/multi_nodes/chain-spec.toml + + for id in 1 2 3 4; do + target/debug/axon init \ + --config devtools/chain/nodes/node_${id}.toml \ + --chain-spec devtools/chain/specs/multi_nodes/chain-spec.toml \ + > ${{ env.LOG_PATH }}/node_${id}.log + done + + for id in 1 2 3 4; do + target/debug/axon run \ + --config devtools/chain/nodes/node_${id}.toml \ + >> ${{ env.LOG_PATH }}/node_${id}.log & + done + + npx zx <<'EOF' + import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' + await retry(3, '6s', () => Promise.all([ + waitXBlocksPassed('http://127.0.0.1:8001', 4), + waitXBlocksPassed('http://127.0.0.1:8002', 4), + waitXBlocksPassed('http://127.0.0.1:8003', 4), + waitXBlocksPassed('http://127.0.0.1:8004', 4), + ])) + EOF + timeout-minutes: 1 + + - name: Checkout axonweb3/system-contract-test + uses: actions/checkout@v4 + with: + repository: axonweb3/system-contract-test + ref: 69293ac366991cf5830ab8366a85d72449daeadc + path: system-contract-test + + - name: Choose network + working-directory: system-contract-test + run: | + node_ids=(1 2 3 4) + random_value=$(( (RANDOM % ${#node_ids[@]}) + 1 )) + network=node_"$random_value" + echo "choose network: $network" + sed -i "s/defaultNetwork: \"node_1\"/defaultNetwork: \"$network\"/" hardhat.config.ts + + grep "defaultNetwork" hardhat.config.ts + + - name: Run test cases before hardfork + working-directory: system-contract-test + run: | + npm install + npx hardhat test --grep "deploy a normal contract" + npx hardhat test --grep "deploy a big contract larger than max_contract_limit" + npx hardhat test --grep "check hardfork info before hardfork" + + - name: Run test cases to verify proof + working-directory: system-contract-test + run: | + npx hardhat test --grep "transfer demo" + npx hardhat test test/verifyProof.ts --network proof + + - name: Hardfork + working-directory: system-contract-test + run: | + bash hardfork.sh ../ + + - name: Run test cases after hardfork + working-directory: system-contract-test + run: | + npx hardhat test --grep "check hardfork info after hardfork" + npx hardhat test --grep "update max_contract_limit" + npx hardhat test --grep "deploy a big contract smaller than max_contract_limit" + + - name: Archive logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: multi-axon-nodes-logs + path: | + ${{ runner.temp }}/${{ matrix.os }}/multi-axon-nodes/ diff --git a/.github/workflows/issue_comments.yml b/.github/workflows/issue_comments.yml index 2afa3ca90..b980c4b84 100644 --- a/.github/workflows/issue_comments.yml +++ b/.github/workflows/issue_comments.yml @@ -6,7 +6,7 @@ jobs: issue-comments: runs-on: ubuntu-latest steps: - - name: get assignees + - name: get assignees uses: actions/github-script@v7 id: assignees with: @@ -29,23 +29,23 @@ jobs: - name: set output comments if: contains(github.event.issue.labels.*.name, 't:bug') run: | - comments="Please fix this bug." - echo "comments=$comments" >> $GITHUB_ENV + comments="Please fix this bug." + echo "comments=$comments" >> $GITHUB_ENV - name: set output comments if: contains(github.event.issue.labels.*.name, 't:feature') run: | - comments="Please develop this feature." - echo "comments=$comments" >> $GITHUB_ENV + comments="Please develop this feature." + echo "comments=$comments" >> $GITHUB_ENV - name: set output comments if: contains(github.event.issue.labels.*.name, 't:help') run: | - comments="Please explain this question." - echo "comments=$comments" >> $GITHUB_ENV + comments="Please explain this question." + echo "comments=$comments" >> $GITHUB_ENV - name: set output comments if: contains(github.event.issue.labels.*.name, 't:others') run: | - comments="Please work on it." - echo "comments=$comments" >> $GITHUB_ENV + comments="Please work on it." + echo "comments=$comments" >> $GITHUB_ENV - name: get assignees id: get_assignees run: | @@ -55,9 +55,9 @@ jobs: - name: Create comment uses: actions-cool/issues-helper@v3 with: - actions: 'create-comment' + actions: "create-comment" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | Hello ${{ steps.get_assignees.outputs.result}}. ${{ env.comments }} - emoji: 'heart' + emoji: "heart" diff --git a/.github/workflows/openzeppelin_test_6_10.yml b/.github/workflows/openzeppelin_test_6_10.yml index 8c3b5bdf8..dde625638 100644 --- a/.github/workflows/openzeppelin_test_6_10.yml +++ b/.github/workflows/openzeppelin_test_6_10.yml @@ -125,7 +125,7 @@ jobs: ./target/debug/axon run \ --config devtools/chain/config.toml \ >> /tmp/log 2>&1 & - + npx zx <<'EOF' import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js' await retry(3, '6s', () => waitXBlocksPassed('http://127.0.0.1:8000', 2)) diff --git a/.github/workflows/pr_lint.yml b/.github/workflows/pr_lint.yml index 927810eb2..6ea16825d 100644 --- a/.github/workflows/pr_lint.yml +++ b/.github/workflows/pr_lint.yml @@ -6,7 +6,7 @@ concurrency: on: pull_request: - types: ['opened', 'edited', 'reopened', 'synchronize'] + types: ["opened", "edited", "reopened", "synchronize"] jobs: WIP: @@ -28,7 +28,7 @@ jobs: # commitlintRulesPath: "./commitlint.rules.js" # default: undefined close: false issue: false - message: 'The title of this PR does not conform the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please fix it, thx.' + message: "The title of this PR does not conform the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please fix it, thx." # if the PR contains a single commit, fail if the commit message and the PR title do not match access_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/regression_testing.yml b/.github/workflows/regression_testing.yml index 7d754a854..7cb4294f3 100644 --- a/.github/workflows/regression_testing.yml +++ b/.github/workflows/regression_testing.yml @@ -25,7 +25,7 @@ jobs: id: invoke-v3-core-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: v3 Core Tests + workflow: v3 Core Tests wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' @@ -38,7 +38,7 @@ jobs: id: invoke-web3-compatible-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: Web3 Compatible Tests + workflow: Web3 Compatible Tests wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' @@ -51,7 +51,7 @@ jobs: id: invoke-openzeppelin-test-1-5-and-12-15-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: OCT 1-5 And 12-15 + workflow: OCT 1-5 And 12-15 wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' @@ -64,7 +64,7 @@ jobs: id: invoke-OCT-6-10-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: OCT 6-10 + workflow: OCT 6-10 wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' @@ -77,7 +77,7 @@ jobs: id: invoke-OCT-11-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: OCT 11 + workflow: OCT 11 wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' @@ -90,18 +90,27 @@ jobs: id: invoke-OCT-16-19-test uses: aurelien-baudet/workflow-dispatch@v2 with: - workflow: OCT 16-19 + workflow: OCT 16-19 wait-for-completion-timeout: 2h token: ${{ secrets.GITHUB_TOKEN }} inputs: '{ "dispatch": "regression" }' output-result: runs-on: ubuntu-latest - needs: [invoke-fmt-test,invoke-v3-core-test,invoke-web3-compatible-test,invoke-openzeppelin-test-1-5-and-12-15-test,invoke-OCT-6-10-test,invoke-OCT-11-test,invoke-OCT-16-19-test] + needs: + [ + invoke-fmt-test, + invoke-v3-core-test, + invoke-web3-compatible-test, + invoke-openzeppelin-test-1-5-and-12-15-test, + invoke-OCT-6-10-test, + invoke-OCT-11-test, + invoke-OCT-16-19-test, + ] if: github.repository_owner == 'axonweb3' && always() steps: - - name: send message - uses: nobrayner/discord-webhook@v1 - with: - github-token: ${{ secrets.github_token }} - discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} + - name: send message + uses: nobrayner/discord-webhook@v1 + with: + github-token: ${{ secrets.github_token }} + discord-webhook: ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/remove_ci_caches.yml b/.github/workflows/remove_ci_caches.yml index 091d3455b..dd62a8160 100644 --- a/.github/workflows/remove_ci_caches.yml +++ b/.github/workflows/remove_ci_caches.yml @@ -1,25 +1,24 @@ name: cleanup caches daily on: schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" # Manurally trigger workflow_dispatch: - jobs: cleanup: runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v4 - + - name: Cleanup run: | gh extension install actions/gh-actions-cache - + REPO=${{ github.repository }} BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" - + echo "Fetching list of cache key" cacheKeys=$(gh actions-cache list -R $REPO | cut -f 1 ) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 434934a07..318536d66 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -23,36 +23,36 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Cache of Cargo - id: cargo-test-cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + - name: Cache of Cargo + id: cargo-test-cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} - - uses: taiki-e/install-action@nextest - - name: Run Rust unit-test - run: | - make test-in-separate-processes - du -hd1 target/debug/ - echo "reduce the cargo cache size" - rm -rf target/debug/examples - rm -rf target/debug/incremental - du -hd1 target/debug/ - ls -l ~/.cargo/bin/ - rm -f ~/.cargo/bin/cargo-nextest + - uses: taiki-e/install-action@nextest + - name: Run Rust unit-test + run: | + make test-in-separate-processes + du -hd1 target/debug/ + echo "reduce the cargo cache size" + rm -rf target/debug/examples + rm -rf target/debug/incremental + du -hd1 target/debug/ + ls -l ~/.cargo/bin/ + rm -f ~/.cargo/bin/cargo-nextest other-unit-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - name: Run crosschain-test - run: make crosschain-test + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Run crosschain-test + run: make crosschain-test diff --git a/.github/workflows/v3_core_test.yml b/.github/workflows/v3_core_test.yml index 3628f578b..b35f5bc9e 100644 --- a/.github/workflows/v3_core_test.yml +++ b/.github/workflows/v3_core_test.yml @@ -24,7 +24,7 @@ jobs: # See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token permissions: statuses: write - + env: IS_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} IS_REGRESSION: ${{ github.event.inputs.dispatch == 'regression' }} diff --git a/.gitignore b/.gitignore index 933292878..ed24065f7 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ byzantine/tests/node_modules *.out node_modules/* + +megalinter-reports/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23310a932..1d7690fb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,7 @@ further defined and clarified by project maintainers. ### Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at hello@nervos.org. All +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. @@ -101,9 +101,9 @@ members of the project's leadership. ### Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +available at [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq \ No newline at end of file + \ No newline at end of file diff --git a/common/apm/README.md b/common/apm/README.md index 8f91a014f..3dd3e02be 100644 --- a/common/apm/README.md +++ b/common/apm/README.md @@ -5,7 +5,7 @@ All current metrics and usage ## API | Metric name | Metric types | Related Grafana panel | -| ---------------------------------- | ------------ | --------------------- | +|------------------------------------|--------------|-----------------------| | axon_api_request_total | counter | | | axon_api_request_result_total | counter | processed_tx_request | | axon_api_request_time_cost_seconds | histogram | | diff --git a/common/logger/log.yml b/common/logger/log.yml index 50700165f..f59cff234 100644 --- a/common/logger/log.yml +++ b/common/logger/log.yml @@ -25,12 +25,12 @@ appenders: root: level: info appenders: - - console - - file + - console + - file loggers: metrics: level: trace appenders: - - metrics + - metrics additive: false diff --git a/core/api/README.md b/core/api/README.md index 0d25bdcac..a5bd1c3c8 100644 --- a/core/api/README.md +++ b/core/api/README.md @@ -206,8 +206,8 @@ These methods track the head of the chain. This is how transactions make their w #### Method `eth_sendRawTransaction` - `eth_sendRawTransaction(data)` - - `data`: [`Hex`](#type-Hex) -- result: [`H256`](#type-H256) + - `data`: [`Hex`](#type-hex) +- result: [`H256`](#type-h256) Submits a pre-signed transaction for broadcast to the Axon network. @@ -247,7 +247,7 @@ Response #### Method `eth_blockNumber` - `eth_blockNumber()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns the current "latest" block number. @@ -286,9 +286,9 @@ Response #### Method `eth_submitWork` - `eth_submitWork(nc,hash,summary)` - - `nc`: [`U256`](#type-U256) - - `hash`: [`H256`](#type-H256) - - `summary`: [`Hex`](#type-Hex) + - `nc`: [`U256`](#type-u256) + - `hash`: [`H256`](#type-h256) + - `summary`: [`Hex`](#type-hex) - result: [`bool`](#type-bool) Used for submitting a proof-of-work solution. Since the axon does not use it, so returns true forever. @@ -333,8 +333,8 @@ Response #### Method `eth_submitHashrate` - `eth_submitHashrate(hash_rate,client_id)` - - `hash_rate`: [`Hex`](#type-Hex) - - `client_id`: [`Hex`](#type-Hex) + - `hash_rate`: [`Hex`](#type-hex) + - `client_id`: [`Hex`](#type-hex) - result: [`bool`](#type-bool) Used for submitting mining hashrate. This method always returns true. @@ -381,9 +381,9 @@ Fetches historical records of every block back to genesis. This is like one larg #### Method `eth_getBlockByHash` - `eth_getBlockByHash(hash,show_rich_tx)` - - `hash`: [`H256`](#type-H256) + - `hash`: [`H256`](#type-h256) - `show_rich_tx`: [`bool`](#type-bool) -- result: [`BlockView`](#type-BlockView) +- result: [`BlockView`](#type-blockview) Returns information about a block by hash. @@ -472,8 +472,8 @@ Response #### Method `eth_getTransactionByHash` - `eth_getTransactionByHash(blockHash)` - - `blockHash`: [`H256`](#type-H256) -- result: [`TransactionView`](#type-TransactionView) + - `blockHash`: [`H256`](#type-h256) +- result: [`TransactionView`](#type-transactionview) Returns the information about a transaction requested by transaction hash. @@ -551,8 +551,8 @@ Response #### Method `eth_getBlockTransactionCountByNumber` - `eth_getBlockTransactionCountByNumber(number)` - - `number`: [`BlockId`](#type-BlockId) -- result: [`U256`](#type-U256) + - `number`: [`BlockId`](#type-blockid) +- result: [`U256`](#type-u256) Returns the number of transactions in a block matching the given block number. @@ -593,8 +593,8 @@ Response #### Method `eth_getTransactionReceipt` - `eth_getTransactionReceipt(hash)` - - `hash`: [`H256`](#type-H256) -- result: [`Web3Receipt`](#type-Web3Receipt) + - `hash`: [`H256`](#type-h256) +- result: [`Web3Receipt`](#type-web3receipt) Returns the receipt of a transaction by transaction hash. @@ -676,10 +676,10 @@ Response #### Method `eth_feeHistory` - `eth_feeHistory(block_count,newest_block,reward_percentiles)` - - `block_count`: [`U256`](#type-U256) - - `newest_block`: [`BlockId`](#type-BlockId) + - `block_count`: [`U256`](#type-u256) + - `newest_block`: [`BlockId`](#type-blockid) - `reward_percentiles`: `Array<`[`f64`](#type-f64)`>` -- result: [`Web3FeeHistory`](#type-Web3FeeHistory) +- result: [`Web3FeeHistory`](#type-web3feehistory) Returns base fee per gas and transaction effective priority fee per gas history for the requested block range if available. The range between headBlock-4 and headBlock is guaranteed to be available while retrieving data from the pending block and older history are optional to support. For pre-EIP-1559 blocks, the gas prices are returned as rewards and zeroes are returned for the base fee per gas. blockCount and newestBlock are both required parameters @@ -733,8 +733,8 @@ Response #### Method `eth_getBlockTransactionCountByHash` - `eth_getBlockTransactionCountByHash(hash)` - - `hash`: [`Hash`](#type-Hash) -- result: [`U256`](#type-U256) + - `hash`: [`Hash`](#type-hash) +- result: [`U256`](#type-u256) Returns the number of transactions in a block from a block matching the given block hash. @@ -775,9 +775,9 @@ Response #### Method `eth_getTransactionByBlockHashAndIndex` - `eth_getTransactionByBlockHashAndIndex(hash,position)` - - `hash`: [`Hash`](#type-Hash) - - `position`: [`U256`](#type-U256) -- result: [`TransactionView`](#type-TransactionView) + - `hash`: [`Hash`](#type-hash) + - `position`: [`U256`](#type-u256) +- result: [`TransactionView`](#type-transactionview) Returns information about a transaction by block hash and transaction index position. @@ -856,9 +856,9 @@ Response #### Method `eth_getTransactionByBlockNumberAndIndex` - `eth_getTransactionByBlockNumberAndIndex(number,position)` - - `number`: [`BlockId`](#type-BlockId) - - `position`: [`U256`](#type-U256) -- result: [`TransactionView`](#type-TransactionView) + - `number`: [`BlockId`](#type-blockid) + - `position`: [`U256`](#type-u256) +- result: [`TransactionView`](#type-transactionview) Returns information about a transaction by block number and transaction index position. @@ -937,9 +937,9 @@ Response #### Method `eth_getBlockByNumber` - `eth_getBlockByNumber(number,show_rich_tx)` - - `number`: [`BlockId`](#type-BlockId) `|` ` "earliest"``| ` ` "latest"``| ` `"pending"` + - `number`: [`BlockId`](#type-blockid) `|` ` "earliest"``| ` ` "latest"``| ` `"pending"` - `show_rich_tx`: [`bool`](#type-bool) -- result: [`BlockView`](#type-Blockview) +- result: [`BlockView`](#type-blockview) Returns information about a block by block number. @@ -1100,9 +1100,9 @@ Methods that report the current state of all the data stored. The "state" is lik #### Method `eth_getTransactionCount` - `eth_getTransactionCount(address,number)` - - `address`: [`H160`](#type-H160) - - `number`: [`BlockId`](#type-BlockId) -- result: [`U256`](#type-U256) + - `address`: [`H160`](#type-h160) + - `number`: [`BlockId`](#type-blockid) +- result: [`U256`](#type-u256) Returns the number of transactions sent from an address. @@ -1144,9 +1144,9 @@ Response #### Method `eth_getBalance` - `eth_getBalance(address,number)` - - `address`: [`H160`](#type-H160) - - `number`: [`BlockId`](#type-BlockId) -- result: [`U256`](#type-U256) + - `address`: [`H160`](#type-h160) + - `number`: [`BlockId`](#type-blockid) +- result: [`U256`](#type-u256) Returns the balance of the account of given address. @@ -1188,7 +1188,7 @@ Response #### Method `eth_chainId` - `eth_chainId()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns the chain_id of axon network. @@ -1229,7 +1229,7 @@ Response #### Method `net_version` - `net_version()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns the current network id. @@ -1270,9 +1270,9 @@ Response #### Method `eth_call` - `eth_call(req,number)` - - `req`: [`Web3CallRequest`](#type-Web3CallRequest) - - `number`: [`BlockId`](#type-BlockId) -- result: [`Hex`](#type-Hex) + - `req`: [`Web3CallRequest`](#type-web3callrequest) + - `number`: [`BlockId`](#type-blockid) +- result: [`Hex`](#type-hex) Executes a new message call immediately without creating a transaction on the block chain. @@ -1322,9 +1322,9 @@ Response #### Method `eth_estimateGas` - `eth_estimateGas(req,number)` - - `req`: [`Web3CallRequest`](#type-Web3CallRequest) - - `number`: [`BlockId`](#type-BlockId) -- result: [`U256`](#type-U256) + - `req`: [`Web3CallRequest`](#type-web3callrequest) + - `number`: [`BlockId`](#type-blockid) +- result: [`U256`](#type-u256) Generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance. @@ -1374,9 +1374,9 @@ Response #### Method `eth_getCode` - `eth_getCode(address,block_number)` - - `address`: [`H160`](#type-H160) - - `block_number`: [`BlockId`](#type-BlockId) -- result: [`Hex`](#type-Hex) + - `address`: [`H160`](#type-h160) + - `block_number`: [`BlockId`](#type-blockid) +- result: [`Hex`](#type-hex) Returns code at a given address. @@ -1420,7 +1420,7 @@ Response - `eth_gasPrice()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns the current price per gas in wei. @@ -1539,7 +1539,7 @@ Response - `net_peerCount()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns number of peers currently connected to the client. @@ -1578,7 +1578,7 @@ Response - `eth_syncing()` -- result: [`Web3SyncStatus`](#type-Web3SyncStatus) `|` `false` +- result: [`Web3SyncStatus`](#type-web3syncstatus) `|` `false` Returns an object with data about the sync status or false. @@ -1634,8 +1634,8 @@ Or when not syncing #### Method `eth_getLogs` - `eth_getLogs(filter)` - - `filter`: [`Web3Filter`](#type-Web3Filter) -- result: `Arrary`[`Web3Log`](#type-Web3Log) + - `filter`: [`Web3Filter`](#type-web3filter) +- result: `Arrary`[`Web3Log`](#type-web3log) Returns an array of all logs matching a given filter object. @@ -1650,7 +1650,7 @@ Returns an array of all logs matching a given filter object. ##### Returns -- Object An object with web3 log data. See [`Web3Log`](#type-Web3Log). +- Object An object with web3 log data. See [`Web3Log`](#type-web3log). ##### Examples @@ -1704,7 +1704,7 @@ Response #### Method `web3_clientVersion` - `web3_clientVersion()` -- result: [`String`](#type-String) +- result: [`String`](#type-string) Returns the current client version. @@ -1742,7 +1742,7 @@ Response #### Method `eth_accounts` - `eth_accounts()` -- result: `Array<`[`Hex`](#type-Hex)`>` +- result: `Array<`[`Hex`](#type-hex)`>` Returns a list of addresses owned by client. @@ -1780,8 +1780,8 @@ Response #### Method `web3_sha3` - `web3_sha3(data)` - - `data`: [`Hex`](#type-Hex) -- result: [`Hash`](#type-Hash) + - `data`: [`Hex`](#type-hex) +- result: [`Hash`](#type-hash) Returns Keccak-256 (not the standardized SHA3-256) of the given data. @@ -1820,10 +1820,10 @@ Response #### Method `eth_getStorageAt` - `eth_getStorageAt(address,position,number)` - - `address`: [`H160`](#type-H160) - - `position`: [`U256`](#type-U256) - - `number`: [`BlockId`](#type-BlockId) -- result: [`Hex`](#type-Hex) + - `address`: [`H160`](#type-h160) + - `position`: [`U256`](#type-u256) + - `number`: [`BlockId`](#type-blockid) +- result: [`Hex`](#type-hex) Returns the value from a storage position at a given address. @@ -1868,7 +1868,7 @@ Response #### Method `eth_coinbase` - `eth_coinbase()` -- result: [`H160`](#type-H160) +- result: [`H160`](#type-h160) Returns the client coinbase address. @@ -1908,7 +1908,7 @@ Response #### Method `eth_hashrate` - `eth_hashrate()` -- result: [`U256`](#type-U256) +- result: [`U256`](#type-u256) Returns the number of hashes per second that the node is mining with. @@ -2065,25 +2065,25 @@ The Web3Filter objects. `Web3Filter` is a JSON object with the following fields. -- `from_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] +- `from_block`: [`BlockId`](#type-blockid) - [optional, default is "latest"] hexadecimal block number, or the string "latest", "earliest" or "pending" -- `to_block`: [`BlockId`](#type-BlockId) - [optional, default is "latest"] +- `to_block`: [`BlockId`](#type-blockid) - [optional, default is "latest"] hexadecimal block number, or the string "latest", "earliest" or "pending" -- `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. +- `block_hash`: [`H256`](#type-h256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. UsingblockHash is equivalent to. -- `address`: [`H256`](#type-H256) - [optional] - a string representing the address (20 bytes) to check for balance +- `address`: [`H256`](#type-h256) - [optional] - a string representing the address (20 bytes) to check for balance null when its pending. null when its pending log. -- `topics`: `Array<`[`Hash`](#type-Hash)`>` - [optional] - Array of 32 Bytes DATA topics. +- `topics`: `Array<`[`Hash`](#type-hash)`>` - [optional] - Array of 32 Bytes DATA topics. Topics are order-dependent. @@ -2095,31 +2095,31 @@ The Web3Log log objects. `Web3Log` is a JSON object with the following fields. -- `address`: [`H160`](#type-H160) - Hex encoded 20 Bytes - address from which this log originated. +- `address`: [`H160`](#type-h160) - Hex encoded 20 Bytes - address from which this log originated. -- `topics`: `Array<`[`H256`](#type-H256)`>` - Array of 0 to 4 32 Bytes of indexed log arguments. +- `topics`: `Array<`[`H256`](#type-h256)`>` - Array of 0 to 4 32 Bytes of indexed log arguments. In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declared the event with the anonymous specifier. -- `data`: [`Hex`](#type-Hex) - contains one or more 32 Bytes non-indexed arguments of the log. +- `data`: [`Hex`](#type-hex) - contains one or more 32 Bytes non-indexed arguments of the log. -- `block_hash`: [`H256`](#type-H256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. +- `block_hash`: [`H256`](#type-h256) - [optional] With the addition of EIP-234, blockHash restricts the logs returned to the single block with the 32-byte hash blockHash. UsingblockHash is equivalent to. -- `block_number`: [`U256`](#type-U256) - the block number where this log was in. +- `block_number`: [`U256`](#type-u256) - the block number where this log was in. null when its pending. null when its pending log. -- `transaction_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes, hash of the transactions this log was created from. null when its pending log.. +- `transaction_hash`: [`H256`](#type-h256) - Hex encoded 32 Bytes, hash of the transactions this log was created from. null when its pending log.. -- `transaction_index`: [`U256`](#type-U256) - hexadecimal of the transactions index position log was created from. +- `transaction_index`: [`U256`](#type-u256) - hexadecimal of the transactions index position log was created from. null when its pending log. -- `log_index`: [`U256`](#type-U256) - hexadecimal of the log index position in the block. +- `log_index`: [`U256`](#type-u256) - hexadecimal of the log index position in the block. null when its pending log. @@ -2133,11 +2133,11 @@ The Web3SyncStatus objects. `Web3SyncStatus` is a JSON object with the following fields. -- `starting_block`: [`U256`](#type-U256) - QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) +- `starting_block`: [`U256`](#type-u256) - QUANTITY - The block at which the import started (will only be reset, after the sync reached his head) -- `current_block`: [`U256`](#type-U256) - QUANTITY - The current block, same as eth_blockNumber. +- `current_block`: [`U256`](#type-u256) - QUANTITY - The current block, same as eth_blockNumber. -- `highest_block`: [`U256`](#type-U256) -QUANTITY - The estimated highest block. +- `highest_block`: [`U256`](#type-u256) -QUANTITY - The estimated highest block. ### Type `Web3CallRequest` @@ -2147,31 +2147,31 @@ The Web3CallRequest objects. `Web3CallRequest` is a JSON object with the following fields. -- `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. +- `transaction_type`: [`U64`](#type-u64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. -- `from`:[`H160`](#type-H256) - Hex encoded 20 Bytes - The address the transaction is sent from. +- `from`:[`H160`](#type-h256) - Hex encoded 20 Bytes - The address the transaction is sent from. -- `to`: [`H160`](#type-H160) - Hex encoded 20 Bytes - The address the transaction is directed to. +- `to`: [`H160`](#type-h160) - Hex encoded 20 Bytes - The address the transaction is directed to. -- `gas_price`: [`U256`](#type-U256) - [optional] hexadecimal value of the gasPrice used for each paid gas. +- `gas_price`: [`U256`](#type-u256) - [optional] hexadecimal value of the gasPrice used for each paid gas. -- `max_fee_per_gas`: [`U256`](#type-U256) - [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. +- `max_fee_per_gas`: [`U256`](#type-u256) - [optional] Maximum total fee (base fee + priority fee), in Wei, the sender is willing to pay per gas. -- `gas`: [`U256`](#type-U256) - [optional] hexadecimal value of the gas provided for the transaction execution. +- `gas`: [`U256`](#type-u256) - [optional] hexadecimal value of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. -- `value`: [`U256`](#type-U256) - [optional] hexadecimal value of the value sent with this transaction. +- `value`: [`U256`](#type-u256) - [optional] hexadecimal value of the value sent with this transaction. -- `data`: [`Hex`](#type-Hex) - [optional] Hash of the method signature and encoded parameters. +- `data`: [`Hex`](#type-hex) - [optional] Hash of the method signature and encoded parameters. -- `nonce`: [`U256`](#type-U256) - Nonce is a sequence number, issued by the originating externally owned account, used to prevent message replay. +- `nonce`: [`U256`](#type-u256) - Nonce is a sequence number, issued by the originating externally owned account, used to prevent message replay. -- `access_list`: `Array<` [`AccessList`](#type-AccessList)`>` - The accessList specifies a list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. +- `access_list`: `Array<` [`AccessList`](#type-accesslist)`>` - The accessList specifies a list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. -- `chain_id`: [`U64`](#type-U64) - QUANTITY - The id of the chain. +- `chain_id`: [`U64`](#type-u64) - QUANTITY - The id of the chain. -- `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. +- `max_priority_fee_per_gas`: [`U256`](#type-u256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. ### Type `AccessList` @@ -2191,7 +2191,7 @@ The AccessListItem objects. `AccessListItem` is a JSON object with the following fields. -- `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The addresses is added into the accessed_addresses global sets. +- `address`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - The addresses is added into the accessed_addresses global sets. - `storage_keys`: `Arrar<`[`H256`]`>`(#type-H256) - DATA, Hex encoded 32 Bytes - The storage keys is added into the accessed_storage_keys global sets. @@ -2203,49 +2203,49 @@ The BlockView objects. `BlockView` is a JSON object with the following fields. -- `hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block. null when its pending block. +- `hash`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - hash of the block. null when its pending block. -- `parent_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the parent block. +- `parent_hash`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - hash of the parent block. -- `sha3_uncles`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - SHA3 of the uncles data in the block. +- `sha3_uncles`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - SHA3 of the uncles data in the block. -- `author`: [`H169`](#type-H160) - Hex encoded 20 Bytes - the creator of the block. +- `author`: [`H169`](#type-h160) - Hex encoded 20 Bytes - the creator of the block. -- `miner`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - the address of the beneficiary to whom the mining rewards were given. +- `miner`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - the address of the beneficiary to whom the mining rewards were given. -- `state_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the final state trie of the block. +- `state_root`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - the root of the final state trie of the block. -- `transactions_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the transaction trie of the block. +- `transactions_root`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - the root of the transaction trie of the block. -- `receipts_root`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - the root of the receipts trie of the block. +- `receipts_root`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - the root of the receipts trie of the block. -- `number`: [`U256`](#type-U256) - QUANTITY - the block number. null when its pending block. +- `number`: [`U256`](#type-u256) - QUANTITY - the block number. null when its pending block. -- `gas_used`: [`U256`](#type-U256) - QUANTITY - the total used gas by all transactions in this block. +- `gas_used`: [`U256`](#type-u256) - QUANTITY - the total used gas by all transactions in this block. -- `gas_limit`: [`U256`](#type-U256) - QUANTITY - the maximum gas allowed in this block. +- `gas_limit`: [`U256`](#type-u256) - QUANTITY - the maximum gas allowed in this block. -- `extra_data`: [`Hex`](#type-Hex) - DATA - the "extra data" field of this block. +- `extra_data`: [`Hex`](#type-hex) - DATA - the "extra data" field of this block. - `logs_bloom`: [`Boolom`](#type-Boolom) - DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block. -- `timestamp`: [`U256`](#type-U256) - QUANTITY - the unix timestamp for when the block was collated. +- `timestamp`: [`U256`](#type-u256) - QUANTITY - the unix timestamp for when the block was collated. -- `difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the difficulty for this block. +- `difficulty`: [`U256`](#type-u256) - QUANTITY - integer of the difficulty for this block. -- `total_difficulty`: [`U256`](#type-U256) - QUANTITY - integer of the total difficulty of the chain until this block. +- `total_difficulty`: [`U256`](#type-u256) - QUANTITY - integer of the total difficulty of the chain until this block. -- `base_fee_per_gas`: [`U256`](#type-U256) - he minimum fee per gas required for a transaction to be included in the block. +- `base_fee_per_gas`: [`U256`](#type-u256) - he minimum fee per gas required for a transaction to be included in the block. -- `uncles`: `Array<`[`U256`](#type-U256)`>` - Array - Array of uncle hashes. +- `uncles`: `Array<`[`U256`](#type-u256)`>` - Array - Array of uncle hashes. - `transactions`:`Array<`[`RichTransactionOrHash`](#type-RichTransactionOrHash)`>` - The transactions in the block body. -- `size`: [`U256`](#type-U256) - QUANTITY - integer the size of this block in bytes. +- `size`: [`U256`](#type-u256) - QUANTITY - integer the size of this block in bytes. -- `mix_hash`: [`H256`](#type-H256) - Hex encoded 32 Bytes - a unique identifier for that block. +- `mix_hash`: [`H256`](#type-h256) - Hex encoded 32 Bytes - a unique identifier for that block. -- `nonce`: [`U256`](#type-U256) - DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block. +- `nonce`: [`U256`](#type-u256) - DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block. ### Type `Web3FeeHistory` @@ -2255,14 +2255,14 @@ The Web3FeeHistory objects. `Web3FeeHistory` is a JSON object with the following fields. -- `oldest_block`: [`U256`](#type-U256) - Lowest number block of the returned range. +- `oldest_block`: [`U256`](#type-u256) - Lowest number block of the returned range. -- `reward`: `Arrary<`[`U256`](#type-U256)`>` - (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. +- `reward`: `Arrary<`[`U256`](#type-u256)`>` - (Optional) An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty. -- `base_fee_per_gas`: `Arrary<`[`U256`](#type-U256)`>` - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. +- `base_fee_per_gas`: `Arrary<`[`U256`](#type-u256)`>` - An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks. -- `gas_used_ratio`: `Arrary<`[`U256`](#type-U256)`>` - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. +- `gas_used_ratio`: `Arrary<`[`U256`](#type-u256)`>` - An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. ### Type `Web3Receipt` @@ -2272,35 +2272,35 @@ The Web3Receipt objects. `Web3Receipt` is a JSON object with the following fields. -- `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. +- `block_number`: [`U256`](#type-u256) - QUANTITY - block number where this transaction was in. -- `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. +- `block_hash`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. -- `contract_address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. +- `contract_address`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. -- `cumulative_gas_used`: [`U256`](#type-U256) - QUANTITY - The total amount of gas used when this transaction was executed in the block. +- `cumulative_gas_used`: [`U256`](#type-u256) - QUANTITY - The total amount of gas used when this transaction was executed in the block. -- `effective_gas_price`: [`U256`](#type-U256) - QUANTITY - the price per gas at the time of your transaction, so the total gas cost of your transaction is effectiveGasPrice \* gasUsed +- `effective_gas_price`: [`U256`](#type-u256) - QUANTITY - the price per gas at the time of your transaction, so the total gas cost of your transaction is effectiveGasPrice \* gasUsed -- `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. +- `from`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - address of the sender. -- `gas_used`: [`U256`](#type-U256) - QUANTITY - The amount of gas used by this specific transaction alone. +- `gas_used`: [`U256`](#type-u256) - QUANTITY - The amount of gas used by this specific transaction alone. -- `logs`: `Arrary<`[`Web3ReceiptLog`](#type-Web3ReceiptLog)`>` - Array - Array of log objects, which this transaction generated. +- `logs`: `Arrary<`[`Web3ReceiptLog`](#type-web3receiptlog)`>` - Array - Array of log objects, which this transaction generated. -- `logs_bloom`: [`Bloom`](#type-Bloom) - DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. +- `logs_bloom`: [`Bloom`](#type-bloom) - DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs. -- `state_root`: [`Hash`](#type-Hash) - DATA 32 bytes of post-transaction stateroot (pre Byzantium) +- `state_root`: [`Hash`](#type-hash) - DATA 32 bytes of post-transaction stateroot (pre Byzantium) -- `status`: [`U256`](#type-U256) - QUANTITY either 1 (success) or 0 (failure) +- `status`: [`U256`](#type-u256) - QUANTITY either 1 (success) or 0 (failure) -- `to`: [`H160`](#type-H160)- DATA, Hex encoded 20 Bytes - address of the receiver. null when its a contract creation transaction. +- `to`: [`H160`](#type-h160)- DATA, Hex encoded 20 Bytes - address of the receiver. null when its a contract creation transaction. -- `transaction_hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. +- `transaction_hash`: [`Hash`](#type-hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. -- `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position in the block. +- `transaction_index`: [`U256`](#type-u256) - QUANTITY - integer of the transactions index position in the block. -- `transaction_type`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. +- `transaction_type`: [`U64`](#type-u64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. ### Type `Web3ReceiptLog` @@ -2310,23 +2310,23 @@ The Web3ReceiptLog objects. `Web3ReceiptLog` is a JSON object with the following fields. -- `address`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address from which this log originated. +- `address`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - address from which this log originated. -- `topics`: `Arrary<`[`H256`](#type-H256)`>` - rray of DATA - Array of 0 to 4 Hex encode 32 Bytes DATA of indexed log arguments. +- `topics`: `Arrary<`[`H256`](#type-h256)`>` - rray of DATA - Array of 0 to 4 Hex encode 32 Bytes DATA of indexed log arguments. - In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address,bytes32,uint256)), except you declare the event with the anonymous specifier. -- `data`: [`Hex`](#type-Hex)`>` - DATA - contains one or more 32 Bytes non-indexed arguments of the log. +- `data`: [`Hex`](#type-hex)`>` - DATA - contains one or more 32 Bytes non-indexed arguments of the log. -- `block_number`: [`U256`](#type-U256) - QUANTITY - the block number where this log was in. null when its pending. null when its pending log. +- `block_number`: [`U256`](#type-u256) - QUANTITY - the block number where this log was in. null when its pending. null when its pending log. -- `block_hash`: [`Hash`](#type-Hash) - DATA, Hex encode 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log. +- `block_hash`: [`Hash`](#type-hash) - DATA, Hex encode 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log. -- `transaction_hash`: [`Hash`](#type-Hash)`>` - DATA, Hex encoded 32 Bytes - hash of the transactions this log was created from. null when its pending log. +- `transaction_hash`: [`Hash`](#type-hash)`>` - DATA, Hex encoded 32 Bytes - hash of the transactions this log was created from. null when its pending log. -- `transaction_index`: [`U256`](#type-U256) - QUANTITY - integer of the transactions index position log was created from. null when its pending log. +- `transaction_index`: [`U256`](#type-u256) - QUANTITY - integer of the transactions index position log was created from. null when its pending log. -- `log_index`: [`U256`](#type-U256)`>` - QUANTITY - integer of the log index position in the block. null when its pending log. +- `log_index`: [`U256`](#type-u256)`>` - QUANTITY - integer of the log index position in the block. null when its pending log. - `removed`: [`bool`](#type-bool) - TAG - true when the log was removed, due to a chain reorganization. false if its a valid log. @@ -2442,45 +2442,45 @@ The TransactionView objects. `TransactionView` is a JSON object with the following fields. -- `type_`: [`U64`](#type-U64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. +- `type_`: [`U64`](#type-u64) - 64-bit integer that represents the type of the transaction. Axon has evolved to support 3 types of transactions: Legacy is 0x0, Eip2930 is 0x1 and Eip1559 is 0x2. -- `block_number`: [`U256`](#type-U256) - QUANTITY - block number where this transaction was in. null when it's pending. +- `block_number`: [`U256`](#type-u256) - QUANTITY - block number where this transaction was in. null when it's pending. -- `block_hash`: [`H256`](#type-H256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. null when its pending. +- `block_hash`: [`H256`](#type-h256) - DATA, Hex encoded 32 Bytes - hash of the block where this transaction was in. null when its pending. -- `hash`: [`Hash`](#type-Hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. +- `hash`: [`Hash`](#type-hash) - DATA, Hex encoded 32 Bytes - hash of the transaction. -- `nonce`: [`U256`](#type-U256) - QUANTITY - the number of transactions made by the sender prior to this one. +- `nonce`: [`U256`](#type-u256) - QUANTITY - the number of transactions made by the sender prior to this one. -- `from`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the sender. +- `from`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - address of the sender. -- `to`: [`H160`](#type-H160) - DATA, Hex encoded 20 Bytes - address of the receiver. null when it's a contract creation transaction. +- `to`: [`H160`](#type-h160) - DATA, Hex encoded 20 Bytes - address of the receiver. null when it's a contract creation transaction. -- `value`: [`U256`](#type-U256) - QUANTITY - value transferred in Wei. +- `value`: [`U256`](#type-u256) - QUANTITY - value transferred in Wei. -- `gas`: [`U256`](#type-U256) - QUANTITY - gas provided by the sender. +- `gas`: [`U256`](#type-u256) - QUANTITY - gas provided by the sender. -- `gas_price`: [`U256`](#type-U256) - QUANTITY - gas price provided by the sender in Wei. +- `gas_price`: [`U256`](#type-u256) - QUANTITY - gas price provided by the sender in Wei. -- `max_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - the absolute maximum you are willing to pay per unit of gas to get your transaction included in a block. For brevity and clarity, we will refer to this as the Max Fee. +- `max_fee_per_gas`: [`U256`](#type-u256) - QUANTITY - the absolute maximum you are willing to pay per unit of gas to get your transaction included in a block. For brevity and clarity, we will refer to this as the Max Fee. -- `max_priority_fee_per_gas`: [`U256`](#type-U256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. +- `max_priority_fee_per_gas`: [`U256`](#type-u256) - QUANTITY - (optional) determined by the user, and is paid directly to miners. -- `raw`: [`Hex`](#type-Hex) - The raw is the signed transaction in Recursive Length Prefix (RLP) encoded form +- `raw`: [`Hex`](#type-hex) - The raw is the signed transaction in Recursive Length Prefix (RLP) encoded form -- `input`: [`Hex`](#type-Hex) - DATA - The input of the transaction. +- `input`: [`Hex`](#type-hex) - DATA - The input of the transaction. - `public_key`: [`Input`](#type-Input) - The public key of the transaction sender. -- `access_list`: [`AccessList`](#type-AccessList) - A list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. +- `access_list`: [`AccessList`](#type-accesslist) - A list of addresses and storage keys; these addresses and storage keys are added into the accessed_addresses and accessed_storage_keys global sets. -- `chain_id`: [`U256`](#type-U256) - QUANTITY - The id of the chain. +- `chain_id`: [`U256`](#type-u256) - QUANTITY - The id of the chain. -- `v`: [`U256`](#type-U256) - QUANTITY - ECDSA recovery id. +- `v`: [`U256`](#type-u256) - QUANTITY - ECDSA recovery id. -- `r`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature r. +- `r`: [`U256`](#type-u256) - DATA, 32 Bytes - ECDSA signature r. -- `s`: [`U256`](#type-U256) - DATA, 32 Bytes - ECDSA signature s. +- `s`: [`U256`](#type-u256) - DATA, 32 Bytes - ECDSA signature s. ##### Examples diff --git a/core/cli/README.md b/core/cli/README.md index ef8a591d5..a4c9f6dde 100644 --- a/core/cli/README.md +++ b/core/cli/README.md @@ -31,10 +31,10 @@ $ cargo run -- -n 1 -p path-to-save-private-keys The arguments are described in the following table: -| name | short | default value | -|--|--|--| -| number | n | 4 | -| private-key-path | p | current_path/free-space/ | +| name | short | default value | +|------------------|-------|--------------------------| +| number | n | 4 | +| private-key-path | p | current_path/free-space/ | ### Update Config and Spec File @@ -68,10 +68,10 @@ If you forget your public key and peer id, you can recover them from the private The arguments are described in the following table: -| name | short | default value | -|--|--|--| -| net-path | n | - | -| bls-path | b | - | +| name | short | default value | +|----------|-------|---------------| +| net-path | n | - | +| bls-path | b | - | ### Init Chain @@ -82,10 +82,10 @@ After the config and spec file are updated, you can initialize the chain with th ``` The console will print the execution result of genesis block. The arguments are described in the following table: -| name | short | default value | -|--|--|--| -| config | c | - | -| chain-spec | s | - | +| name | short | default value | +|------------|-------|---------------| +| config | c | - | +| chain-spec | s | - | ### Run Node @@ -97,6 +97,6 @@ Finally, you can run the node with the following command: The arguments are described in the following table: -| name | short | default value | -|--|--|--| -| config | c | - | +| name | short | default value | +|--------|-------|---------------| +| config | c | - | diff --git a/devtools/axon-tools/src/tests/block.json b/devtools/axon-tools/src/tests/block.json index 7016d9702..aa2f97493 100644 --- a/devtools/axon-tools/src/tests/block.json +++ b/devtools/axon-tools/src/tests/block.json @@ -1,30 +1,30 @@ { - "header": { - "version": "V0", - "prev_hash": "0xa5643d9a0983004a662c154d6b2ae2a9aa10566b21333467400c5dcb6558bb38", - "proposer": "0x8af204ac5d7cb8815a6c53a50b72d01e729d3b22", - "state_root": "0x3e7e13a5fdd338fc7254d52745136dde2bbeb82718713415be596dc635274bbe", - "transactions_root": "0x93ac653e9457b39685218933d81145df1b4fd06a9b2e6be0217cad4a608ad6fb", - "signed_txs_hash": "0x2077d36822b7bd8f570d99355c62c8c04d4bf8bcfcb3bfdd5c90be783b713983", - "receipts_root": "0x08c61b0c680f18a1f33a8bce9b09d0fffee3a595cd5c95519fa21e80894d87e9", - "log_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000", - "timestamp": "0x6538e7e0", - "number": "0xe7c3", - "gas_used": "0x2a3d5", - "gas_limit": "0x1c9c380", - "extra_data": [], - "base_fee_per_gas": "0x539", - "proof": { - "number": "0xe7c2", - "round": "0x0", - "proposal_hash": "0x734f6e28a7caf9df326c21d8c57b89034ed02f782a11d04d18284b7aa4de43f0", - "signature": "0x933be0cd674477473bd68a55a53511a652fbcecfa4cafaa244d0b55ca3f6a7f296d50a2744337365fd6407d737cc389f054b70b3c82ee27a1669a43cc344ba7ad42a7cc663faa63190a739dc1c6a1a5d80d45f5903f42d118fc5e4d695cc4815", - "bitmap": "0xb0" - }, - "call_system_script_count": "0x0", - "chain_id": "0x41786f6e" + "header": { + "version": "V0", + "prev_hash": "0xa5643d9a0983004a662c154d6b2ae2a9aa10566b21333467400c5dcb6558bb38", + "proposer": "0x8af204ac5d7cb8815a6c53a50b72d01e729d3b22", + "state_root": "0x3e7e13a5fdd338fc7254d52745136dde2bbeb82718713415be596dc635274bbe", + "transactions_root": "0x93ac653e9457b39685218933d81145df1b4fd06a9b2e6be0217cad4a608ad6fb", + "signed_txs_hash": "0x2077d36822b7bd8f570d99355c62c8c04d4bf8bcfcb3bfdd5c90be783b713983", + "receipts_root": "0x08c61b0c680f18a1f33a8bce9b09d0fffee3a595cd5c95519fa21e80894d87e9", + "log_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000", + "timestamp": "0x6538e7e0", + "number": "0xe7c3", + "gas_used": "0x2a3d5", + "gas_limit": "0x1c9c380", + "extra_data": [], + "base_fee_per_gas": "0x539", + "proof": { + "number": "0xe7c2", + "round": "0x0", + "proposal_hash": "0x734f6e28a7caf9df326c21d8c57b89034ed02f782a11d04d18284b7aa4de43f0", + "signature": "0x933be0cd674477473bd68a55a53511a652fbcecfa4cafaa244d0b55ca3f6a7f296d50a2744337365fd6407d737cc389f054b70b3c82ee27a1669a43cc344ba7ad42a7cc663faa63190a739dc1c6a1a5d80d45f5903f42d118fc5e4d695cc4815", + "bitmap": "0xb0" }, - "tx_hashes": [ - "0x6917d8ef5fbac4fab865a872cd4ed2ca9fd0c514491d7b148530392fa9d656c8" - ] + "call_system_script_count": "0x0", + "chain_id": "0x41786f6e" + }, + "tx_hashes": [ + "0x6917d8ef5fbac4fab865a872cd4ed2ca9fd0c514491d7b148530392fa9d656c8" + ] } diff --git a/devtools/axon-tools/src/tests/metadata.json b/devtools/axon-tools/src/tests/metadata.json index ef3caaa85..78d901cee 100644 --- a/devtools/axon-tools/src/tests/metadata.json +++ b/devtools/axon-tools/src/tests/metadata.json @@ -1,54 +1,54 @@ { - "version": { - "start": "0x0", - "end": "0x3b9aca00" + "version": { + "start": "0x0", + "end": "0x3b9aca00" + }, + "epoch": "0x0", + "verifier_list": [ + { + "bls_pub_key": "0x98eef09a3927acb225191101a1d9aa85775fdcdc87b9ba36898f6c132b485d66aef91c0f51cda331be4f985c3be6761c", + "pub_key": "0x0232c489c23b1207107e9a24648c1e4754a8c1c0b38db96df57a526201035058cb", + "address": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", + "propose_weight": "0x1", + "vote_weight": "0x1" }, - "epoch": "0x0", - "verifier_list": [ - { - "bls_pub_key": "0x98eef09a3927acb225191101a1d9aa85775fdcdc87b9ba36898f6c132b485d66aef91c0f51cda331be4f985c3be6761c", - "pub_key": "0x0232c489c23b1207107e9a24648c1e4754a8c1c0b38db96df57a526201035058cb", - "address": "0xf4cc1652dcec2e5de9ce6fb1b6f9fa9456e957f1", - "propose_weight": "0x1", - "vote_weight": "0x1" - }, - { - "bls_pub_key": "0xa26e3fe1cf51bd4822072c61bdc315ac32e3d3c2e2484bb92942666399e863b4bf56cf2926383cc706ffc15dfebc85c6", - "pub_key": "0x031ddc35212b7fc7ff6685b17d91f77c972535aee5c7ae5684d3e72b986f08834b", - "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", - "propose_weight": "0x1", - "vote_weight": "0x1" - }, - { - "bls_pub_key": "0x80310fa9df724b5603d283b472ed3bf85254a8a4ceda8a274b421f6cf2be1d9184267cdfe9a199d36ff14e57668a55d0", - "pub_key": "0x02b77c74eb68af3d4d6cc7884ed6709f1a2a1af0f713382a4438ec2ea3a70d4d7f", - "address": "0xf386573563c3a75dbbd269fce9782620826ddac2", - "propose_weight": "0x1", - "vote_weight": "0x1" - }, - { - "bls_pub_key": "0x897721e9016864141a8b982a48217f66ef318ce598aa31842cddaaebe3cd7feab17050022afa6c2123aba39938fe4142", - "pub_key": "0x027ffd6a6a231561f2afe5878b1c743323b34263d16787130b1815fe35649b0bf5", - "address": "0x8af204ac5d7cb8815a6c53a50b72d01e729d3b22", - "propose_weight": "0x1", - "vote_weight": "0x1" - } - ], - "propose_counter": [ - { - "address": "0x0000000000000000000000000000000000000000", - "count": "0x0" - } - ], - "consensus_config": { - "gas_limit": "0xffffffff", - "gas_price": "0x1", - "interval": "0xbb8", - "propose_ratio": "0xf", - "prevote_ratio": "0xa", - "precommit_ratio": "0xa", - "brake_ratio": "0xa", - "tx_num_limit": "0x4e20", - "max_tx_size": "0x400" + { + "bls_pub_key": "0xa26e3fe1cf51bd4822072c61bdc315ac32e3d3c2e2484bb92942666399e863b4bf56cf2926383cc706ffc15dfebc85c6", + "pub_key": "0x031ddc35212b7fc7ff6685b17d91f77c972535aee5c7ae5684d3e72b986f08834b", + "address": "0x8ab0cf264df99d83525e9e11c7e4db01558ae1b1", + "propose_weight": "0x1", + "vote_weight": "0x1" + }, + { + "bls_pub_key": "0x80310fa9df724b5603d283b472ed3bf85254a8a4ceda8a274b421f6cf2be1d9184267cdfe9a199d36ff14e57668a55d0", + "pub_key": "0x02b77c74eb68af3d4d6cc7884ed6709f1a2a1af0f713382a4438ec2ea3a70d4d7f", + "address": "0xf386573563c3a75dbbd269fce9782620826ddac2", + "propose_weight": "0x1", + "vote_weight": "0x1" + }, + { + "bls_pub_key": "0x897721e9016864141a8b982a48217f66ef318ce598aa31842cddaaebe3cd7feab17050022afa6c2123aba39938fe4142", + "pub_key": "0x027ffd6a6a231561f2afe5878b1c743323b34263d16787130b1815fe35649b0bf5", + "address": "0x8af204ac5d7cb8815a6c53a50b72d01e729d3b22", + "propose_weight": "0x1", + "vote_weight": "0x1" + } + ], + "propose_counter": [ + { + "address": "0x0000000000000000000000000000000000000000", + "count": "0x0" } + ], + "consensus_config": { + "gas_limit": "0xffffffff", + "gas_price": "0x1", + "interval": "0xbb8", + "propose_ratio": "0xf", + "prevote_ratio": "0xa", + "precommit_ratio": "0xa", + "brake_ratio": "0xa", + "tx_num_limit": "0x4e20", + "max_tx_size": "0x400" + } } diff --git a/devtools/chain/blockscan-explorer.env b/devtools/chain/blockscan-explorer.env index 525fa44d5..c0e4a68fd 100644 --- a/devtools/chain/blockscan-explorer.env +++ b/devtools/chain/blockscan-explorer.env @@ -10,107 +10,104 @@ DATABASE_URL=postgresql://blockscan:b%rnGL8ps@explorer-db:5432/blockscan?ssl=false - -NETWORK=Axon -SUBNETWORK=AxonChain ETHEREUM_JSONRPC_HTTP_URL=http://axon:8000 ETHEREUM_JSONRPC_TRACE_URL=http://axon:8000 ETHEREUM_JSONRPC_TRANSPORT=http +NETWORK=Axon +SUBNETWORK=AxonChain # ETHEREUM_JSONRPC_WS_URL= - # TODO: update Axon's logo LOGO=/images/blockscout_logo.svg LOGO_FOOTER=/images/blockscout_logo.svg - -# TODO: Simplify the configs, maybe we could get rid of the default configs from here? -# cc @Simon-Tl -IPC_PATH= -NETWORK_PATH=/ +ALLOWED_EVM_VERSIONS=homestead,tangerineWhistle,spuriousDragon,byzantium,constantinople,petersburg,istanbul,berlin,london,default API_PATH=/ -SOCKET_ROOT=/ BLOCKSCOUT_HOST= BLOCKSCOUT_PROTOCOL= -PORT=4020 -EMISSION_FORMAT=DEFAULT -POOL_SIZE=40 -POOL_SIZE_API=10 -ECTO_USE_SSL=false -HEART_BEAT_TIMEOUT=30 BLOCKSCOUT_VERSION= -RELEASE_LINK= BLOCK_TRANSFORMER=axon -LINK_TO_OTHER_EXPLORERS=false -OTHER_EXPLORERS={} -SUPPORTED_CHAINS={} -CACHE_BLOCK_COUNT_PERIOD=7200 -CACHE_TXS_COUNT_PERIOD=7200 CACHE_ADDRESS_COUNT_PERIOD=7200 CACHE_ADDRESS_SUM_PERIOD=3600 -CACHE_TOTAL_GAS_USAGE_PERIOD=3600 +CACHE_ADDRESS_TOKENS_USD_SUM_PERIOD=1800 +CACHE_ADDRESS_TOKEN_TRANSFERS_COUNTER_PERIOD=1800 CACHE_ADDRESS_TRANSACTIONS_GAS_USAGE_COUNTER_PERIOD=1800 -CACHE_TOKEN_HOLDERS_COUNTER_PERIOD=3600 -CACHE_TOKEN_TRANSFERS_COUNTER_PERIOD=3600 +CACHE_ADDRESS_TRANSACTIONS_PERIOD=1800 CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=1800 CACHE_AVERAGE_BLOCK_PERIOD=1800 -CACHE_MARKET_HISTORY_PERIOD=21600 -CACHE_ADDRESS_TRANSACTIONS_PERIOD=1800 -CACHE_ADDRESS_TOKENS_USD_SUM_PERIOD=1800 -CACHE_ADDRESS_TOKEN_TRANSFERS_COUNTER_PERIOD=1800 +CACHE_BLOCK_COUNT_PERIOD=7200 CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL=1800 +CACHE_MARKET_HISTORY_PERIOD=21600 CACHE_TOKEN_EXCHANGE_RATE_PERIOD=1800 -TOKEN_METADATA_UPDATE_INTERVAL=172800 -ALLOWED_EVM_VERSIONS=homestead,tangerineWhistle,spuriousDragon,byzantium,constantinople,petersburg,istanbul,berlin,london,default -UNCLES_IN_AVERAGE_BLOCK_TIME=false -DISABLE_WEBAPP=false +CACHE_TOKEN_HOLDERS_COUNTER_PERIOD=3600 +CACHE_TOKEN_TRANSFERS_COUNTER_PERIOD=3600 +CACHE_TOTAL_GAS_USAGE_PERIOD=3600 +CACHE_TXS_COUNT_PERIOD=7200 DISABLE_READ_API=false +DISABLE_WEBAPP=false DISABLE_WRITE_API=false +ECTO_USE_SSL=false +EMISSION_FORMAT=DEFAULT +HEART_BEAT_TIMEOUT=30 +# TODO: Simplify the configs, maybe we could get rid of the default configs from here? +# cc @Simon-Tl +IPC_PATH= +LINK_TO_OTHER_EXPLORERS=false +NETWORK_PATH=/ +OTHER_EXPLORERS={} +POOL_SIZE=40 +POOL_SIZE_API=10 +PORT=4020 +RELEASE_LINK= +SOCKET_ROOT=/ +SUPPORTED_CHAINS={} +TOKEN_METADATA_UPDATE_INTERVAL=172800 +UNCLES_IN_AVERAGE_BLOCK_TIME=false DISABLE_INDEXER=false -INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=true -INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=true -INDEXER_DISABLE_BLOCK_REWARD_FETCHER=true # Batch size for blocks catchup fetcher, defaults to 10 INDEXER_CATCHUP_BLOCKS_BATCH_SIZE=1 # Concurrency for blocks catchup fetcher, defaults to 10 INDEXER_CATCHUP_BLOCKS_CONCURRENCY=2 +INDEXER_DISABLE_BLOCK_REWARD_FETCHER=true +INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=true +INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=true -WOBSERVER_ENABLED=false -SHOW_ADDRESS_MARKETCAP_PERCENTAGE=true +API_RATE_LIMIT=50 +API_RATE_LIMIT_BY_IP=50 +API_RATE_LIMIT_BY_KEY=50 +API_RATE_LIMIT_STATIC_API_KEY= +API_RATE_LIMIT_WHITELISTED_IPS= +APPS_MENU=true CHECKSUM_ADDRESS_HASHES=true CHECKSUM_FUNCTION=eth +COIN_BALANCE_HISTORY_DAYS=90 +CUSTOM_CONTRACT_ADDRESSES_TEST_TOKEN= +DISABLE_BRIDGE_MARKET_CAP_UPDATER=true DISABLE_EXCHANGE_RATES=true DISABLE_KNOWN_TOKENS=true +DISPLAY_TOKEN_ICONS=false +ENABLE_POS_STAKING_IN_MENU=false +ENABLE_SOURCIFY_INTEGRATION=false ENABLE_TXS_STATS=true -SHOW_PRICE_CHART=false -SHOW_TXS_CHART=true -HISTORY_FETCH_INTERVAL=30 -TXS_HISTORIAN_INIT_LAG=0 -TXS_STATS_DAYS_TO_COMPILE_AT_INIT=10 -COIN_BALANCE_HISTORY_DAYS=90 -APPS_MENU=true EXTERNAL_APPS=[] -DISABLE_BRIDGE_MARKET_CAP_UPDATER=true -ENABLE_POS_STAKING_IN_MENU=false -SHOW_MAINTENANCE_ALERT=false +HIDE_BLOCK_MINER=false +HISTORY_FETCH_INTERVAL=30 MAINTENANCE_ALERT_MESSAGE= -SHOW_STAKING_WARNING=false -STAKING_WARNING_MESSAGE= -CUSTOM_CONTRACT_ADDRESSES_TEST_TOKEN= -ENABLE_SOURCIFY_INTEGRATION=false -SOURCIFY_SERVER_URL= -SOURCIFY_REPO_URL= MAX_SIZE_UNLESS_HIDE_ARRAY=50 -HIDE_BLOCK_MINER=false -DISPLAY_TOKEN_ICONS=false -SHOW_TENDERLY_LINK=false -TENDERLY_CHAIN_PATH= MAX_STRING_LENGTH_WITHOUT_TRIMMING=2040 -RE_CAPTCHA_SECRET_KEY= RE_CAPTCHA_CLIENT_KEY= -API_RATE_LIMIT=50 -API_RATE_LIMIT_BY_KEY=50 -API_RATE_LIMIT_BY_IP=50 -API_RATE_LIMIT_WHITELISTED_IPS= -API_RATE_LIMIT_STATIC_API_KEY= +RE_CAPTCHA_SECRET_KEY= +SHOW_ADDRESS_MARKETCAP_PERCENTAGE=true +SHOW_MAINTENANCE_ALERT=false +SHOW_PRICE_CHART=false +SHOW_STAKING_WARNING=false +SHOW_TENDERLY_LINK=false +SHOW_TXS_CHART=true +SOURCIFY_REPO_URL= +SOURCIFY_SERVER_URL= +STAKING_WARNING_MESSAGE= +TENDERLY_CHAIN_PATH= +TXS_HISTORIAN_INIT_LAG=0 +TXS_STATS_DAYS_TO_COMPILE_AT_INIT=10 +WOBSERVER_ENABLED=false diff --git a/devtools/chain/docker-compose.yml b/devtools/chain/docker-compose.yml index 4dd2089b5..6eba0fc8f 100644 --- a/devtools/chain/docker-compose.yml +++ b/devtools/chain/docker-compose.yml @@ -1,13 +1,13 @@ -version: '3.8' +version: "3.8" services: axon: image: ghcr.io/axonweb3/axon:dev ports: - - 8000:8000 - - 127.0.0.1:8100:8100 + - 8000:8000 + - 127.0.0.1:8100:8100 networks: - - axon-net + - axon-net restart: unless-stopped # https://docs.docker.com/compose/compose-file/05-services/#healthcheck healthcheck: @@ -22,14 +22,14 @@ services: # Dockerfile: https://github.com/Simon-Tl/blockscan/blob/a60dd45ca8577f97683f89c8a372508a84b74e24/docker/Dockerfile#L56 image: ghcr.io/simon-tl/blockscan:latest depends_on: - - axon - - explorer-db + - axon + - explorer-db env_file: - - ./blockscan-explorer.env + - ./blockscan-explorer.env ports: - - 4020:4020 + - 4020:4020 networks: - - axon-net + - axon-net restart: unless-stopped command: sh -c "bin/blockscout eval \"Elixir.Explorer.ReleaseTasks.create_and_migrate()\" && bin/blockscout start" @@ -40,9 +40,9 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-b%rnGL8ps} POSTGRES_USER: ${POSTGRES_USER:-blockscan} expose: - - 5432 + - 5432 networks: - - axon-net + - axon-net restart: unless-stopped command: postgres -c 'max_connections=250' diff --git a/devtools/chain/quick-start.md b/devtools/chain/quick-start.md index bc2e78e2f..3cae247e0 100644 --- a/devtools/chain/quick-start.md +++ b/devtools/chain/quick-start.md @@ -54,11 +54,11 @@ curl --location --request POST 'http://127.0.0.1:8000' \ ``` ### Access [Blockscan](http://127.0.0.1:4020) -To access the Blockscan explorer, open your browser and visit http://127.0.0.1:4020. This will allow you to explore the Axon blockchain using the Blockscan interface. +To access the Blockscan explorer, open your browser and visit . This will allow you to explore the Axon blockchain using the Blockscan interface. ![Blockscan](blockscan-screenshot.png) -## You Are Good to Go! -Congratulations! +## You Are Good to Go +Congratulations! You have successfully set up and run Axon and Blockscan locally in Docker containers. You can now start exploring the Axon blockchain and interacting with the services. Next Steps: [Deploy and Interact with a Solidity Contract](https://docs.axonweb3.io/getting-started/for-dapp-devs/deploy_solidity) diff --git a/devtools/ci/ansible/playbook.yml b/devtools/ci/ansible/playbook.yml index 862dedeeb..11da1586e 100644 --- a/devtools/ci/ansible/playbook.yml +++ b/devtools/ci/ansible/playbook.yml @@ -30,7 +30,6 @@ tags: - build - - name: docker login and push image shell: docker login -u {{ docker_user }} -p {{ docker_password }} && docker push axonweb3/axon:{{ image_tag }} become: yes diff --git a/devtools/ci/build-arm64.sh b/devtools/ci/build-arm64.sh index 372f09705..f0fbb91f6 100755 --- a/devtools/ci/build-arm64.sh +++ b/devtools/ci/build-arm64.sh @@ -6,7 +6,6 @@ # * AWS_SECRET_KEY, required, the AWS secret key # * AWS_EC2_TYPE, optional, default is c6g.xlarge, the AWS EC2 type - set -euo pipefail AWS_ACCESS_KEY=${AWS_ACCESS_KEY} @@ -17,7 +16,10 @@ AWS_EC2_TYPE=${AWS_EC2_TYPE:-"c6g.xlarge"} START_TIME=${START_TIME:-"$(date +%Y-%m-%d' '%H:%M:%S.%6N)"} AXON_TAG=${AXON_TAG} JOB_ID=${JOB_ID:-"build-arm4-$(date +'%Y-%m-%d')-in-10h"} -SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +SCRIPT_PATH="$( + cd -- "$(dirname "$0")" >/dev/null 2>&1 + pwd -P +)" JOB_DIRECTORY="$(dirname "$SCRIPT_PATH")/job/$JOB_ID" ANSIBLE_DIRECTORY=$JOB_DIRECTORY/ansible ANSIBLE_INVENTORY=$JOB_DIRECTORY/ansible/inventory.yml @@ -27,7 +29,7 @@ SSH_PUBLIC_KEY_PATH=$JOB_DIRECTORY/ssh/id.pub function job_setup() { mkdir -p $JOB_DIRECTORY - cp -r "$(dirname "$SCRIPT_PATH")/ci/ansible" $JOB_DIRECTORY/ansible + cp -r "$(dirname "$SCRIPT_PATH")/ci/ansible" $JOB_DIRECTORY/ansible cp -r "$(dirname "$SCRIPT_PATH")/ci/terraform" $JOB_DIRECTORY/terraform ssh_gen_key @@ -86,9 +88,9 @@ function ansible_config() { # Setup Ansible running environment. function ansible_setup() { cd $ANSIBLE_DIRECTORY - echo "image_tag: $AXON_TAG"> $JOB_DIRECTORY/ansible/config.yml - echo "docker_user: $DOCKER_USER">> $JOB_DIRECTORY/ansible/config.yml - echo "docker_password: $DOCKER_PASSWORD">> $JOB_DIRECTORY/ansible/config.yml + echo "image_tag: $AXON_TAG" >$JOB_DIRECTORY/ansible/config.yml + echo "docker_user: $DOCKER_USER" >>$JOB_DIRECTORY/ansible/config.yml + echo "docker_password: $DOCKER_PASSWORD" >>$JOB_DIRECTORY/ansible/config.yml } # Deploy CKB onto target AWS EC2 instances. @@ -101,32 +103,27 @@ function ansible_build_docker_image() { -t build } - - - - - function main() { case $1 in - "run") - job_setup - terraform_apply - ansible_build_docker_image - ;; - "setup") - job_setup - ;; - "terraform") - terraform_apply - ;; - "ansible") - ansible_build_docker_image - ;; - "clean") - terraform_destroy - job_clean - ;; - esac + "run") + job_setup + terraform_apply + ansible_build_docker_image + ;; + "setup") + job_setup + ;; + "terraform") + terraform_apply + ;; + "ansible") + ansible_build_docker_image + ;; + "clean") + terraform_destroy + job_clean + ;; + esac } main $* diff --git a/devtools/ci/terraform/ami.tf b/devtools/ci/terraform/ami.tf index d0ef50114..bf5feddf3 100644 --- a/devtools/ci/terraform/ami.tf +++ b/devtools/ci/terraform/ami.tf @@ -2,12 +2,12 @@ data "aws_ami" "amazon2" { most_recent = true filter { - name = "name" + name = "name" values = ["amzn2-ami-*-hvm-*-arm64-gp2"] } filter { - name = "architecture" + name = "architecture" values = ["arm64"] } diff --git a/devtools/ci/terraform/main.tf b/devtools/ci/terraform/main.tf index e4201130f..c7b0526c4 100644 --- a/devtools/ci/terraform/main.tf +++ b/devtools/ci/terraform/main.tf @@ -44,7 +44,7 @@ resource "aws_security_group" "sg_default" { description = "Allow inbound access from anywhere and outbound access to all" vpc_id = aws_vpc.vpc.id - ingress { + ingress { description = "ssh" from_port = 22 to_port = 22 @@ -69,7 +69,7 @@ resource "aws_security_group" "sg_default" { resource "aws_instance" "instance" { key_name = aws_key_pair.ssh.id - instance_type = "${var.instance_type}" + instance_type = var.instance_type ami = data.aws_ami.amazon2.id vpc_security_group_ids = [aws_security_group.sg_default.id] private_ip = "${var.private_ip_prefix}.10" @@ -85,7 +85,7 @@ resource "aws_instance" "instance" { private_key = file(var.private_key_path) } tags = { - Name = "${var.prefix}-instance" + Name = "${var.prefix}-instance" } provisioner "remote-exec" { inline = [ diff --git a/devtools/ci/terraform/variables.tf b/devtools/ci/terraform/variables.tf index 62e81e73b..7f1d39949 100644 --- a/devtools/ci/terraform/variables.tf +++ b/devtools/ci/terraform/variables.tf @@ -1,31 +1,31 @@ variable "access_key" { - type = string + type = string description = "AWS access key" } variable "secret_key" { - type = string + type = string description = "AWS secret key" } variable "region" { - type = string - default = "ap-southeast-1" + type = string + default = "ap-southeast-1" description = "AWS region" } variable "public_key_path" { - type = string + type = string description = "local path to ssh public key" } variable "private_key_path" { - type = string + type = string description = "local path to ssh private key" } variable "prefix" { - type = string + type = string description = "prefix attach to resource names" } diff --git a/devtools/docker/health_check.sh b/devtools/docker/health_check.sh index dc9f4abd0..58334bc54 100755 --- a/devtools/docker/health_check.sh +++ b/devtools/docker/health_check.sh @@ -1,8 +1,8 @@ #!/bin/bash block_number() { block=$(curl -s 'http://127.0.0.1:8000' \ - --header 'Content-Type: application/json' \ - --data '{"jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":42}' | jq '.result' |xargs printf %d 0xF) + --header 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0", "method":"eth_blockNumber", "params": [], "id":42}' | jq '.result' | xargs printf %d 0xF) echo $block } @@ -13,16 +13,14 @@ block_stats() { while true; do latest_block=$(block_number) - if [ $current_block -lt $latest_block ] - then + if [ $current_block -lt $latest_block ]; then return 0 fi current_time=$(date +%s) elapsed_seconds=$((current_time - start_time)) - if [ $elapsed_seconds -ge $wait_seconds ] - then - break + if [ $elapsed_seconds -ge $wait_seconds ]; then + break fi sleep 1 @@ -32,5 +30,4 @@ block_stats() { return 1 } - block_stats diff --git a/devtools/metadata-cli/README.md b/devtools/metadata-cli/README.md index 485185118..e251fbd93 100644 --- a/devtools/metadata-cli/README.md +++ b/devtools/metadata-cli/README.md @@ -11,17 +11,17 @@ Usage: From a chain spec file or input file: ```command -$ axon-metadata get-data -i input.example.toml +axon-metadata get-data -i input.example.toml ``` ```command -$ axon-metadata get-data -i chain-spec.toml +axon-metadata get-data -i chain-spec.toml ``` From JSONRPC metadata result: ```command -$ curl 'https://rpc-alphanet-axon.ckbapp.dev/' --header 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"axon_getCurrentMetadata","id":3}' | jq '.result' | axon-metadata get-data -i /dev/stdin +curl 'https://rpc-alphanet-axon.ckbapp.dev/' --header 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"axon_getCurrentMetadata","id":3}' | jq '.result' | axon-metadata get-data -i /dev/stdin ``` ### Deploy the Metadata Cell @@ -35,11 +35,11 @@ Parse `MetadataCellData` to get validators. Usage: ```command -$ axon-metadata parse-data -i data.example.hex +axon-metadata parse-data -i data.example.hex ``` From JSONRPC cell data: ```command -$ curl 'https://testnet.ckbapp.dev/' --header 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"get_live_cell","params":[{"index":"0x0","tx_hash":"0x8a37967294c40da9ede155156bfe87d4b4e644c2b7f3275dd2ec4ebe4d695e24"},true],"id":3}' | jq -r '.result.cell.data.content' | axon-metadata parse-data -i /dev/stdin +curl 'https://testnet.ckbapp.dev/' --header 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"get_live_cell","params":[{"index":"0x0","tx_hash":"0x8a37967294c40da9ede155156bfe87d4b4e644c2b7f3275dd2ec4ebe4d695e24"},true],"id":3}' | jq -r '.result.cell.data.content' | axon-metadata parse-data -i /dev/stdin ``` diff --git a/tests/e2e/.eslintrc.js b/tests/e2e/.eslintrc.js index bf9f589b1..f09b6c6d9 100644 --- a/tests/e2e/.eslintrc.js +++ b/tests/e2e/.eslintrc.js @@ -3,34 +3,34 @@ module.exports = { node: true, es2022: true, jest: true, - browser: true, + browser: true }, globals: { - browser: "writable", - metamask: "writable", - page: "writable", + browser: 'writable', + metamask: 'writable', + page: 'writable' }, - extends: ["eslint:recommended", "airbnb-base", "plugin:sonarjs/recommended"], - plugins: ["sonarjs"], + extends: ['eslint:recommended', 'airbnb-base', 'plugin:sonarjs/recommended'], + plugins: ['sonarjs'], parserOptions: { - sourceType: "module", + sourceType: 'module' }, rules: { indent: [ - "error", - 2, + 'error', + 2 ], - "linebreak-style": [ - "error", - "unix", + 'linebreak-style': [ + 'error', + 'unix' ], quotes: [ - "error", - "double", + 'error', + 'double' ], semi: [ - "error", - "always", - ], - }, -}; + 'error', + 'always' + ] + } +} diff --git a/tests/e2e/CONTRIBUTING_en-Hans.md b/tests/e2e/CONTRIBUTING_en-Hans.md index 5c172bc42..8184604a2 100644 --- a/tests/e2e/CONTRIBUTING_en-Hans.md +++ b/tests/e2e/CONTRIBUTING_en-Hans.md @@ -7,7 +7,7 @@ Prefer to use the assert function provided by `Jest` instead of handling the jud #### Definition `Jest` provides a series of `expect` assertion functions to check whether the results of the code meet expectations. -* https://jestjs.io/docs/expect +* #### Advantage @@ -55,7 +55,7 @@ For test cases in different situations of the same scenario, they tend to be pla #### Definition The `describe` function can put multiple test cases in the same group. -* https://jestjs.io/docs/api#describename-fn +* #### Advantage @@ -157,10 +157,10 @@ Use the wait method provided by `Puppeteer`. `Puppeteer` comes with a series of wait methods to wait for the page to reach the state we need. -* https://puppeteer.github.io/puppeteer/docs/puppeteer.frame.waitForSelector -* https://puppeteer.github.io/puppeteer/docs/puppeteer.frame.waitForXPath -* https://puppeteer.github.io/puppeteer/docs/puppeteer.frame.waitForFunction -* https://puppeteer.github.io/puppeteer/docs/puppeteer.frame.waitForTimeout +* +* +* +* #### Advantage diff --git a/tests/e2e/config.json b/tests/e2e/config.json index 1b23e15eb..2c5160f8f 100644 --- a/tests/e2e/config.json +++ b/tests/e2e/config.json @@ -1,11 +1,11 @@ { - "httpServer": "http://localhost:8080", - "axonRpc": { - "netWorkName": "axon", - "url": "http://localhost:8000", - "chainId": 1098411886 - }, - "hexPrivateKey": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - "account1": "0x8ab0CF264DF99D83525e9E11c7e4db01558AE1b1", - "account2": "0xF386573563C3a75dBbd269FCe9782620826dDAc2" -} \ No newline at end of file + "httpServer": "http://localhost:8080", + "axonRpc": { + "netWorkName": "axon", + "url": "http://localhost:8000", + "chainId": 1098411886 + }, + "hexPrivateKey": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", + "account1": "0x8ab0CF264DF99D83525e9E11c7e4db01558AE1b1", + "account2": "0xF386573563C3a75dBbd269FCe9782620826dDAc2" +} From 929dd7de30195067d583707bf08b583c64b34ed1 Mon Sep 17 00:00:00 2001 From: KaoImin Date: Thu, 21 Dec 2023 16:34:39 +0800 Subject: [PATCH 4/5] add linter --- .mega-linter.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .mega-linter.yml diff --git a/.mega-linter.yml b/.mega-linter.yml new file mode 100644 index 000000000..17ff8f9eb --- /dev/null +++ b/.mega-linter.yml @@ -0,0 +1,53 @@ +# Configuration file for MegaLinter +# See all available variables at https://megalinter.io/configuration/ and in linters documentation + +APPLY_FIXES: all +DISABLE_LINTERS: + - JAVASCRIPT_PRETTIER + - JAVASCRIPT_STANDARD + - JSON_PRETTIER + - REPOSITORY_GITLEAKS + - REPOSITORY_KICS + - RUST_CLIPPY + - SPELL_PROSELINT + - SPELL_MISSPELL + - SPELL_VALE +DISABLE_ERRORS_LINTERS: + - PYTHON_BANDIT + - PYTHON_PYRIGHT + - REPOSITORY_DEVSKIM + - REPOSITORY_GRYPE + - REPOSITORY_SEMGREP + - REPOSITORY_TRUFFLEHOG +PRINT_ALL_FILES: false +FILTER_REGEX_EXCLUDE: '(\.automation/test|\.automation/generated|\.venv|\.github/workflows|docs/javascripts|docs/overrides|docs/json-schemas|flavors|clj-kondo|TEMPLATES)' +JSON_JSONLINT_FILTER_REGEX_EXCLUDE: '(\.vscode/)' +YAML_YAMLLINT_FILTER_REGEX_EXCLUDE: '(templates/\.mega-linter\.yml)' +YAML_PRETTIER_FILTER_REGEX_EXCLUDE: '(templates/\.mega-linter\.yml|mkdocs\.yml)' +YAML_V8R_FILTER_REGEX_EXCLUDE: '(descriptors|templates/\.mega-linter\.yml|\.codecov\.yml)' +BASH_FILTER_REGEX_EXCLUDE: "(lib)" +MARKDOWN_FILTER_REGEX_EXCLUDE: '(license\.md|docs/licenses)' +MARKDOWN_MARKDOWN_LINK_CHECK_DISABLE_ERRORS: true +SPELL_VALE_FILE_EXTENSIONS: + - .md +SPELL_FILTER_REGEX_EXCLUDE: (valestyles|\.github|docs/licenses) +DOCKERFILE_HADOLINT_ARGUMENTS: "--ignore DL3003 --ignore DL3007 --ignore DL3013 --ignore DL3016 --ignore DL3018 --ignore DL3028 --ignore DL3059 --ignore DL4001 --ignore DL4006 --ignore SC2015 --ignore SC2016 --ignore SC2039 --ignore SC2086 --ignore SC1091 --ignore SC3046" +REPOSITORY_TRIVY_ARGUMENTS: + - "--skip-dirs" + - ".automation/test" + - "--skip-dirs" + - ".venv" +SHOW_ELAPSED_TIME: true +FLAVOR_SUGGESTIONS: false +EMAIL_REPORTER: false +FILEIO_REPORTER: false +JSON_REPORTER: true +GITHUB_STATUS_REPORTER: false +PLUGINS: + - https://raw.githubusercontent.com/oxsecurity/megalinter/main/.automation/test/mega-linter-plugin-test/test.megalinter-descriptor.yml +PRE_COMMANDS: + - command: echo "This is MegaLinter PRE_COMMAND on own MegaLinter ! :)" + cwd: "root" +POST_COMMANDS: + - command: echo "This is MegaLinter POST_COMMAND on own MegaLinter ! :)" + cwd: "workspace" From eb3e7b1227686472aeac82b09894b23b04192e23 Mon Sep 17 00:00:00 2001 From: KaoImin Date: Thu, 21 Dec 2023 17:42:02 +0800 Subject: [PATCH 5/5] add check workflow --- .github/workflows/fmt.yml | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml index 4e5ea3a51..515f929c5 100644 --- a/.github/workflows/fmt.yml +++ b/.github/workflows/fmt.yml @@ -41,3 +41,61 @@ jobs: - name: Ensure Cargo.toml dependency tables are sorted run: make check-sort + + megalinter: + name: MegaLinter + runs-on: ubuntu-latest + + # Give the default GITHUB_TOKEN write permission to commit and push, comment + # issues & post new PR; remove the ones you do not need + permissions: + contents: write + issues: write + pull-requests: write + + steps: + # Git Checkout + - name: Checkout Code + uses: actions/checkout@v4 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + + # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to + # improve performance + fetch-depth: 0 + + # MegaLinter + - name: MegaLinter + + # You can override MegaLinter flavor used to have faster performances + # More info at https://megalinter.io/flavors/ + uses: oxsecurity/megalinter@v7 + + id: ml + + # All available variables are described in documentation + # https://megalinter.io/configuration/ + env: + VALIDATE_ALL_CODEBASE: >- + ${{ + github.event_name == 'push' && + contains(fromJSON('["refs/heads/main", "refs/heads/master"]'), github.ref) + }} + + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE + # .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY + + # Uncomment to disable copy-paste and spell checks + # DISABLE: COPYPASTE,SPELL + + # Upload MegaLinter artifacts + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: MegaLinter reports + path: | + megalinter-reports + mega-linter.log