Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

New script verify with ckb-vm pause #4291

Merged
merged 318 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
318 commits
Select commit Hold shift + click to select a range
09d21d4
use Arc and RwLock for LazyData
chenyukang Feb 26, 2024
6f1da9f
rebase ckb-vm 0.24.9
chenyukang Feb 26, 2024
ee04830
rollback arc-swap changes
chenyukang Feb 27, 2024
4bd676e
tunning verify mgr cpu number to avoid high workload
chenyukang Feb 27, 2024
8d8ce55
Just copy codes in it
mohanson Mar 4, 2024
a519266
Use scheduler to run tests (#2)
mohanson Mar 4, 2024
10724ba
Add place args to spawn
mohanson Mar 5, 2024
6a1f8a4
Add a todo for ckb_close
mohanson Mar 5, 2024
3584a7c
Remove all old spawn test cases (#3)
XuJiandong Mar 5, 2024
f1d5437
Rename join => wait
mohanson Mar 5, 2024
4df9a03
Adjust pipe_read/write args positions
mohanson Mar 5, 2024
8bc4175
Move argc/argc to spawn_args_t
mohanson Mar 5, 2024
05b532a
Implement close (#4)
mohanson Mar 5, 2024
962620c
Rename instance_id => process_id
mohanson Mar 5, 2024
b577e4c
Add spawn cases
XuJiandong Mar 6, 2024
0041ec1
Enable 2019/2021 test cases (#7)
mohanson Mar 6, 2024
e4d4aa4
Add more spawn cases (#8)
XuJiandong Mar 6, 2024
da968be
Enable 2019/2021 test cases (#9)
mohanson Mar 6, 2024
af11e31
Rewrite some syscalls (#10)
mohanson Mar 7, 2024
e25aa9d
Add more test cases (#11)
XuJiandong Mar 8, 2024
d44371f
Fix EOF issue (#12)
XuJiandong Mar 8, 2024
6be39c2
Rewrite spawn (#13)
mohanson Mar 8, 2024
9b40aef
Max VMs count (#14)
XuJiandong Mar 9, 2024
0481dec
Rewrite load_cell_data (#15)
mohanson Mar 9, 2024
a8b5155
Staged (#16)
mohanson Mar 12, 2024
5d01738
Update script/Cargo.toml
chenyukang Mar 12, 2024
c5c773b
Merge branch 'new-verify-with-sched' into new_spawn
mohanson Mar 13, 2024
d6aa2a1
Add a fixme in testdata/README.md
mohanson Mar 13, 2024
f29b597
Fix build error
mohanson Mar 13, 2024
04d83ea
fix compiling error with ContextualTransactionVerifier
chenyukang Mar 13, 2024
cce6f65
use scheduler for resumeable vm run
chenyukang Mar 13, 2024
066f42d
use vm scheduler suspend and resume for snapshot
chenyukang Mar 13, 2024
111dae1
cleanup unused code
chenyukang Mar 13, 2024
3b852d3
tunning script test
chenyukang Mar 14, 2024
d4d0014
Use BTreeMap instead of HashMap
mohanson Mar 18, 2024
257be49
fix specs in verify
chenyukang Mar 18, 2024
64711de
Update ckb-vm
mohanson Mar 20, 2024
b6814e7
Fix shared lib
mohanson Mar 21, 2024
7c69ee7
clean lint warnings
chenyukang Mar 21, 2024
9793f7a
begin to work to verify
chenyukang Dec 18, 2023
9d3e60c
use multi_index_map in verify queue
chenyukang Dec 27, 2023
c582d4e
backup
chenyukang Dec 27, 2023
678fcf4
more on worker
chenyukang Dec 28, 2023
fffce9e
a draft version queue worker_mgr
chenyukang Dec 28, 2023
28b12ac
more on verify mgr
chenyukang Jan 2, 2024
4062ab9
begin to fix dataloader issue
chenyukang Jan 3, 2024
b8de60a
fix lazydata issue
chenyukang Jan 3, 2024
83fcddc
cleanup chunk
chenyukang Jan 3, 2024
cb1a784
more cleanups
chenyukang Jan 3, 2024
761bb76
cleanup on logs
chenyukang Jan 4, 2024
5eadbff
add pause for child
chenyukang Jan 8, 2024
a358f81
more on pause for spwan
chenyukang Jan 9, 2024
9a18578
fix remove_tx in verify_queue
chenyukang Jan 13, 2024
81abd80
fix logic issue in rum_vms with signal pass large cycles txs
chenyukang Jan 13, 2024
28051b4
clean up and fix tests
chenyukang Jan 13, 2024
51dbb04
fix merge conflicts
chenyukang Jan 13, 2024
3d75d1e
debug command tx
chenyukang Jan 13, 2024
7f56f61
make clippy happy
chenyukang Jan 14, 2024
65fd907
make ci happy
chenyukang Jan 14, 2024
7496a79
fix graceful shutdown test
chenyukang Jan 14, 2024
f99a334
code refactor on run_vms_with_signal
chenyukang Jan 15, 2024
162395c
fix cycle exceed error
chenyukang Jan 15, 2024
6db4567
add comments and cleanup for suspend
chenyukang Jan 15, 2024
ffe5e0b
prepare to remove CacheEntry::Suspended
chenyukang Jan 15, 2024
d4229dc
remove EntryCache suspend status
chenyukang Jan 15, 2024
f19bc9a
add verify_until_completed replace resumable_verify
chenyukang Jan 15, 2024
7a28b24
cleanup verify_mgr
chenyukang Jan 16, 2024
00cc644
clean up verify vms
chenyukang Jan 16, 2024
45c38b8
verify mgr will not pick entry when suspend
chenyukang Jan 16, 2024
26ff308
refactor and add tests for verify_queue
chenyukang Jan 16, 2024
6e89557
use verify directly in _resumable_process_tx
chenyukang Jan 16, 2024
85ba689
Refactor transaction verification with pattern match, which is more f…
chenyukang Jan 16, 2024
2e12b7d
Add tests for run_vms_with_signal, fix debug pause
chenyukang Jan 17, 2024
acbc63e
Add Stop command and test cases to verify suspend/resume/shutdown
chenyukang Jan 17, 2024
2082a12
refactor verify worker clean up resume_loop
chenyukang Jan 17, 2024
9c18547
add comments and more cleanup
chenyukang Jan 18, 2024
91ca9bc
do not use select! in verify
chenyukang Jan 18, 2024
7ea8249
use oneshot channel in verify
chenyukang Jan 18, 2024
144b0d5
remove uncessary clone in verify_queue
chenyukang Jan 18, 2024
ce2c7fd
fix script verification stop error
chenyukang Jan 18, 2024
8f0463a
enqueue Notify transactions directly
chenyukang Jan 18, 2024
9b1c4f0
refactor verify queue channel
chenyukang Jan 18, 2024
66298b6
add comments for verify mgr
chenyukang Jan 18, 2024
4e0786d
use notify in verify queue
chenyukang Jan 20, 2024
7075a32
remove interval in worker
chenyukang Jan 23, 2024
ad8d55a
code refactor to remove ContextualWithoutScriptTransactionVerifier an…
chenyukang Jan 26, 2024
6a30067
code refactor for resumeble_process_tx
chenyukang Jan 26, 2024
095777e
add verify test logs for testing
chenyukang Jan 26, 2024
cbab07c
add send_test_transaction to help verify testing, we may need to roll…
chenyukang Jan 26, 2024
398a9e0
tunning the number of verify queue worker
chenyukang Jan 30, 2024
c35511a
use info for verify pause and resume log
chenyukang Jan 30, 2024
eb2d225
code refactor for _resumeble_process_tx
chenyukang Jan 30, 2024
404e6d2
code cleanup
chenyukang Feb 1, 2024
021ad6e
add test rpc for suspend resume
chenyukang Feb 1, 2024
9c77eb8
fix conflicts with develop branch
chenyukang Feb 1, 2024
b1d351b
more cleanup, remove _resumeble_process_tx for better performance
chenyukang Feb 1, 2024
114eb79
performance tuning
chenyukang Feb 2, 2024
fccf89d
cleanup in verify
chenyukang Feb 3, 2024
ae3217d
remote tx will all be added into verify pool
chenyukang Feb 8, 2024
dc94f01
alias ScriptVerifier for TransactionScriptsVerifier
chenyukang Feb 8, 2024
92b8d9d
use ArcSwap in LazyData and upgrade arc-swap
chenyukang Feb 9, 2024
08a01d6
add test API, will rollback after testing
chenyukang Feb 20, 2024
f050037
remove verbose log messages for new verify
chenyukang Feb 21, 2024
bd67a5d
rebase ckb-vm to 0.24.8
chenyukang Feb 22, 2024
7629235
use Arc and RwLock for LazyData
chenyukang Feb 26, 2024
7c6aa3e
rebase ckb-vm 0.24.9
chenyukang Feb 26, 2024
0f2ca33
rollback arc-swap changes
chenyukang Feb 27, 2024
ea3dc87
tunning verify mgr cpu number to avoid high workload
chenyukang Feb 27, 2024
5b11d70
Update script/Cargo.toml
chenyukang Mar 12, 2024
f7599d2
fix conflicts from rebase
chenyukang Mar 21, 2024
77d6235
merge new verify
chenyukang Mar 21, 2024
8a99a45
fix rpc docs
chenyukang Mar 21, 2024
8bc0c56
fix conflicts from rebase
chenyukang Mar 21, 2024
4d83bea
merge from new verify
chenyukang Mar 21, 2024
c8b6cf4
fix clippy wanring
chenyukang Mar 21, 2024
bca7c0d
cleanup unused code
chenyukang Mar 21, 2024
0d6aeea
fix spawn specs
chenyukang Mar 21, 2024
a00365f
code refactor for scheduler and syscalls2
chenyukang Mar 21, 2024
cfd998f
Remove println in check_spawn_strcat
mohanson Mar 27, 2024
170c5b7
add metric for delay of process tx in txpool
chenyukang Mar 27, 2024
1773243
verify_until_completed returns error now
mohanson Mar 27, 2024
c5292b3
exec callee pause
mohanson Mar 27, 2024
368124f
Clean
mohanson Mar 27, 2024
16d5aa8
fix test case check_exec_callee_pause
chenyukang Mar 28, 2024
b451b3f
fix test for resume_from_snap
chenyukang Mar 28, 2024
0f76bbe
clean up
chenyukang Mar 28, 2024
a32861d
Fix load_cell_data and load_cell_data_as_code
mohanson Mar 29, 2024
13fb2df
Optimize comments
mohanson Mar 29, 2024
527cd17
Rename utils.h to spawn_utils.h
mohanson Mar 29, 2024
cbf47bf
update ckb_schemars
chenyukang Apr 1, 2024
676b796
Add check_spawn_configurable testcase
mohanson Apr 1, 2024
3739f7b
Create up to 64 pipes
mohanson Apr 2, 2024
9ddc661
Add SpawnFrom:Slice to test spawn_configurable
mohanson Apr 2, 2024
7f5697a
Add spawn dag testcase
mohanson Apr 3, 2024
6a7c0b6
Clean codes
mohanson Apr 4, 2024
70ccc7f
Update cargo.lock
mohanson Apr 4, 2024
d511fd7
Add missing ensure_vms_instantiated
mohanson Apr 4, 2024
8f9b967
clang fmt
mohanson Apr 5, 2024
ac8e152
Add test_random_dag
mohanson Apr 6, 2024
6c28298
Support interpreter ckb-vm
mohanson Apr 9, 2024
8f40da9
Add spawn fuzzing test (#17)
XuJiandong Apr 10, 2024
59a6ac1
Adjust cycles charge
mohanson Apr 10, 2024
3a3ff6b
Adjust cycles charge
mohanson Apr 11, 2024
7517bf5
Use yield error
mohanson Apr 11, 2024
8ff30a3
Replace unwrap with error
mohanson Apr 11, 2024
70f9361
Fix clippy error: this loop never actually loops
mohanson Apr 11, 2024
dd261e0
Fix clippy: unneeded return statement
mohanson Apr 11, 2024
a8a30e4
Remove logs
mohanson Apr 12, 2024
a71043f
Add testcase about spawn (#19)
joii2020 Apr 15, 2024
380eb9a
Adjust spawn_cases
mohanson Apr 15, 2024
0f7743e
Rename PipeId to Fd
mohanson Apr 15, 2024
0f32819
Rename MAX_FD_CREATED to MAX_FDS_CREATED
mohanson Apr 15, 2024
b0ced6e
Update ckb-c-stdlib
mohanson Apr 15, 2024
4fc3ad4
Remove spawn_fd_limits
mohanson Apr 15, 2024
5d6a27f
Rename Pipe to Fd
mohanson Apr 15, 2024
9b96f53
Fix previous PR
mohanson Apr 15, 2024
0e653fb
Run make fmt
mohanson Apr 16, 2024
c1ef6b5
MAX_FDS only limit alive fd now
mohanson Apr 16, 2024
80fee9d
Add spawn test case with lots of resume/suspend (#21)
XuJiandong Apr 16, 2024
9c51571
Add tests: about spawn load cells (#22)
joii2020 Apr 17, 2024
3754058
Clean
mohanson Apr 17, 2024
5ddedfd
Charge cycles when vm suspending/resumeing
mohanson Apr 17, 2024
9f816b7
Remove eprintln!
mohanson Apr 18, 2024
7cbc55d
Quick fix previous commit
mohanson Apr 18, 2024
97876b8
Add {current_used} for ScriptError
mohanson Apr 18, 2024
bb1d25f
Add ensure_vms_instantiated for Message::Pipe
mohanson Apr 18, 2024
5fec33c
cleanup test
chenyukang Apr 22, 2024
6f9374d
fix test for chunk count
chenyukang Apr 22, 2024
956047e
add comments
chenyukang Apr 22, 2024
6d32512
cleanup clippy
chenyukang Apr 22, 2024
aced82c
Merge branch 'yukang-new-verify' into new-verify-with-sched
chenyukang Apr 22, 2024
6f884e6
merge develop
chenyukang Apr 22, 2024
fb604fe
resolve conflict
chenyukang Apr 22, 2024
eb3d08a
resolve conflict
chenyukang Apr 22, 2024
dc3bb25
Add spawn cycles testcase
mohanson Apr 22, 2024
7b198a3
Fix previous commit
mohanson Apr 22, 2024
9ca6687
Update spawn_cycles
mohanson Apr 23, 2024
a7acf9f
MAX_VMS_COUNT is now a constant
mohanson Apr 25, 2024
f64d93d
Fix load_cell_data
mohanson Apr 25, 2024
e190794
Use an internal struct for WaitForWrite and WaitForRead
mohanson Apr 25, 2024
3c45fc4
Add a debug_assert_eq to check extra_cycles is 0
mohanson Apr 25, 2024
564cc61
Add test: read\write cycles
joii2020 Apr 25, 2024
985e44f
Clean spawn_io_cycles.c
mohanson Apr 25, 2024
d34ca8e
Use filter_map and collect to refactoring codes
mohanson Apr 25, 2024
63d4dde
Remove unnecessary comments
mohanson Apr 25, 2024
1a83097
Simplify codes with functional
mohanson Apr 25, 2024
de4a7e4
Replace VMError::External(IndexOutOfBound) with VMError::CkbScriptInd…
mohanson Apr 26, 2024
345ace6
Update Cargo.lock
mohanson Apr 26, 2024
b9de30f
Refactoring iterate
mohanson Apr 26, 2024
67cb7a9
Remove unnecessary clone
mohanson Apr 26, 2024
c23f19a
Simplified set_max_cycles
mohanson Apr 26, 2024
de38595
Add a help function ensure_get_instantiated
mohanson Apr 26, 2024
13bf1fe
Rename generate_same_syscalls to generate_syscalls
mohanson Apr 26, 2024
77a2824
Remove snapshot2_context from TransactionScriptsSyscallsGenerator
mohanson Apr 26, 2024
9936a79
Fix clippy
mohanson Apr 26, 2024
4cfe332
Remove inherited_file_descriptors special handling of NULL
mohanson Apr 28, 2024
f9a7c17
Replace + with checked_add
mohanson Apr 29, 2024
e766bb5
add cycles assertions
chenyukang May 6, 2024
3cd39f5
sync up with develop
chenyukang May 7, 2024
72aa9e8
Refactoring data source
mohanson May 8, 2024
fa8ac4a
Update cargo.lock
mohanson May 8, 2024
5604965
fix conflicts
chenyukang May 8, 2024
169fd2b
merge develop
chenyukang May 8, 2024
362aadc
merge new-verify
chenyukang May 8, 2024
384d76f
sync up with develop
chenyukang May 8, 2024
e729974
fix clippy
chenyukang May 8, 2024
a4fb1db
Update ckb-vm
mohanson May 15, 2024
73ca9c2
Update Cargo.lock
mohanson May 15, 2024
379684d
lock cargo shear version
chenyukang May 10, 2024
305425a
lock cargo shear version
chenyukang May 10, 2024
2abad8c
Add test case with spawn saturate memory
XuJiandong May 20, 2024
7494697
Update script/testdata/README.md
mohanson May 20, 2024
4a2f18e
Fix addr overlap
mohanson May 27, 2024
58c8480
Update ckb-vm to v0.24.11
mohanson May 28, 2024
daa0700
Update Cargo.lock
mohanson May 28, 2024
3c59242
Public TxData
mohanson Jun 4, 2024
4003f03
Changes for spawn debugger
mohanson Jun 17, 2024
285eab8
sync with develop
chenyukang Jun 21, 2024
27ec1c2
Merge branch 'yukang-new-verify' into new-verify-with-sched
chenyukang Jun 21, 2024
234f736
Update ckb-vm to v0.24.12
mohanson Jun 21, 2024
0e8e493
sync up with develop branch
chenyukang Jun 21, 2024
d092376
Add missing docs
mohanson Jun 21, 2024
eb62b40
Update molecule to 0.8.0
mohanson Jun 21, 2024
770e9ce
Update cycles
mohanson Jun 22, 2024
9ccbc90
remove unnecessary clone in resumeble_process_tx
chenyukang Jun 25, 2024
ccbb639
limit verify queue with total_tx_size
chenyukang Jun 26, 2024
9f9b4e0
Merge branch 'develop' into yukang-new-verify
chenyukang Jun 26, 2024
4601424
fix clippy
chenyukang Jun 26, 2024
7964e56
Merge branch 'develop' into yukang-new-verify
chenyukang Jul 1, 2024
db9a591
Merge branch 'yukang-new-verify' into new-verify-with-sched
chenyukang Jul 1, 2024
e2bc2d5
merge develop
chenyukang Jul 1, 2024
e875acd
bless clippy
chenyukang Jul 1, 2024
e10caea
Add base cycles for exec in script-version-2
mohanson Jul 5, 2024
ed1d4b9
Reduce load elf base cycles to 50k
mohanson Jul 5, 2024
63afcf4
Increase to 75000
mohanson Jul 5, 2024
92c9833
add verify sort key for fee rate
chenyukang Jul 11, 2024
c7dafc4
add verify queue size in tx_pool_info
chenyukang Jul 12, 2024
38279e1
To keep compatible with the old Source::parse_from_u64 behavior
mohanson Jul 18, 2024
ea4aea7
Load cell data before load size
mohanson Jul 19, 2024
af87dd3
Fix source and data_piece_id's inconsistency
mohanson Jul 26, 2024
5df355d
sync develop
chenyukang Jul 30, 2024
c4da7a1
Revert "add verify sort key for fee rate"
chenyukang Jul 30, 2024
8c9bceb
add worker role for verify workers to avoid large cycle tx issues
chenyukang Jul 30, 2024
74cc910
sync develop
chenyukang Aug 1, 2024
5db5c87
merge develop
chenyukang Aug 2, 2024
a91689c
Merge pull request #4380 from libraries/new_spawn
chenyukang Aug 2, 2024
a8fe681
merge verify with scheduler
chenyukang Aug 2, 2024
46ba28a
make clippy happy
chenyukang Aug 2, 2024
964817b
Merge branch 'develop' into yukang-new-verify
chenyukang Aug 12, 2024
454c1c5
fix rpc test
chenyukang Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 34 additions & 17 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MOLC := moleculec
MOLC_VERSION := 0.7.5
VERBOSE := $(if ${CI},--verbose,)
CLIPPY_OPTS := -D warnings -D clippy::clone_on_ref_ptr -D clippy::redundant_clone -D clippy::enum_glob_use -D clippy::fallible_impl_from \
-A clippy::mutable_key_type -A clippy::upper_case_acronyms
-A clippy::mutable_key_type -A clippy::upper_case_acronyms -A clippy::needless_return
CKB_TEST_ARGS := -c 4 ${CKB_TEST_ARGS}
CKB_FEATURES ?= deadlock_detection,with_sentry
ALL_FEATURES := deadlock_detection,with_sentry,with_dns_seeding,profiling,march-native
Expand Down
2 changes: 1 addition & 1 deletion chain/src/tests/load_code_with_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn test_load_code() {
let tx_status = tx_pool.get_tx_status(tx.hash());
assert_eq!(
tx_status.unwrap().unwrap(),
(TxStatus::Pending, Some(11174))
(TxStatus::Pending, Some(11325))
);
}

Expand Down
95 changes: 94 additions & 1 deletion rpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ The crate `ckb-rpc`'s minimum supported rustc version is 1.71.1.
* [Method `notify_transaction`](#integration_test-notify_transaction)
* [Method `generate_block_with_template`](#integration_test-generate_block_with_template)
* [Method `calculate_dao_field`](#integration_test-calculate_dao_field)
* [Method `send_test_transaction`](#integration_test-send_test_transaction)
* [Module Miner](#module-miner) [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://github.com/raw/nervosnetwork/ckb-rpc-resources/develop/ckb-logo.jpg&schemaUrl=https://github.com/raw/nervosnetwork/ckb-rpc-resources/develop/json/miner_rpc_doc.json)

* [Method `get_block_template`](#miner-get_block_template)
Expand Down Expand Up @@ -3549,6 +3550,95 @@ Response
}
```

<a id="integration_test-send_test_transaction"></a>
#### Method `send_test_transaction`
* `send_test_transaction(tx, outputs_validator)`
* `tx`: [`Transaction`](#type-transaction)
* `outputs_validator`: [`OutputsValidator`](#type-outputsvalidator) `|` `null`
* result: [`H256`](#type-h256)

Submits a new test local transaction into the transaction pool, only for testing.
If the transaction is already in the pool, rebroadcast it to peers.

###### Params

* `transaction` - The transaction.
* `outputs_validator` - Validates the transaction outputs before entering the tx-pool. (**Optional**, default is "passthrough").

###### Errors

* [`PoolRejectedTransactionByOutputsValidator (-1102)`](../enum.RPCError.html#variant.PoolRejectedTransactionByOutputsValidator) - The transaction is rejected by the validator specified by `outputs_validator`. If you really want to send transactions with advanced scripts, please set `outputs_validator` to "passthrough".
* [`PoolRejectedTransactionByMinFeeRate (-1104)`](../enum.RPCError.html#variant.PoolRejectedTransactionByMinFeeRate) - The transaction fee rate must be greater than or equal to the config option `tx_pool.min_fee_rate`.
* [`PoolRejectedTransactionByMaxAncestorsCountLimit (-1105)`](../enum.RPCError.html#variant.PoolRejectedTransactionByMaxAncestorsCountLimit) - The ancestors count must be greater than or equal to the config option `tx_pool.max_ancestors_count`.
* [`PoolIsFull (-1106)`](../enum.RPCError.html#variant.PoolIsFull) - Pool is full.
* [`PoolRejectedDuplicatedTransaction (-1107)`](../enum.RPCError.html#variant.PoolRejectedDuplicatedTransaction) - The transaction is already in the pool.
* [`TransactionFailedToResolve (-301)`](../enum.RPCError.html#variant.TransactionFailedToResolve) - Failed to resolve the referenced cells and headers used in the transaction, as inputs or dependencies.
* [`TransactionFailedToVerify (-302)`](../enum.RPCError.html#variant.TransactionFailedToVerify) - Failed to verify the transaction.

###### Examples

Request

```json
{
"id": 42,
"jsonrpc": "2.0",
"method": "send_test_transaction",
"params": [
{
"cell_deps": [
{
"dep_type": "code",
"out_point": {
"index": "0x0",
"tx_hash": "0xa4037a893eb48e18ed4ef61034ce26eba9c585f15c9cee102ae58505565eccc3"
}
}
],
"header_deps": [
"0x7978ec7ce5b507cfb52e149e36b1a23f6062ed150503c85bbf825da3599095ed"
],
"inputs": [
{
"previous_output": {
"index": "0x0",
"tx_hash": "0x365698b50ca0da75dca2c87f9e7b563811d3b5813736b8cc62cc3b106faceb17"
},
"since": "0x0"
}
],
"outputs": [
{
"capacity": "0x2540be400",
"lock": {
"code_hash": "0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5",
"hash_type": "data",
"args": "0x"
},
"type": null
}
],
"outputs_data": [
"0x"
],
"version": "0x0",
"witnesses": []
},
"passthrough"
]
}
```

Response

```json
{
"id": 42,
"jsonrpc": "2.0",
"result": "0xa0ef4eb5f4ceeb08a4c8524d84c5da95dce2f608e0ca2ec8091191b0f330c6e3"
}
```

### Module `Miner`
- [👉 OpenRPC spec](http://playground.open-rpc.org/?uiSchema[appBar][ui:title]=CKB-Miner&uiSchema[appBar][ui:splitView]=false&uiSchema[appBar][ui:examplesDropdown]=false&uiSchema[appBar][ui:logoUrl]=https://github.com/raw/nervosnetwork/ckb-rpc-resources/develop/ckb-logo.jpg&schemaUrl=https://github.com/raw/nervosnetwork/ckb-rpc-resources/develop/json/miner_rpc_doc.json)

Expand Down Expand Up @@ -4619,7 +4709,8 @@ Response
"tip_number": "0x400",
"total_tx_cycles": "0x219",
"total_tx_size": "0x112",
"tx_size_limit": "0x7d000"
"tx_size_limit": "0x7d000",
"verify_queue_size": "0x0"
}
}
```
Expand Down Expand Up @@ -7160,6 +7251,8 @@ Transaction pool information.

Transactions with a large size close to the block size limit may not be packaged, because the block header and cellbase are occupied, so the tx-pool is limited to accepting transaction up to tx_size_limit.

* `verify_queue_size`: [`Uint64`](#type-uint64) - verify_queue size

### Type `TxStatus`
Transaction status and the block hash if it is committed.

Expand Down
3 changes: 2 additions & 1 deletion rpc/src/module/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ pub trait PoolRpc {
/// "tip_number": "0x400",
/// "total_tx_cycles": "0x219",
/// "total_tx_size": "0x112",
/// "tx_size_limit": "0x7d000"
/// "tx_size_limit": "0x7d000",
/// "verify_queue_size": "0x0"
/// }
/// }
/// ```
Expand Down
Loading
Loading