Skip to content

Instantly share code, notes, and snippets.

View keroro520's full-sized avatar
🏠
Working from home

Kero keroro520

🏠
Working from home
View GitHub Profile
@keroro520
keroro520 / what-is-tps.md
Last active June 15, 2020 10:08
what is tps

TPS 的定义:

In the context of blockchains, transactions per second (TPS) refers to the number of transactions that a network is capable of processing each second.

上面的定义很好理解:整个区块链网络作为一个整体,一秒内所能处理的交易量。问题在如何评估 “处理的交易量”?

  • 方式一:“处理” 等于 “上链”,所以 TPS = 已上链的交易量 / 块的时间间隔

TPS = 已上链的交易量 / 块的时间间隔

@keroro520
keroro520 / multi-blocks
Last active June 17, 2020 04:01
Format: `{ peer : { block_number : latency }}`
This file has been truncated, but you can view the full file.
2020-06-17 03:12:53.790 +00:00 NetworkRuntime INFO ckb-net-monitor laatency: {29: [], 9: [], 46: [], 51: [], 73: [], 61: [], 10: [], 5: [], 66: [], 17: [], 22: [], 54: [], 57: [], 16: [], 14: [], 35: [], 32: [], 28: [], 8: [], 68: [], 18: [], 45: [], 71: [], 26: [], 38: [], 56: [], 53: [], 77: [], 62: [], 11: [], 21: [], 48: [], 37: [], 39: [], 30: [], 64: [], 65: [], 49: [], 4: [], 25: [], 27: [], 84: [], 55: [], 63: [], 58: [], 6: [], 59: [], 34: [], 52: [], 3: [], 24: [], 47: [], 78: [], 79: [], 44: [], 60: [], 12: [], 70: [], 19: [], 15: [], 31: [], 33: [], 23: [], 40: [], 43: [], 76: [], 42: [], 41: [], 74: [], 7: [], 2: [], 36: [], 72: [], 1: []}
2020-06-17 03:13:13.793 +00:00 NetworkRuntime INFO ckb-net-monitor laatency: {11: [(2097044, 46), (2097045, 91)], 38: [(2097044, 110), (2097045, 217)], 8: [(2097044, 4), (2097045, 5)], 31: [(2097044, 120), (2097045, 242)], 44: [(2097044, 129), (2097045, 257)], 34: [(2097044, 433), (2097045, 532)], 87: [], 29: [(2097044, 104), (2097045, 206)], 42: [(2097044, 1
@keroro520
keroro520 / q3-q4.okr.md
Last active September 10, 2020 10:07
Q3/Q4 OKR

Q3

  • KR1: Improve programmability and readability of integration-test.

    • Extract common behaviors. Our test cases are always complicated, usually because they act complicated steps to construct the testing context or check the status of the things. Extracting those common behaviors is a way to reduce complexity. Our vision is, with fewer codes and documents, that a new programmer takes less effort to read and write test cases.
      • Mining
      • Block construction
      • Transaction construction
      • Chain construction
  • Chain/block/transaction status checking
@keroro520
keroro520 / ckb-spec-wano.toml
Created January 13, 2021 06:30
ckb-spec-wano.toml
name = "ckb_privnet_pow_dummy"
[genesis]
version = 0
parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
timestamp = 0
compact_target = 0x20ffffff # difficulty = 1
uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
nonce = "0x0"
@keroro520
keroro520 / commit-invalid.log
Created August 11, 2021 13:13
error: Error { kind: Block, inner: Commit(Invalid) }
2021-08-11 06:30:12.343 +00:00 ckb-global-runtime ERROR ckb_tx_pool::process resolve transactions when build block template, tip_number: 4519, tip_hash: Byte32(0xd8f7d8ca752c3b8a645a658278c829125a64a95424b061a9413ab9b1e72ba67d), error: Unknown(OutPoint(0x1311432d6153604df33beda417936a8551a0648aa8b4908a5ec057c4f318c5242d000000))
2021-08-11 06:30:12.343 +00:00 ckb-global-runtime ERROR ckb_tx_pool::process resolve transactions when build block template, tip_number: 4519, tip_hash: Byte32(0xd8f7d8ca752c3b8a645a658278c829125a64a95424b061a9413ab9b1e72ba67d), error: Unknown(OutPoint(0xd13201c16e714ef15b5297fb6939ffa9e5382cd47006cde3f9496064af93972234000000))
2021-08-11 06:30:12.343 +00:00 ckb-global-runtime ERROR ckb_tx_pool::process resolve transactions when build block template, tip_number: 4519, tip_hash: Byte32(0xd8f7d8ca752c3b8a645a658278c829125a64a95424b061a9413ab9b1e72ba67d), error: Unknown(OutPoint(0x6abbccb3af40a178c8bd25de9212a06751e976e0434886254dd9dd4c3db9009825000000))
2021-08-11 06:30:12.343 +00:00
# Config generated by `ckb init --chain staging`
data_dir = "data"
[chain]
# Choose the kind of chains to run, possible values:
# - { file = "specs/dev.toml" }
# - { bundled = "specs/testnet.toml" }
# - { bundled = "specs/mainnet.toml" }
spec = { file = "ckb-spec-staging.toml" }
# Config generated by `ckb init --chain staging`
data_dir = "data"
[chain]
# Choose the kind of chains to run, possible values:
# - { file = "specs/dev.toml" }
# - { bundled = "specs/testnet.toml" }
# - { bundled = "specs/mainnet.toml" }
spec = { file = "ckb-spec-staging.toml" }
name = "ckb_staging"
[genesis]
version = 0
parent_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
timestamp = 1564207200792
compact_target = 0x1f010000
uncles_hash = "0x0000000000000000000000000000000000000000000000000000000000000000"
nonce = "0x0"
/ip4/101.20.237.133/tcp/1027/p2p/QmPeX31x35jV6hgQhUFoHGeHBs1MNX93GVVjn7s4ntBa3P
/ip4/101.20.237.133/tcp/1030/p2p/QmPeX31x35jV6hgQhUFoHGeHBs1MNX93GVVjn7s4ntBa3P
/ip4/101.20.237.133/tcp/1031/p2p/QmPeX31x35jV6hgQhUFoHGeHBs1MNX93GVVjn7s4ntBa3P
/ip4/101.20.237.133/tcp/59537/p2p/QmPeX31x35jV6hgQhUFoHGeHBs1MNX93GVVjn7s4ntBa3P
/ip4/103.149.249.103/tcp/44623/p2p/QmWHKcVke4UeVv5ut6b4bmEpKwsxD4X47WtR9C2Q5RVV96
/ip4/103.97.201.38/tcp/50220/p2p/QmWHKcVke4UeVv5ut6b4bmEpKwsxD4X47WtR9C2Q5RVV96
/ip4/103.97.201.38/tcp/60902/p2p/QmWHKcVke4UeVv5ut6b4bmEpKwsxD4X47WtR9C2Q5RVV96
/ip4/103.97.201.38/tcp/9722/p2p/QmWHKcVke4UeVv5ut6b4bmEpKwsxD4X47WtR9C2Q5RVV96
/ip4/106.55.5.200/tcp/8115/p2p/QmNokn2967QTpsrun7vsbvszP5PB3K6BETNxytLUDskybC
/ip4/112.124.64.189/tcp/8115/p2p/QmPVFmsYsDfFpnKGscT94XWFhKriCQvwKVp1GLxi5fdxHn