Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

QA for v1.10.0 (Kore) #1676

Closed
31 tasks done
kjhman21 opened this issue Nov 9, 2022 · 17 comments
Closed
31 tasks done

QA for v1.10.0 (Kore) #1676

kjhman21 opened this issue Nov 9, 2022 · 17 comments
Assignees
Labels
QA QA tests for version release

Comments

@kjhman21
Copy link
Collaborator

kjhman21 commented Nov 9, 2022

New Features (hardfork)

Improvements

Fixes

Miscellaneous

v1.10.0-rc.3 Fixes

v1.10.0-rc.4 Fixes

v1.10.0-rc.5 Fixes

Regular Test Cases @kjeom

Consideration @kjeom

@kjhman21 kjhman21 self-assigned this Nov 9, 2022
@kjhman21 kjhman21 added this to the v1.10 (Kore) milestone Nov 10, 2022
@blukat29
Copy link
Contributor

blukat29 commented Nov 14, 2022

Change DeriveSha tests

  • governance.vote("governance.deriveshaimpl", 0) works
  • ABA test
    • DSha = 2 -> 0 -> 2 works
    • Inspect block header for TxRoot and ReceiptRoot values, with empty and nonempty TXs
  • Block sync around DSha-changing block, with empty and nonempty TXs
    • Leading node (Latest.DSha = 0) -> Lagging node (Latest.DSha = 2)
  • Block sync across versions, before Kore, without DSha votes
    • Leading node (v1.10.0) -> Lagging node (v1.9.1)
    • Leading node (v1.9.1) -> Lagging node (v1.10.0)
  • API eth_getProof storageHash always uses Orig impl
  • API governance.chainConfig, governance.itemsAt contains DeriveShaImpl item
Test logs
  • governance.vote("governance.deriveshaimpl", 0) works @ v1.10.0+b933e01336

     > governance.vote('governance.deriveshaimpl', 0)
     "Your vote is prepared. It will be put into the block header or applied when your node generates a block as a proposer. Note that your vote may be duplicate."
     > governance.vote('governance.deriveshaimpl', 2)
     "Your vote is prepared. It will be put into the block header or applied when your node generates a block as a proposer. Note that your vote may be duplicate."
     > governance.vote('governance.deriveshaimpl', "2")
     Error: Your vote couldn't be placed. Please check your vote's key and value
     > governance.vote('governance.deriveshaimpl', "x")
     Error: Your vote couldn't be placed. Please check your vote's key and value
  • ABA test @ v1.10.0+b933e01336

    • Note
      • DSha=0, EmptyRootHash=0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
      • DSha=2, EmptyRootHash=0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470
        TxRoot([ tx1 ]) == txhash1 (if there is exactly one tx)
    • [A] DSha=2
      > function showBlock(num) { var b = klay.getBlock(num); return { number: num, transactions: b.transactions, transactionsRoot: b.transactionsRoot, receiptsRoot: b.receiptsRoot } }
      > governance.chainConfig.deriveShaImpl
      2
      > showBlock(89)
      {
        number: 89,
        receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
        transactions: [],
        transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
      }
      > showBlock(90)
      {
        number: 90,
        receiptsRoot: "0xe38e5532717f12f769b07ea016014bd39b74fb72def4de8442114cc2728609f2",
        transactions: ["0x668d499e9c28e2063149f3c2678de33f2e184c151ff066c400c223a4a1df58a5"],
        transactionsRoot: "0x668d499e9c28e2063149f3c2678de33f2e184c151ff066c400c223a4a1df58a5"
      }
      > klay.getRawTransaction("0x668d499e9c28e2063149f3c2678de33f2e184c151ff066c400c223a4a1df58a5")
      "0xf86702850ba43b740083015f9094bb2a13b4586ed6d10e1bb807ff3e7bc7f25961078080820feaa0151ebc22f5210f82e23ea447dfb399833a37d7624dc181ff99eb917349e96f53a07f4bf0314689933af19c62c0c6d499c48a4c9c787b32cb8627cc48970f82b817"
    • [B] DSha=0
      > governance.vote('governance.deriveshaimpl', 0)
      > governance.itemsAt(239)['governance.deriveshaimpl']
      2
      > governance.itemsAt(240)['governance.deriveshaimpl']
      0
      > showBlock(239)
      {
        number: 239,
        receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
        transactions: [],
        transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
      }
      > showBlock(240)
      {
        number: 240,
        receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        transactions: [],
        transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
      }
      > showBlock(244)
      {
        number: 244,
        receiptsRoot: "0x056b23fbba480696b65fe5a59b8f2148a1299103c4f57df839233af2cf4ca2d2",
        transactions: ["0x5ddad5241168c01abe10bd9d5c141ac648c779b9e49dc5baf9c4e18f327c159a"],
        transactionsRoot: "0x3053d4fe95fe184216adda18c9a446195ebb28f43f8b12bb35a26bf966c116ae"
      }
      > klay.getRawTransaction("0x5ddad5241168c01abe10bd9d5c141ac648c779b9e49dc5baf9c4e18f327c159a")
      "0xf86713850ba43b740083015f9094bb2a13b4586ed6d10e1bb807ff3e7bc7f25961078080820fe9a0d1c8abf9781e61f745d5854906b4db7dca31db703a5ced6226e80698f47400b1a038b866c5791d6e9e8edaf42aef1488e410e46f4d83ce3ed1b0d7a58ec3f7c983"
    • [A] DSha=2
      > governance.vote('governance.deriveshaimpl', 2)
      > governance.itemsAt(329)['governance.deriveshaimpl']
      0
      > governance.itemsAt(330)['governance.deriveshaimpl']
      2
      > showBlock(329)
      {
        number: 329,
        receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        transactions: [],
        transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
      }
      > showBlock(330)
      {
        number: 330,
        receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
        transactions: [],
        transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
      }
      > showBlock(334)
      {
        number: 334,
        receiptsRoot: "0xe38e5532717f12f769b07ea016014bd39b74fb72def4de8442114cc2728609f2",
        transactions: ["0xa15abf84b12a1606cf38c0814869e5ec2522cef288b21ef644aea3a647651883"],
        transactionsRoot: "0xa15abf84b12a1606cf38c0814869e5ec2522cef288b21ef644aea3a647651883"
      }
  • Block sync around DSha-changing block, with empty and nonempty TXs @ v1.10.0+c1cb4db027

    • Setup: 4 CNs and 2 ENs.
      • CN-0,1,2, EN-0: Always up to date.
      • CN-3, EN-1: Disconnected during DSha changing governance vote. Later reconnect and sync.
      homi setup --docker-image-id klaytn/klaytn:v1.10.0-rc.2 \
          --cn-num 4 --en-num 2 --deriveShaImpl 2 --baobab-test
      cd homi-output
      alias doco=docker-compose
      doco up -d
      
      # connect CN-0 -> EN-0, CN-0 -> EN-1.
      doco exec -T EN-0 ken attach /klaytn/klay.ipc --exec 'admin.addPeer('\''kni://...@CN-0:32323'\'')'
      doco exec -T EN-1 ken attach /klaytn/klay.ipc --exec 'admin.addPeer('\''kni://...@CN-0:32323'\'')'
      
      # Disconnect CN-3 and EN-1 from the network
      doco exec -T CN-3 kcnd stop; doco exec -T EN-1 kend stop
      
      # Vote for DeriveSha change
      doco exec -T CN-0 kcn attach /klaytn/klay.ipc --exec 'governance.vote("governance.deriveshaimpl", 0)'
      
      # Wait for CNs produce blocks with DeriveShaImpl=0 
      sleep 120
      
      # Reconnect CN-3 and EN-0 to the network
      doco exec -T CN-3 kcnd start; doco exec -T EN-1 kend start
    • Result
      • CN-3, EN-1 both successfully catched up to the latest block.
  • Block sync across versions, before Kore, without DSha votes @ v1.10.0+c1cb4db027 and v1.9.1+8664bc8831

    • Setup: 4 CNs and 2 ENs.
      homi setup --docker-image-id klaytn/klaytn:v1.10.0-rc.2 \
          --cn-num 4 --en-num 2 --deriveShaImpl 2 --baobab-test --kore-compatible-blocknumber 999999
      # Manually modify docker-compose.yaml for image versions.
      cd homi-output
      alias doco=docker-compose
      doco up -d
      
      # connect CN-0 -> EN-0, CN-0 -> EN-1.
      doco exec -T EN-0 ken attach /klaytn/klay.ipc --exec 'admin.addPeer('\''kni://...@CN-0:32323'\'')'
      doco exec -T EN-1 ken attach /klaytn/klay.ipc --exec 'admin.addPeer('\''kni://...@CN-0:32323'\'')'
      
      # Disconnect CN-3 and EN-1 from the network
      doco exec -T CN-3 kcnd stop; doco exec -T EN-1 kend stop
      
      # Reconnect CN-3 and EN-0 to the network
      doco exec -T CN-3 kcnd start; doco exec -T EN-1 kend start
    • Result 1:
      • CN-0,1,2, EN-0: v1.10.0-rc.2. Always connected
      • CN-3, EN-1: v1.9.1. Disconnected and reconnected.
      • CN-3, EN-1 both successfully catched up to the latest block.
    • Result 2:
      • CN-0,1,2, EN-0: v1.9.1. Always connected
      • CN-3, EN-1: v1.10.0-rc.2. Disconnected and reconnected.
      • CN-3, EN-1 both successfully catched up to the latest block.
  • API governance.chainConfig, governance.itemsAt contains DeriveShaImpl item @ v1.10.0+b933e01336

     > governance.itemsAt(0)['governance.deriveshaimpl']
     2
     > governance.chainConfig.deriveShaImpl
     2

@blukat29
Copy link
Contributor

blukat29 commented Nov 14, 2022

Kore Hardfork number tests

  • Homi recognizes --kore-compatible-blocknumber flag
    • genesis.json (local output)
    • docker-compose.yaml (docker output)
  • Node startup log contains the correct number

@mckim19
Copy link
Contributor

mckim19 commented Nov 15, 2022

Even proposer selection tests

  • probability check
    • changing staking amount
    • removing validators
    • adding validators
  • snapshot data check
    • proposers size
    • increasing/decreasing committee size

OpRandom opcode tests

  • return value check

@JayChoi1736
Copy link
Contributor

JayChoi1736 commented Nov 15, 2022

Regular QA Test

  • Sync test: succeed. no oom occured.
node instance sync period sync duration db size unusual error/warn log
baobab-EN0 i3.xlarge 0 to latest 4d 353G -
cypress-EN0 i3.2xlarge 0 to 52007590 8d 14h 1.9T -
cypress-EN1 i3.2xlarge 52007590 to 76539733 10d 15h 3.1T -
cypress-EN2 i3.2xlarge 76539733 to 85287012 10d 17h 5.1T -
cypress-EN3 i3.2xlarge 85394216 to latest  6d 21h 7.1T -
  • Load test

    • Stress: 10000 RPS load test for 1h

      • TC: transferSignedTx
      • CNSpec & TPS: c5.9xlarge(5300), c6i.8xlarge(5858)
      • version & TPS: v1.9.1(6300), v1.10.0(5858) v1.10.0-rc.2-retry(6330)
      • deriveSha & TPS: deriveSha 2 (5858), deriveSha 0 (5700)
      • block mining time : about 250ms
      • Screen Shot 2022-11-29 at 12 01 33 AM
      • Screen Shot 2022-11-29 at 12 01 18 AM
      • v1 10 0-rc 2retry
      -
    • Stability: 2000 RPS load test for 72h

      • TC: transferSignedTx, newValueTransferTC, newFeeDelegatedSmartContractExecutionTC
      • TPS: 1989 TPS
      ![stab1](https://user-images.githubusercontent.com/102955810/204257741-426fbbc9-be7b-458e-9d7f-6da45b49f25b.png) - ![stab2](https://user-images.githubusercontent.com/102955810/204257751-646d4798-4184-4e58-9932-31c24406bb0c.png)
  • Rolling Update test: PASS

  • RPC/WS test: PASS

  • Governance test: PASS

  • Reward test: PASS

  • Caver js/java test: PASS

  • API performance test:

    • TC : readBlockNumber, readGetAccount, readGetBlockByNumber, readGetBlockWithConsensusInfoByNumber
    • EN : m6i.4xlarge * 1
Version 1.9.0 1.10.0-rc.2 1.10.0-rc.3 1.10.0-rc.3 retry
readBlockNumber 217005 112967 175217 164906
readGetAccount 92448 66048 86658 94581
readGetBlockByNumber 170.98 144.57 158.79 184.83
readGetBlockWithConsensusInfoByNumber 253.42 185.82 209.42 216.90

@2dvorak
Copy link
Collaborator

2dvorak commented Nov 16, 2022

Debug API tests

  • test if debug namespace only provides "not unsafe" APIs
    • VM Tracing APIs except TraceBlockFromFile
    • Some Blockchain Inspection APIs
  • test if JS-based tracing is disabled in debug namespace

@2dvorak
Copy link
Collaborator

2dvorak commented Nov 16, 2022

Misc tests

  • test if homi allocates enough balance with --servicechain parameter
  • test if TLS certificates work fine with klaytn docker image

@ian0371
Copy link
Contributor

ian0371 commented Nov 16, 2022

KIP81 tests

Governance

  • check default governance parameters for GovParamContract
  • check if governance.vote() for GovParamContract succeeds
  • check an error when voting GovParamContract with an invalid format
  • check genesis config processing (details below)
  • check if GovParam deployed before Kore, followed by GovParam vote & setParam after Kore works

Governance Genesis

  • Inspect
    • > klay.getBlock(0).governanceData (govdata)
    • > klay.getBlock(0).baseFeePerGas
    • $ kcn init genesis.json succeeds
    • successfully produce blocks, Magma or Kore hardfork passes
  • Table legends
    • govdata = klay.getBlock(0).governanceData
    • bf = klay.getBlock(0).baseFeePerGas
    • DG = SetDefaultsForGovernance()
    • D = SetDefaults()
    • user = User-specified values in geneis.json
  • check if kcn init is backward compatible
genesis.json \ #0 fork Pre-magma Magma
Governance.KIP71 is nil - v1.9 init -> govdata={}, bf=0
- v1.10 init -> govdata={}, bf=0
- v1.10 run -> ok, Magma HF pass ✅
- v1.9 init -> govdata={}, bf=25
- v1.10 init -> govdata={}, bf=25
- v1.10 run -> ok ✅
Governance.KIP71 is set - v1.9 init -> govdata={}, bf=0
- v1.10 init -> govdata={}, bf=0
- v1.10 run -> ok, Magma HF pass ✅
- v1.9 init -> govdata={}, bf=25
- v1.10 init -> genesis hash error
- Fix JSON (set KIP71 to null)
- v1.10 init -> govdata={}, bf=25
- v1.10 run -> ok ✅
  • check if new parameters go into the genesis block if present in genesis.json
    *** In the table, "XXX is nil" means that only XXX is removed from the complete chainConfig
genesis.json \ #0 fork.GovData Pre-magma Magma Kore
Governance is nil govdata.gov={DG} ✅ govdata.gov={DG} ✅ govdata.gov={DG} ✅
Governance.Reward is nil govdata.rew={DG} ✅ govdata.rew={DG} ✅ govdata.rew={DG} ✅
Governance.KIP71 is nil govdata.kip71={} bf=nil ✅ govdata.kip71={} bf=25 ✅ govdata.kip71={} bf=25 ✅
Governance.GPContract is nil govdata.gpcontract={} ✅ govdata.gpcontract={} ✅ govdata.gpcontract={} ✅
Governance.Reward.K82ratio is nil govdata.k82ratio={} ✅ govdata.k82ratio={} ✅ govdata.k82ratio={} ✅
DeriveShaImpl is nil or 0 govdata.dshaimpl={} ✅ govdata.dshaimpl={} ✅ govdata.dshaimpl={0} ✅

Notes

  • If governance is set, governanceMode and governingNode are required; omitting them will throw an error like "governance.governancemode value is wrong"
  • If reward is set, mintingAmount, minimumStake, and ratio are required likewise
  • test code: https://github.com/ian0371/kcn-init-test

ContractEngine

  • check if contract parameters are prioritized over header governance
    • check governance.vote() does not affect governance.itemsAt() for parameters in GovParam contract
  • check contract engine is disabled when GovParamContract is invalid
  • check if ContractEngine does not panic when GovParam is faulty
    • GovParam contains a different length of names and params
    • GovParam reverts

API

  • check if governance_chainConfig() works
    • property governance.chainConfig works
    • function governance.chainConfigAt() works
    • All APIs governance.chainConfig return the hardfork numbers and the ChainID. Compare output against v1.9.1.

@kjeom
Copy link
Member

kjeom commented Nov 17, 2022

NTP time sync test

  • check whether is ntp syncing or not
  • check whether occurs the panic when sync failed
  • check whether applied parameterized ntp server by option(node flag) well
  • check whether disabled ntp check by option(node flag)

@ian0371
Copy link
Contributor

ian0371 commented Nov 17, 2022

KIP82 reward tests

Reward distribution

  • Balances are correctly increased under different ChainConfigs
Config \ Fork Pre-magma Magma Kore
DeferredTxFee=F
ProposerPolicy=0
DeferredTxFee=T
ProposerPolicy=0
DeferredTxFee=F
ProposerPolicy=2
DeferredTxFee=T
ProposerPolicy=2

Changing reward-related parameters

  • governance.vote("reward.kip82ratio", "40/60") works
    • Correctly applied
    • Rejects invalid format
  • Parameter change timing
    • at epoch blocks pre-Kore
    • at epoch blocks post-Kore

API

  • check if klay_getRewards() works
    • correctly return error on future block
    • returned spec matches with balance changes
    • correctness when DeferredTxFee=False

@yoomee1313
Copy link
Contributor

yoomee1313 commented Nov 17, 2022

  • test scnenario
    • deploy contract or prepare just input, then submit transaction and gas cost
    • get the gas cost change result before & after Kore hardfork.
  • Warm&Cold GasCost tests https://gist.github.com/holiman/174548cad102096858583c6fbbb0649a
    • check sload(0x54) gas cost changes
    • check call(0xf1, f2, f4, fa) gas cost changes
    • check balance(0x31) gas cost changes
    • check ext(0x3b, 0x3c, 0x3f) gas cost changes
    • check sstore gas cost
    • check selfdestruct gas cost
  • check refund gas cost change -> klaytn unittest will be added based ib https://eips.ethereum.org/EIPS/eip-3529 test cases
  • check modexp(0x05) precompiled contract gas cost change -> address(0x5).call(input);
  • revert the contract starting with 0xef
    • check 0xef is reverted by sendTransaction
    • check 0xef is reverted by create klaytn transaction type
    • check 0xef is reverted in create opcode

@kjeom
Copy link
Member

kjeom commented Nov 22, 2022

getLogs API tests

  • check logs returned by blockHash filtered API
  • check logs returned by block number range filtered API
  • check corner cases (null, negative range, invalid blockHash, etc...)

@kjeom
Copy link
Member

kjeom commented Dec 6, 2022

Key generation test by homi

  • check if keystore and reward file are created as intended in various generation types (cypress, baobab, ..)
  • check if the local networks with the keys are working with no any problem

@blukat29
Copy link
Contributor

blukat29 commented Dec 15, 2022

API aliases test

  • governance_chainConfig = klay_chainConfig
  • governance_chainConfigAt = klay_chainConfigAt
  • governance_nodeAddress = klay_nodeAddress
  • governance_itemsAt = klay_govParamsAt
  • governance_getStakingInfo = klay_getStakingInfo

@JayChoi1736
Copy link
Contributor

JayChoi1736 commented Dec 21, 2022

Regular QA Test

v1.10.0-rc.5

@kjhman21
Copy link
Collaborator Author

@JayChoi1736 @yoomee1313
Doesn't we need to have compatibility test with Popular Ethereum tools (Metamask, remix, etc.)?

@ian0371
Copy link
Contributor

ian0371 commented Dec 26, 2022

Ethereum tools convenience

  • MetaMask
  • web3.js
  • ethers.js
  • truffle
  • hardhat

@aidan-kwon
Copy link
Member

All QA tasks are successfully done and v1.10.0 has been released.
Close this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA QA tests for version release
Projects
None yet
Development

No branches or pull requests

9 participants