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

QA for v2.0.0 #189

Open
23 of 24 tasks
blukat29 opened this issue Dec 27, 2024 · 13 comments
Open
23 of 24 tasks

QA for v2.0.0 #189

blukat29 opened this issue Dec 27, 2024 · 13 comments

Comments

@blukat29
Copy link
Contributor

blukat29 commented Dec 27, 2024

@hyeonLewis
Copy link
Contributor

hyeonLewis commented Dec 30, 2024

EIP-7702 and KIP-228

Please find the testing code here

  • Setup:

    • homi setup --cn-num 1 --baobab --gen-type local
  • Checklist:

    • SetCodeTx. (sendRawTransaction, getTransactionReceipt)
      • Successfully SetCode to EOA.
      • Successfully unset code to EOA.
      • Can't set code to account updated EOA.
    • APIs: kaia_getAccount, kaia_isContractAccount.
    • Opcodes: EXTCODESIZE, EXTCODECOPY, EXTCODEHASH, CALL, DELEGATECALL (CALLCODE), STATICCALL.
    • Reset code of delegation contract to zero address.
    • EOAWithCode can send SmartContractExecutionTx or legacy tx
    • EOAWithCode can send ValueTransferTx to other EOA.
    • Interaction with other tx types.
      • to must be EOA without code: Failed after SetCode / Succeeded after reset.
        • TxTypeValueTransfer
        • TxTypeFeeDelegatedValueTransfer
        • TxTypeFeeDelegatedValueTransferWithRatio
        • TxTypeValueTransferMemo
        • TxTypeFeeDelegatedValueTransferMemo
        • TxTypeFeeDelegatedValueTransferMemoWithRatio
      • from must be EOA without code: Failed after SetCode / Succeeded after reset.
        • TxTypeAccountUpdate
        • TxTypeFeeDelegatedAccountUpdate
        • TxTypeFeeDelegatedAccountUpdateWithRatio
      • to must be EOA with code: Succeeded after SetCode / Failed after reset.
        • TxTypeSmartContractExecution
        • TxTypeFeeDelegatedSmartContractExecution
        • TxTypeFeeDelegatedSmartContractExecutionWithRatio
Running the script
// Start running private network
./run start

// In qa-klaytn repo
hh run src/eip-7702/main.ts

==================== SET CODE =========================
Checking code 0xAa3D17D2a89D79c8d7E3e11406C49d21d468d7F2 after set
Checking execution of eoaWithCode
Checking increment of eoaWithCode
Checking callIncrement of eoaWithCode
Checking callIncrementFromEoaWithCode of eoaWithCode
Checking delegatecallIncrement of eoaWithCode
Checking delegatecallIncrementFromEoaWithCode of eoaWithCode
Checking callcodeIncrement of eoaWithCode
Checking callcodeIncrementFromEoaWithCode of eoaWithCode

==================== TESTING OTHER TX TYPES =========================
Checking to must be EOA without code after setCode
Checking from must be EOA without code after setCode
Checking to must be EOA with code or SCA after setCode

==================== RESET CODE =========================
Resetting code of delegation contract to zero address
Checking code 0xAa3D17D2a89D79c8d7E3e11406C49d21d468d7F2 after reset

==================== TESTING OTHER TX TYPES (after reset) =========================
Checking to must be EOA without code after reset
Checking from must be EOA without code after reset
Checking to must be EOA with code or SCA after reset

==================== TESTING SET CODE AFTER ACCOUNT UPDATE =========================
Checking setCode after account update

@ian0371
Copy link
Collaborator

ian0371 commented Jan 2, 2025

KIP-226 consensus liquidity

Config

  • Prague is block 500 (homi setup --cn-num 4 --baobab-test --mnemonic test,junk --patch-address-book --prague-compatible-blocknumber 500 --gen-type docker)
  • each validator staking amounts
    • val1: CnStaking 5mil KAIA + 2 kei, ClStaking 2mil KAIA
    • val2: CnStaking 5mil KAIA + 1 kei, ClStaking 10mil KAIA
    • val3: CnStaking 5mil KAIA - 1 kei, ClStaking 4mil KAIA
    • val4: CnStaking 5mil KAIA + 1 kei
  • Setup procedures
    • Setup AddressBook and CnStakings
    • Deploy CLRegistry, WKlay
    • Register CLRegistry, WKlay to Registry
    • Register three ClStakings to CLRegistry
    • Mint wKAIA to CLPools
Setup commands

Run from system-contracts@9447770:

  1. Write .env file (CN1-4, CLREG, WKAIA address can change)
HARDHAT_NETWORK=homi
ETH_RPC_URL=http://localhost:8551
PRIVKEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
OWNER=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 # for CLRegistry

NODEID1=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
NODEID2=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
NODEID3=0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
CLPOOL1=0x0000000000000000000000000000000000000001
CLPOOL2=0x0000000000000000000000000000000000000002
CLPOOL3=0x0000000000000000000000000000000000000003


CN1=0x5FbDB2315678afecb367f032d93F642f64180aa3
CN2=0xa513E6E4b8f2a923D98304ec87F64353C4D5C853
CN3=0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0
CN4=0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE
CLREG=0xEecd48cdFF8ccC808D8bf55225F9e0E519735445
WKAIA=0xf5059a5D33d5853360D16C683c16e67980206f36
  1. Add/modify contracts
    2-1. wKlay
pragma solidity 0.8.25;

import "openzeppelin-contracts-5.0/token/ERC20/ERC20.sol";
import {Ownable} from "openzeppelin-contracts-5.0/access/Ownable.sol";

contract WKlay is ERC20, Ownable {
  constructor(address initialOwner) ERC20("wrapped KLAY", "wKLAY") Ownable(initialOwner) {}

  function mint(address to, uint256 amount) public onlyOwner {
      _mint(to, amount);
  }
}

2-2. CnStakingV2

diff --git a/contracts/consensus/CnV2/CnStakingV2.sol b/contracts/consensus/CnV2/CnStakingV2.sol
index 9da1f49..856f5a3 100644
--- a/contracts/consensus/CnV2/CnStakingV2.sol
+++ b/contracts/consensus/CnV2/CnStakingV2.sol
@@ -75,7 +75,7 @@ import "../IAddressBook.sol";
contract CnStakingV2 is ICnStakingV2 {
   // Constants
   // - Constants are defined as virtual functions to allow easier unit tests.
-    uint256 public constant ONE_WEEK = 1 weeks;
+    uint256 public constant ONE_WEEK = 0 seconds;

   function MAX_ADMIN() public view virtual override returns (uint256) {
       return 50;
@@ -863,7 +863,7 @@ contract CnStakingV2 is ICnStakingV2 {
       require(request.value <= staking, "Value is not withdrawable.");
       require(request.withdrawableFrom <= block.timestamp, "Not withdrawable yet.");

-        uint256 withdrawableUntil = request.withdrawableFrom + STAKE_LOCKUP();
+        uint256 withdrawableUntil = request.withdrawableFrom + 1 weeks;
       if (withdrawableUntil <= block.timestamp) {
           request.state = WithdrawalStakingState.Canceled;
           unstaking -= request.value;

2-3. deploy/wklay_deploy.ts

import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";

const name = "WKlay";

const func: DeployFunction = async ({ deployments }: HardhatRuntimeEnvironment) => {
const { deployer } = await hre.getNamedAccounts();

const res = await deployments.deploy(name, {
  from: deployer,
  args: [deployer],
  log: true,
});

console.log(`${name} deployed at ${res.address}`);
};

func.tags = [name];
export default func;
  1. Run script
homi setup --cn-num 4 --baobab-test --mnemonic test,junk --patch-address-book --prague-compatible-blocknumber 500 --docker-image-id yum3/kaia:v2.0.0-rc.5 --gen-type docker

# Abook Init
npx ts-node script/commander.ts abook init --num 4

# Setup balance
cast send $CN1 --value 1 --private-key $PRIVKEY
cast balance $CN1

cast send $CN3 "submitApproveStakingWithdrawal(address to, uint256 value)" 0x000000000000000000000000000000000000dead 2 --private-key $PRIVKEY
sleep 1
cast send $CN3 "withdrawApprovedStaking(uint256)" 0 --private-key $PRIVKEY
cast balance $CN3

# Deploy
hh deploy --tags CLRegistry,WKlay --reset

# Register to Registry
BLOCK_NUMBER=$(($(cast rpc eth_getBlockByNumber latest false | jq .number) + 20))
npx ts-node script/commander.ts reg register WrappedKaia $WKAIA $BLOCK_NUMBER
npx ts-node script/commander.ts reg register CLRegistry $CLREG $BLOCK_NUMBER

# Register to CLRegistry
npx ts-node script/commander.ts clreg add $NODEID1 1 $CLPOOL1 $CLPOOL1
npx ts-node script/commander.ts clreg add $NODEID2 2 $CLPOOL2 $CLPOOL2
npx ts-node script/commander.ts clreg add $NODEID3 3 $CLPOOL3 $CLPOOL3

# Mint wKAIA
cast send $WKAIA "mint(address to, uint256 amount)" $CLPOOL1 2000000ether --private-key $PRIVKEY
cast send $WKAIA "mint(address to, uint256 amount)" $CLPOOL2 10000000ether --private-key $PRIVKEY
cast send $WKAIA "mint(address to, uint256 amount)" $CLPOOL3 4000000ether --private-key $PRIVKEY

cast call $WKAIA "balanceOf(address to)(uint256)" $CLPOOL1
cast call $WKAIA "balanceOf(address to)(uint256)" $CLPOOL2
cast call $WKAIA "balanceOf(address to)(uint256)" $CLPOOL3

Result

  • GetStakingInfo(500) has ClStakingInfo
  • Rewards are distributed from block 500
  • CnStaking < 5 mil is ineligible
API results

Input

cast rpc kaia_getStakingInfo 499 -r homi| jq
cast rpc kaia_getStakingInfo 500 -r homi| jq

cast rpc kaia_getBalance $CLPOOL1 499
cast rpc kaia_getBalance $CLPOOL1 500
cast rpc kaia_getBalance $CLPOOL1 501
cast rpc kaia_getBalance $CLPOOL1 502
cast rpc kaia_getBalance $CLPOOL1 503

cast rpc kaia_getBalance $CLPOOL2 499
cast rpc kaia_getBalance $CLPOOL2 500
cast rpc kaia_getBalance $CLPOOL2 501
cast rpc kaia_getBalance $CLPOOL2 502
cast rpc kaia_getBalance $CLPOOL2 503

cast rpc kaia_getBalance $CLPOOL3 499
cast rpc kaia_getBalance $CLPOOL3 500
cast rpc kaia_getBalance $CLPOOL3 501
cast rpc kaia_getBalance $CLPOOL3 502
cast rpc kaia_getBalance $CLPOOL3 503

Output

+ cast rpc kaia_getStakingInfo 499
+ jq
{
  "blockNum": 498,
  "councilNodeAddrs": [
    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
  ],
  "councilStakingAddrs": [
    "0x5fbdb2315678afecb367f032d93f642f64180aa3",
    "0xa513e6e4b8f2a923d98304ec87f64353c4d5c853",
    "0xa51c1fc2f0d1a1b8494ed1fe312d7c3a78ed91c0",
    "0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae"
  ],
  "councilRewardAddrs": [
    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
  ],
  "kefAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "kifAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "councilStakingAmounts": [
    5000000,
    5000000,
    4999999,
    5000000
  ],
  "clStakingInfos": null,
  "KIRAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "PoCAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "kcfAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "kffAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "useGini": false,
  "gini": 0
}
+ jq
+ cast rpc kaia_getStakingInfo 500
{
  "blockNum": 499,
  "councilNodeAddrs": [
    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
  ],
  "councilStakingAddrs": [
    "0x5fbdb2315678afecb367f032d93f642f64180aa3",
    "0xa513e6e4b8f2a923d98304ec87f64353c4d5c853",
    "0xa51c1fc2f0d1a1b8494ed1fe312d7c3a78ed91c0",
    "0x9a9f2ccfde556a7e9ff0848998aa4a0cfd8863ae"
  ],
  "councilRewardAddrs": [
    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
    "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
    "0x90f79bf6eb2c4f870365e785982e1f101e93b906"
  ],
  "kefAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "kifAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "councilStakingAmounts": [
    5000000,
    5000000,
    4999999,
    5000000
  ],
  "clStakingInfos": [
    {
      "clNodeId": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
      "clPoolAddr": "0x0000000000000000000000000000000000000001",
      "clStakingAmount": 2000000
    },
    {
      "clNodeId": "0x70997970c51812dc3a010c7d01b50e0d17dc79c8",
      "clPoolAddr": "0x0000000000000000000000000000000000000002",
      "clStakingAmount": 10000000
    },
    {
      "clNodeId": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
      "clPoolAddr": "0x0000000000000000000000000000000000000003",
      "clStakingAmount": 4000000
    }
  ],
  "KIRAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "PoCAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "kcfAddr": "0x322813fd9a801c5507c9de605d63cea4f2ce6c44",
  "kffAddr": "0xa85233c63b9ee964add6f2cffe00fd84eb32338f",
  "useGini": false,
  "gini": 0.25
}
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000001 499
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000001 500
"0x45062eca7e49248"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000001 501
"0x60a24181e3ffffe"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000001 502
"0x7c3e543949b6db4"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000001 503
"0x97da66f0af6db6a"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000002 499
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000002 500
"0x1421cda5ba2aaaaa"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000002 501
"0x2e4dbf6392955554"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000002 502
"0x426f8d094cbffffe"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000002 503
"0x56915aaf06eaaaa8"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000003 499
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000003 500
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000003 501
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000003 502
"0x0"
+ cast rpc kaia_getBalance 0x0000000000000000000000000000000000000003 503
"0x0"

@hyunsooda
Copy link
Contributor

hyunsooda commented Jan 6, 2025

  • Migration @hyunsooda
    • Use new schema if syncing from genesis
      • Node started with rc
    • Upgrade from v1.0.3. Finish migration in one node run.
      • Node started with v1.0.3 (to be restarted with replacement(rc))
    • Upgrade from v1.0.3. Node restarts and migration continues.
      • Same condition with the right above and repeating restart before migration is completed
    • Node start with rc on chaindata snapshot. (valset module migration)

@hyeonLewis
Copy link
Contributor

hyeonLewis commented Jan 7, 2025

KIP-226 consensus liquidity for on-chain governance

  • Setup:
    • Prepare mainnet fork network
  • Checklist:
    • Successfully migrate to StakingTrackerV2
      • Voting
      • CnStakingV2, V3
    • Successfully tracks CN, CL staking
      • CnStakingV2, V3
      • CLRegistry
  • Process
    • Successfully migrate to StakingTrackerV2:
      1. Deploy a new STv2
      2. Make a proposal on Voting to update ST (ST -> STv2)
      3. After passing (2), update all CnStakingV2, V3 to STv2
      4. After passing(3), call refreshVoter(staking) to new STv2
      5. Make a new proposal on Voting and check a new STv2 tracks all CnStakings.
    • Successfully tracks CN, CL staking
      1. After above, deploy CLRegistry, MockCLPool contracts.
      2. Register MockCLPools to CLRegistry.
      3. Register CLRegistry, WrappedKaia to SystemRegistry.
      4. Fund CLPool with WrappedKaia.
      5. Make a new proposal on Voting and check a new STv2 tracks all CNs and CLs.

@2dvorak
Copy link
Contributor

2dvorak commented Jan 7, 2025

p2p changes

  • In a 1-CN, 10-PN, 2-BN, 1-EN test network.
    • (BN) Respond findnode with up to 2 PNs
      • failed, will be fixed in rc.2
    • (EN) Correctly process neighbor responses
  • Against Kairos BN
    • (EN) Discovered nodes survive node restart
Details

QA with a 1-CN, 10-PN, 2-BN, 1-EN test network

setup

Setup a test network with docker compose ref
Added one more BN to the reference docker-compose.yml

  BN-1:
    hostname: BN-1
    image: qa-2.0.0
    entrypoint:
      - /bin/sh
      - -c
      - |
        mkdir -p /etc/kbnd/keystore
        mkdir -p /etc/kbnd/logs
        mkdir -p /etc/kbnd/data
        echo '28569c688eb8f0fb61d5f781e4a2071191252439829b0db57c451f1d625bdafe' > /etc/kbnd/keystore/nodekey
        echo "# docker-compose" >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'NETWORK=""' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'RPC_ENABLE=1' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'RPC_API="db,eth,klay,net,governance,web3,miner,personal,txpool,debug,admin,istanbul,mainbridge,subbridge"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'NETWORK_ID="2018"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN0="kni://cb4b1eb548eecf94b11b1d6dd62675fd37a14f764db8933d7dc0848a461492c44f5228b3772d42de352400d3824410c8ef08fcd241a9d552ec6d3ca090e94b5e@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN1="kni://b42bd404ec11bfffcbea41a32768b7c2b4d49b7c7a086daf836056f917af63b498134f8b1381cdfcc71e5728da26a1a99c7ae51e066b4c977f6616d698b2cc9c@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN2="kni://f20b86d6a4f1483f5aa1ae4c10109e2862d3c6673b3b4c78edf9f50ff211d5576a69dab424f8efafd43a801c8b340a9c9421efa155bd61285c5da0fa51c8613a@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN3="kni://695adaf11c73f180aef1369a569da83743b6740b92a98617bc08e9507d05a0448a40190a6627ca16da6adbf2bf2152de8262d2874e9a4822adad96a1da3395df@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN4="kni://55f6ea1ba83bf7b4c85ef07daa3c17db37be375687d66a1101b7f259557be7678d73fcd96df112c2154d756e51390f1a577a57414d23ac97a53121512d2f5826@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN5="kni://42021e3f561c9ffe1ec06b296b80bd6befa2748f15f03337048dd5559f9d1e0100bba9e300bdac356fe716e5502b7caa6ffda6c680afbd7d7851ce10f233ca22@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN6="kni://d52d93a73679b935644b8984e4d09d13b638043c78dc3dd7f7ac1570b4212188c5b8f331be0be6651cb6f6b92598b11ed9b828bc98363d81c2ff7a80954b73d7@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN7="kni://766ebbe03aa49c14f0dba53791c08ff7891437e0418e9f44f7cc3a703bae1e2878723f5419146f9970f4ec3b35f3d84c19bb64ab878cffd51bfb10d4ec4faa1e@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN8="kni://209bbdea9a7adce83bba184a6e50e5a548a1bbff8c19a5aac530f3920998970a9c99623a5014b5f21f84d438dc539589affe7b48f16de83d4cdd58ac60c2f636@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'PN9="kni://ba06e9cceb45b37ae9faeb07a79d218f47d7bc2ebb175efb580692903beaec7389c325d2051c89b56a35dd4973b0d5aaafa259a1aa8bb77eea61c118ec73fbb8@[::]:32323?ntype=pn"' >> /klaytn-docker-pkg/conf/kbnd.conf
        echo 'AUTHORIZED_NODES="$${PN0},$${PN1},$${PN2},$${PN3},$${PN4},$${PN5},$${PN6},$${PN7},$${PN8},$${PN9}"' >> /klaytn-docker-pkg/conf/kbnd.conf
        /klaytn-docker-pkg/bin/kbnd start
        tail -F /etc/kbnd/logs/kbnd.out
    networks:
      app_net:
        ipv4_address: 172.16.239.23
    restart: "no"

Also, added log messages to inspect p2p internals.

--- a/networks/p2p/discover/udp.go
+++ b/networks/p2p/discover/udp.go
@@ -740,6 +740,10 @@ func (req *findnode) handle(t *udp, from *net.UDPAddr, fromID NodeID, mac []byte
        retrieveSize := findnodeRetrieveSize(req.TargetType)
        closest := t.RetrieveNodes(target, req.TargetType, retrieveSize)

+       if req.TargetType == NodeTypePN {
+               logger.Error("udp: findnode: closest", "closest", closest, "len", len(closest))
+       }
+
        // Send neighbors in chunks with at most maxNeighbors per packet
        // to stay below the 1280 byte limit.
--- a/networks/p2p/discover/table.go
+++ b/networks/p2p/discover/table.go
@@ -293,6 +293,9 @@ func (tab *Table) findNewNode(seeds *nodesByDistance, targetID NodeID, targetNT
                seeds.entries = removeBn(seeds.entries)
        }
        tab.localLogger.Debug("findNewNode: found nodes", "length", len(seeds.entries), "nodeType", targetNT)
+       if targetNT == NodeTypePN {
+               logger.Error("findNewNode: found nodes", "length", len(seeds.entries), "nodeType", targetNT, "entries", seeds.entries)
+       }
        return seeds.entries
 }
result

In the v1.0.3 version, we could see more than 2 PNs responded in the neighbors msg:

BN-0-1  | ERROR[01/10,03:13:16 Z] [34] udp: findnode: closest                    closest="[kni://42021e3f561c9ffe1ec06b296b80bd6befa2748f15f03337048dd5559f9d1e0100bba9e300bdac356fe716e5502b7caa6ffda6c680afbd7d7851ce10f233ca22@172.16.239.16:32323?ntype=pn kni://f20b86d6a4f1483f5aa1ae4c10109e2862d3c6673b3b4c78edf9f50ff211d5576a69dab424f8efafd43a801c8b340a9c9421efa155bd61285c5da0fa51c8613a@172.16.239.13:32323?ntype=pn kni://b42bd404ec11bfffcbea41a32768b7c2b4d49b7c7a086daf836056f917af63b498134f8b1381cdfcc71e5728da26a1a99c7ae51e066b4c977f6616d698b2cc9c@172.16.239.12:32323?ntype=pn kni://d52d93a73679b935644b8984e4d09d13b638043c78dc3dd7f7ac1570b4212188c5b8f331be0be6651cb6f6b92598b11ed9b828bc98363d81c2ff7a80954b73d7@172.16.239.17:32323?ntype=pn kni://55f6ea1ba83bf7b4c85ef07daa3c17db37be375687d66a1101b7f259557be7678d73fcd96df112c2154d756e51390f1a577a57414d23ac97a53121512d2f5826@172.16.239.15:32323?ntype=pn kni://ba06e9cceb45b37ae9faeb07a79d218f47d7bc2ebb175efb580692903beaec7389c325d2051c89b56a35dd4973b0d5aaafa259a1aa8bb77eea61c118ec73fbb8@172.16.239.20:32323?ntype=pn kni://695adaf11c73f180aef1369a569da83743b6740b92a98617bc08e9507d05a0448a40190a6627ca16da6adbf2bf2152de8262d2874e9a4822adad96a1da3395df@172.16.239.14:32323?ntype=pn kni://766ebbe03aa49c14f0dba53791c08ff7891437e0418e9f44f7cc3a703bae1e2878723f5419146f9970f4ec3b35f3d84c19bb64ab878cffd51bfb10d4ec4faa1e@172.16.239.18:32323?ntype=pn kni://209bbdea9a7adce83bba184a6e50e5a548a1bbff8c19a5aac530f3920998970a9c99623a5014b5f21f84d438dc539589affe7b48f16de83d4cdd58ac60c2f636@172.16.239.19:32323?ntype=pn kni://cb4b1eb548eecf94b11b1d6dd62675fd37a14f764db8933d7dc0848a461492c44f5228b3772d42de352400d3824410c8ef08fcd241a9d552ec6d3ca090e94b5e@172.16.239.11:32323?ntype=pn]" len=10

In the rc.1 version, we have 10 PNs although our intended change was to return 2 PNs (This will be fixed in the rc.2 version).

BN-0-1  | ERROR[01/10,03:18:29 Z] [34] udp: findnode: closest                    closest="[kni://b42bd404ec11bfffcbea41a32768b7c2b4d49b7c7a086daf836056f917af63b498134f8b1381cdfcc71e5728da26a1a99c7ae51e066b4c977f6616d698b2cc9c@172.16.239.12:32323?ntype=pn kni://695adaf11c73f180aef1369a569da83743b6740b92a98617bc08e9507d05a0448a40190a6627ca16da6adbf2bf2152de8262d2874e9a4822adad96a1da3395df@172.16.239.14:32323?ntype=pn kni://cb4b1eb548eecf94b11b1d6dd62675fd37a14f764db8933d7dc0848a461492c44f5228b3772d42de352400d3824410c8ef08fcd241a9d552ec6d3ca090e94b5e@172.16.239.11:32323?ntype=pn kni://209bbdea9a7adce83bba184a6e50e5a548a1bbff8c19a5aac530f3920998970a9c99623a5014b5f21f84d438dc539589affe7b48f16de83d4cdd58ac60c2f636@172.16.239.19:32323?ntype=pn kni://d52d93a73679b935644b8984e4d09d13b638043c78dc3dd7f7ac1570b4212188c5b8f331be0be6651cb6f6b92598b11ed9b828bc98363d81c2ff7a80954b73d7@172.16.239.17:32323?ntype=pn kni://ba06e9cceb45b37ae9faeb07a79d218f47d7bc2ebb175efb580692903beaec7389c325d2051c89b56a35dd4973b0d5aaafa259a1aa8bb77eea61c118ec73fbb8@172.16.239.20:32323?ntype=pn kni://42021e3f561c9ffe1ec06b296b80bd6befa2748f15f03337048dd5559f9d1e0100bba9e300bdac356fe716e5502b7caa6ffda6c680afbd7d7851ce10f233ca22@172.16.239.16:32323?ntype=pn kni://f20b86d6a4f1483f5aa1ae4c10109e2862d3c6673b3b4c78edf9f50ff211d5576a69dab424f8efafd43a801c8b340a9c9421efa155bd61285c5da0fa51c8613a@172.16.239.13:32323?ntype=pn kni://766ebbe03aa49c14f0dba53791c08ff7891437e0418e9f44f7cc3a703bae1e2878723f5419146f9970f4ec3b35f3d84c19bb64ab878cffd51bfb10d4ec4faa1e@172.16.239.18:32323?ntype=pn kni://55f6ea1ba83bf7b4c85ef07daa3c17db37be375687d66a1101b7f259557be7678d73fcd96df112c2154d756e51390f1a577a57414d23ac97a53121512d2f5826@172.16.239.15:32323?ntype=pn]" len=10

In the rc.2 version, we have up to 2 PNs although there are 10 PNs in the test network.

BN-0-1  | ERROR[01/24,06:07:48 Z] [34] udp: findnode: closest                    closest="[kni://695adaf11c73f180aef1369a569da83743b6740b92a98617bc08e9507d05a0448a40190a6627ca16da6adbf2bf2152de8262d2874e9a4822adad96a1da3395df@172.16.239.14:32323?ntype=pn kni://55f6ea1ba83bf7b4c85ef07daa3c17db37be375687d66a1101b7f259557be7678d73fcd96df112c2154d756e51390f1a577a57414d23ac97a53121512d2f5826@172.16.239.15:32323?ntype=pn]" len=2
BN-0-1  | ERROR[01/24,06:07:49 Z] [34] udp: findnode: closest                    closest="[kni://cb4b1eb548eecf94b11b1d6dd62675fd37a14f764db8933d7dc0848a461492c44f5228b3772d42de352400d3824410c8ef08fcd241a9d552ec6d3ca090e94b5e@172.16.239.11:32323?ntype=pn kni://d52d93a73679b935644b8984e4d09d13b638043c78dc3dd7f7ac1570b4212188c5b8f331be0be6651cb6f6b92598b11ed9b828bc98363d81c2ff7a80954b73d7@172.16.239.17:32323?ntype=pn]" len=2
BN-0-1  | ERROR[01/24,06:07:49 Z] [34] udp: findnode: closest                    closest="[kni://209bbdea9a7adce83bba184a6e50e5a548a1bbff8c19a5aac530f3920998970a9c99623a5014b5f21f84d438dc539589affe7b48f16de83d4cdd58ac60c2f636@172.16.239.19:32323?ntype=pn kni://ba06e9cceb45b37ae9faeb07a79d218f47d7bc2ebb175efb580692903beaec7389c325d2051c89b56a35dd4973b0d5aaafa259a1aa8bb77eea61c118ec73fbb8@172.16.239.20:32323?ntype=pn]" len=2
BN-0-1  | ERROR[01/24,06:07:49 Z] [34] udp: findnode: closest                    closest="[kni://42021e3f561c9ffe1ec06b296b80bd6befa2748f15f03337048dd5559f9d1e0100bba9e300bdac356fe716e5502b7caa6ffda6c680afbd7d7851ce10f233ca22@172.16.239.16:32323?ntype=pn kni://b42bd404ec11bfffcbea41a32768b7c2b4d49b7c7a086daf836056f917af63b498134f8b1381cdfcc71e5728da26a1a99c7ae51e066b4c977f6616d698b2cc9c@172.16.239.12:32323?ntype=pn]" len=2

In the v1.0.3 version, we could see that EN is more likely to get empty result when we have more than 2 BNs.

EN-0-1  | ERROR[01/10,02:54:28 Z] [34|networks/p2p/discover/table.go:297]                    findNewNode: found nodes                  length=0 nodeType=2 entries=[]
EN-0-1  | ERROR[01/10,02:54:32 Z] [34|networks/p2p/discover/table.go:297]                    findNewNode: found nodes                  length=0 nodeType=2 entries=[]

In the rc version, we could see that BNs are removed and PNs are filled correctly.

EN-0-1  | ERROR[01/10,03:01:33 Z] [34|networks/p2p/discover/table.go:297]  findNewNode: found nodes                  length=2 nodeType=2 entries="[kni://cb4b1eb548eecf94b11b1d6dd62675fd37a14f764db8933d7dc0848a461492c44f5228b3772d42de352400d3824410c8ef08fcd241a9d552ec6d3ca090e94b5e@172.16.239.11:32323?ntype=pn kni://42021e3f561c9ffe1ec06b296b80bd6befa2748f15f03337048dd5559f9d1e0100bba9e300bdac356fe716e5502b7caa6ffda6c680afbd7d7851ce10f233ca22@172.16.239.16:32323?ntype=pn]"

QA using Kairos BN

setup

To reduce noise, remove EN and BN in discovered nodes. Also, increase PN entry as it might help exhausting PNs to be discovered.

--- a/networks/p2p/discover/table.go
+++ b/networks/p2p/discover/table.go
@@ -159,9 +159,9 @@ func newTable(cfg *Config) (Discovery, error) {
                tab.addStorage(NodeTypeEN, &KademliaStorage{targetType: NodeTypeEN, noDiscover: true})
                tab.addStorage(NodeTypeBN, &simpleStorage{targetType: NodeTypeBN, noDiscover: true, max: 3})
        case NodeTypeEN:
-               tab.addStorage(NodeTypePN, &simpleStorage{targetType: NodeTypePN, noDiscover: true, max: 2})
-               tab.addStorage(NodeTypeEN, &KademliaStorage{targetType: NodeTypeEN})
-               tab.addStorage(NodeTypeBN, &simpleStorage{targetType: NodeTypeBN, noDiscover: true, max: 3})
+               tab.addStorage(NodeTypePN, &simpleStorage{targetType: NodeTypePN, noDiscover: true, max: 8})
+               //tab.addStorage(NodeTypeEN, &KademliaStorage{targetType: NodeTypeEN})
+               //tab.addStorage(NodeTypeBN, &simpleStorage{targetType: NodeTypeBN, noDiscover: true, max: 3})
        case NodeTypeBN:
                tab.addStorage(NodeTypeCN, NewSimpleStorage(NodeTypeCN, true, 100, cfg.AuthorizedNodes))
                tab.addStorage(NodeTypePN, NewSimpleStorage(NodeTypePN, true, 100, cfg.AuthorizedNodes))
result

In v1.0.3, after several restarts, EN has hard time discovering PNs:

INFO[01/07,09:46:20 +09] [35] Mapped network port                       protobuf=tcp extport=32323 intport=32323 interface=NAT-PMP(192.168.0.1)
WARN[01/07,09:46:21 +09] [34] RetrieveNodes: Not Supported NodeType     Discover=Table NodeType=3
WARN[01/07,09:46:24 +09] [34] lookup: Not Supported NodeType            Discover=Table NodeType=3
WARN[01/07,09:46:24 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
ERROR[01/07,09:46:25 +09] [34] findNewNode: found nodes                  length=0 nodeType=2 entries=[]
WARN[01/07,09:46:25 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
WARN[01/07,09:46:25 +09] [34] RetrieveNodes: Not Supported NodeType     Discover=Table NodeType=3
WARN[01/07,09:46:26 +09] [34] RetrieveNodes: Not Supported NodeType     Discover=Table NodeType=3
WARN[01/07,09:46:28 +09] [34] lookup: Not Supported NodeType            Discover=Table NodeType=3
WARN[01/07,09:46:28 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
ERROR[01/07,09:46:29 +09] [34] findNewNode: found nodes                  length=0 nodeType=2 entries=[]
WARN[01/07,09:46:29 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
WARN[01/07,09:46:29 +09] [34] RetrieveNodes: Not Supported NodeType     Discover=Table NodeType=3
WARN[01/07,09:46:32 +09] [34] lookup: Not Supported NodeType            Discover=Table NodeType=3
WARN[01/07,09:46:32 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
ERROR[01/07,09:46:33 +09] [34] findNewNode: found nodes                  length=0 nodeType=2 entries=[]
WARN[01/07,09:46:33 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
WARN[01/07,09:46:34 +09] [34] RetrieveNodes: Not Supported NodeType     Discover=Table NodeType=3
WARN[01/07,09:46:36 +09] [34] lookup: Not Supported NodeType            Discover=Table NodeType=3
WARN[01/07,09:46:36 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
ERROR[01/07,09:46:37 +09] [34] findNewNode: found nodes                  length=0 nodeType=2 entries=[]
WARN[01/07,09:46:37 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3

However in v2.0.0-rc.1, using the same data directory, EN could find PN right away:

INFO[01/07,09:48:33 +09] [35] Mapped network port                       protobuf=tcp extport=32323 intport=32323 interface=NAT-PMP(192.168.0.1)
INFO[01/07,09:48:33 +09] [62] ValsetModule migrate complete
WARN[01/07,09:48:36 +09] [34] add(): Not Supported NodeType             Discover=Table NodeType=3
WARN[01/07,09:48:37 +09] [34] lookup: Not Supported NodeType            Discover=Table NodeType=3
WARN[01/07,09:48:37 +09] [34] ReadRandomNodes: Not Supported NodeType   Discover=Table NodeType=3
WARN[01/07,09:48:37 +09] [34] add(): Not Supported NodeType             Discover=Table NodeType=3
ERROR[01/07,09:48:38 +09] [34] findNewNode: found nodes                  length=1 nodeType=2 entries="[kni://fa7bebd3d535a5956acfe13914dee84cf93ad8aeba013cdd0dc7445473b44660280e909e641860450150f0da48de8296c53528ac57602c63cddaf42116526a05@147.92.173.40:32323?ntype=pn]"
INFO[01/07,09:48:38 +09] [33] [Dial] Add dial candidate from static nodes  id=fa7bebd3d535a595 NodeType=2 ip=147.92.173.40 mainPort=32323 port=[32323]

RPC API changes

  • TotalDifficulty and BlockScore fields removal #134
Details

We can see the difference in the rpc responses.

v1.0.3

> eth.getHeaderByNumber(kaia.blockNumber)
{
  baseFeePerGas: "0x5d21dba00",
  difficulty: "0x1",
  extraData: "0x",
  gasLimit: "0xe8d4a50fff",
  gasUsed: "0x0",
  hash: "0x3f7866da9b0e2512b89f8037b8f5052e0775b73923e8751e12eccbee9998745e",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
  mixHash: "0x2e3370ac7b949a1659aec155e3f94b76c7b3071d2382818df77c713c7ffc9519",
  nonce: "0x0000000000000000",
  number: "0x67",
  parentHash: "0x170d8331910c0d6f89180c95711307618a4206c92d6264273d01a14e5f458d47",
  randomReveal: "0xa2d40a24e97357c99d15f750635ad3391cde8191ede5ec5c43154db090c1174f89573c40b6a61689346aa88ed07944a10676ffbad859433dabaa5c35627eba1d5c7f81e7b49808d5e56ca0482835e03e5bf4b80f4138ce7a83bb0e452ef07272",
  receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: "0x388",
  stateRoot: "0xc50887dc933b1dc81388f609c454541d3498e7cb919589b4f023cf13ef22b216",
  timestamp: "0x677c6a8a",
  totalDifficulty: "0x68",
  transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
}
> kaia.getBlock(kaia.blockNumber)
{
  baseFeePerGas: "0x5d21dba00",
  blockScore: "0x1",
  extraData: "0xd883010003846b6c617988676f312e32322e31856c696e757800000000000000f89ed594f39fd6e51aad88f6f4ce6ab8827279cfffb92266b841b1b2c6657b4eb269a0b38fe701973e72a49ac4723b47768299542cfc8b17d6481841ef0fd3713507a06447660c303a41e209e32c2bbd10e12aa78da757e9fd8000f843b8415623914f378eb02531b516147ae0bd9c336ed673257aca3342b5c0ec7a6732316a76adb3a057a7496a3cca98e1a75e572926c39c9adc693a6189d282f3a56d2f00",
  gasUsed: 0,
  governanceData: "0x",
  hash: "0x758b16f68448949465502dc0245f878f576165af491654f2915bbace595fe717",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  mixHash: "0xc9717f8c41aa21274c6798c6fca038c86bb15d7ee0fde94e90b980787604f324",
  number: 295,
  parentHash: "0xf43d9b0b6bacd2e1e9987f20839a962f0d0e00a3fdcd41b0168a2d9b959916e1",
  randomReveal: "0x8fe0f5ccb6869410cd84529588306e695488236f65523cd3abd88ebe8fbdd98ab42671cd5727e6ec002ccbcb1308fa2618b641908469c6256b52704366aca538d7c31b9bf682843a904ba7e4b1a49ac38d17de771a1b4fb33918f83fe428cc11",
  receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  reward: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
  size: 763,
  stateRoot: "0x49cecdb82e9ad18f2a69f3f5815ca2a90a67d3db272688cfb0c8b2a3efd530a4",
  timestamp: 1736207178,
  timestampFoS: 97,
  totalBlockScore: "0x128",
  transactions: [],
  transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  voteData: "0x"
}

v2.0.0-rc.1

> eth.getHeaderByNumber(kaia.blockNumber)
{
  baseFeePerGas: "0x5d21dba00",
  difficulty: "0x1",
  extraData: "0x",
  gasLimit: "0xe8d4a50fff",
  gasUsed: "0x0",
  hash: "0xdb6de1e06186c07d7ba9e1dbdad97613943d40176ed290256b04eb0dacd82663",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
  mixHash: "0xa1213bb8b268729e2b038c526064eca3f0c966b47a9877c6cdeb1efa575277d5",
  nonce: "0x0000000000000000",
  number: "0x36",
  parentHash: "0x0618ba50dd8c0ca87bf0d906c0e5ec5ad22e2f59a4e1d776dbfcd53081c8d0d1",
  randomReveal: "0xb9e53401ceb6090a68a50ddf7a15fb1fd3cc02c5e15fe26a40ea5095943b6e53f3cd9e1c02ca88bf264fbf110aed36ab0ab571f03b714179dcdcbf52ea953f5972b8b71972cdd5838c2a37b0b11b21422e36939510cda015caa0f8af4927b2a2",
  receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: "0x388",
  stateRoot: "0xf453b591d1b24c96b7a7b3f1b849c50750296e702027c451c0aa695d90ea4e62",
  timestamp: "0x677c6bc5",
  transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
}
> kaia.getBlock(kaia.blockNumber)
{
  baseFeePerGas: "0x5d21dba00",
  blockScore: "0x1",
  extraData: "0xd883020000846b6c617988676f312e32322e31856c696e757800000000000000f89ed594f39fd6e51aad88f6f4ce6ab8827279cfffb92266b8416beca5282d9435db35e0cc1f00e63d0c2e24523c4c53560b7703c2cf0cb49c3e51f8557a92d0d6adaa80e180367a79f4a88d5f5d1c0dd55b40accf98946723d401f843b841023bd656a44bf675d6fc554857952fd86b8d96758805faaeafb381ee033951602c2479c2ac1de84f6f28fb95ed4c6833c30ea4ce49519ee610e7a5171cbc571d01",
  gasUsed: 0,
  governanceData: "0x",
  hash: "0xa368575de4091eb6d375513b64bec0c1e1f9a7405ef4c83e2dc19f0ecc8d8b40",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  mixHash: "0x197c47cfc39ba01ee2fa105e8eda28506b0e2a7cb43bdf191950b376df47f66d",
  number: 65,
  parentHash: "0x346b244097818ba78a2e86df61b5de228ad8569139e79a02b44a605571fb1206",
  randomReveal: "0xb4bebc3b81c721e4b3179b0d3928a69d9204d468f35dcbabd00a94bf7d3bbbf3480c577b4b87a9de315746526278056a09f19629e92efe7d39de165edf7c069a79af8e535acb2ca2a8d311a5349ddbe62637a6202e64cc6e9a0cf42f2185dc7a",
  receiptsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  reward: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
  size: 761,
  stateRoot: "0x8eb5b37a9de7424c8d7337b54e528776aac0bbd68c4cf0035c66558a12425caa",
  timestamp: 1736207312,
  timestampFoS: 87,
  transactions: [],
  transactionsRoot: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
  voteData: "0x"
}

p2p: Add discover-types flag ((PN) Reports itself to the BN)

setting: deploy private network cn4/pn4/en4/bn1
expected: each node types should connect to the supported node types and --discover-types only works for only supported node types.
actual: all correct as each nodes are connected to the supported node types only

Result

CN admin.peers:

  • CN1: 3 CNs
  • CN2: 3 CNs
  • CN3: 3 CNs
  • CN4: 3 CNs

PN admin.peers:

  • PN1: 1PN, 3EN
  • PN2: 1PN, 1EN
  • PN3: 3PN, 2EN
  • PN4: 1pn, 2EN

EN admin.peers

  • EN1: 2PN, 3EN
  • EN2: 2PN, 3EN
  • EN3: 2PN, 3EN
  • EN4: 2PN, 3EN

CN1 with --discover-types option

  • --discover-types cn: only cns are connected
  • --discover-types pn: crit with Cannot enable PN discovery for CN
  • --discover-types en: crit with Cannot enable EN discovery for CN

PN1 with --discover-types option

  • --discover-types cn: crit with Cannot enable CN discovery for PN
  • --discover-types pn: only pns are connected
  • --discover-types en: only ens are connected

EN1 with --discover-types option

  • --discover-types cn: crit with Cannot enable CN discovery for EN
  • --discover-types pn: only pns are connected
  • --discover-types en: only ens are connected

@ulbqb
Copy link
Contributor

ulbqb commented Jan 16, 2025

EIP-2935 blockhash on state

Enviroment

  • version: v2.0.0-rc.2
  • setup: homi setup --gen-type local --cn-num 1 --prague-compatible-blocknumber 100
  • deploy system contract at block number 10
  • enable prague at block number 100
  • wait for over block number 10000

Test

I tried the bellow command for every i ∈ {2, 8, 9, 10, 11 98, 99, 100, 101, 102, 1000, 9000} and every j ∈ [1, 10000].

$ cast call 0x0F792be4B0c0cb4DAE440Ef133E90C0eCD48CCCC $(printf "%064x" $i) \
  -b $j \
  -r $RPC_URL

Block hashes

number hash
2 0xbb8f24d44d3f0fb391568297dc0d0ebc01b4ba87c41c5b75144d2857c6230e48
8 0x5bd877f89f21ba658c916eb0277343093add26daa48ca5c8e0c70fc8744fbeed
9 0xb16c1316e5e1a35dd922341df2ad9b71fd00ff2779746314e4fa58401bc383b0
10 0x80b4f09f33f0063a60e6246d84fb661aa18c2eb1f685147ea4bf5f89c2d5f306
11 0xffb2d619aba23173920c69a458805ec6dac756afc0a881cd76d04735bc9216c8
98 0xc7cfcfb6bc383eedb792005c9e135d34fc8413054be676d6e259da56a50c45fe
99 0x02bddd2a0cf92b3a941a07e0f38853ab22469acbf2265a98d8b7062a12bbee62
100 0x3053aee98d3c3e1ec6e511fcbe30f41f27ea1e6b1528aaa4be368cffd5590cbf
101 0x7c633741094399a1662d4e57d63128ec85c760bd5243d33d927dc592415f7b96
102 0xbd7878601627c6ca0150aa5e22c708ede77436c640de2a2ab403705581b7d793
1000 0xaa35a5dd25e7e0d0ed62a70bfcd01939450639c16c5a66345513e539c33afc3e
9000 0x0337fc80f9d9f79eb81d8117902eb8d93661ee6f57f5c58e231a3d36dd97187f

Expected response

i j expected
x [1, 9] 0x
x [10, x] Error: server returned an error response: error code -32000: evm: execution reverted (if x>=10), none (otherwise)
x [x+1, x+8191] 0x0000000000000000000000000000000000000000000000000000000000000000 (if x < 100), blockHash(x) (otherwise)
x [x+8192, 10000] Error: server returned an error response: error code -32000: evm: execution reverted

Results

Open
i j response
2 [1, 9] 0x
2 [10, 8193] 0x0000000000000000000000000000000000000000000000000000000000000000
2 [8194, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
8 [1, 9] 0x
8 [10, 8199] 0x0000000000000000000000000000000000000000000000000000000000000000
8 [8200, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
9 [1, 9] 0x
9 [10, 8200] 0x0000000000000000000000000000000000000000000000000000000000000000
9 [8201, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
10 [1, 9] 0x
10 10 Error: server returned an error response: error code -32000: evm: execution reverted
10 [11, 8201] 0x0000000000000000000000000000000000000000000000000000000000000000
10 [8202, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
11 [1, 9] 0x
11 [10, 11] Error: server returned an error response: error code -32000: evm: execution reverted
11 [12, 8202] 0x0000000000000000000000000000000000000000000000000000000000000000
11 [8203, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
98 [1, 9] 0x
98 [10, 98] Error: server returned an error response: error code -32000: evm: execution reverted
98 [99, 8289] 0x0000000000000000000000000000000000000000000000000000000000000000
98 [8290, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
99 [1, 9] 0x
99 [10, 99] Error: server returned an error response: error code -32000: evm: execution reverted
99 [100, 8290] 0x02bddd2a0cf92b3a941a07e0f38853ab22469acbf2265a98d8b7062a12bbee62
99 [8291, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
100 [1, 9] 0x
100 [10, 100] Error: server returned an error response: error code -32000: evm: execution reverted
100 [101, 8291] 0x3053aee98d3c3e1ec6e511fcbe30f41f27ea1e6b1528aaa4be368cffd5590cbf
100 [8292, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
101 [1, 9] 0x
101 [10, 101] Error: server returned an error response: error code -32000: evm: execution reverted
101 [102, 8292] 0x7c633741094399a1662d4e57d63128ec85c760bd5243d33d927dc592415f7b96
101 [8293, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
102 [1, 9] 0x
102 [10, 102 ] Error: server returned an error response: error code -32000: evm: execution reverted
102 [103, 8293] 0xbd7878601627c6ca0150aa5e22c708ede77436c640de2a2ab403705581b7d793
102 [8294, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
1000 [1, 9 ] 0x
1000 [10, 1000] Error: server returned an error response: error code -32000: evm: execution reverted
1000 [1001, 9191] 0xaa35a5dd25e7e0d0ed62a70bfcd01939450639c16c5a66345513e539c33afc3e
1000 [9192, 10000] Error: server returned an error response: error code -32000: evm: execution reverted
9000 [1, 9] 0x
9000 [10, 9000] Error: server returned an error response: error code -32000: evm: execution reverted
9000 [9001, 10000] 0x0337fc80f9d9f79eb81d8117902eb8d93661ee6f57f5c58e231a3d36dd97187f

@shiki-tak
Copy link
Contributor

shiki-tak commented Jan 16, 2025

EIP-2537 precompiles

Config

Result

@shiki-tak
Copy link
Contributor

shiki-tak commented Jan 19, 2025

EIP-7623 & KIP-223 calldata pricing

  • Setup
  • Test Scripts
  • Checklist:
    • EthereumAccessList
    • EthereumDynamicFee
    • FeeDelegatedSmartContractDeployWithRatio
    • FeeDelegatedSmartContractDeploy
    • FeeDelegatedSmartContractExecutionWithRatio
    • FeeDelegatedSmartContractExecution
    • FeeDelegatedValueTransferMemoWithRatio
    • FeeDelegatedValueTransferMemo
    • Legacy
    • SmartContractDeploy
    • SmartContractExecution
    • ValueTransferMemo
    • AccountUpdate
    • Cancel
    • FeeDelegatedAccountUpdateWithRatio
    • FeeDelegatedAccountUpdate
    • FeeDelegatedCancelWithRatio
    • FeeDelegatedCancel
    • FeeDelegatedValueTransferWithRatio
    • FeeDelegatedValueTransfer
    • ValueTransfer

Result

  • Compared to v1.0.3, gasUsed has decreased for tx types that use calldata.
  • gasUsed increases as data size increases.
  • The expected and actual gasUsed values ​​after applying EIP-7623 are consistent.
Open
Transaction Type v1.0.3 Comparison Gas Validation
legacyTransaction https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/legacyTransaction/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/legacyTransaction/gas-validation.txt
valueTransfer https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/valueTransfer/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/valueTransfer/gas-validation.txt
valueTransferMemo https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/valueTransferMemo/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/valueTransferMemo/gas-validation.txt
smartContractDeploy https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/smartContractDeploy/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/smartContractDeploy/gas-validation.txt
smartContractExecution https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/smartContractExecution/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/smartContractExecution/gas-validation.txt
accountUpdate https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/accountUpdate/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/accountUpdate/gas-validation.txt
cancel https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/cancel/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/cancel/gas-validation.txt
feeDelegatedValueTransfer https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransfer/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransfer/gas-validation.txt
feeDelegatedValueTransferMemo https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferMemo/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferMemo/gas-validation.txt
feeDelegatedValueTransferWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferWithRatio/gas-validation.txt
feeDelegatedValueTransferMemoWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferMemoWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedValueTransferMemoWithRatio/gas-validation.txt
feeDelegatedSmartContractDeploy https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractDeploy/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractDeploy/gas-validation.txt
feeDelegatedSmartContractDeployWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractDeployWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractDeployWithRatio/gas-validation.txt
feeDelegatedSmartContractExecution https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractExecution/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractExecution/gas-validation.txt
feeDelegatedSmartContractExecutionWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractExecutionWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedSmartContractExecutionWithRatio/gas-validation.txt
feeDelegatedAccountUpdate https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedAccountUpdate/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedAccountUpdate/gas-validation.txt
feeDelegatedAccountUpdateWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedAccountUpdateWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedAccountUpdateWithRatio/gas-validation.txt
feeDelegatedCancel https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedCancel/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedCancel/gas-validation.txt
feeDelegatedCancelWithRatio https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedCancelWithRatio/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/feeDelegatedCancelWithRatio/gas-validation.txt
ethereumAccessList https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/ethereumAccessList/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/ethereumAccessList/gas-validation.txt
ethereumDynamicFee https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/ethereumDynamicFee/gas-comparison.png https://github.com/shiki-tak/qa-kaia/blob/master/src/eip2028/results/ethereumDynamicFee/gas-validation.txt

@yoomee1313
Copy link
Contributor

yoomee1313 commented Jan 22, 2025

Test node is full-en node. v1.0.3 node for reference is archive node.

Staking APIs (kaiax/staking), Reward APIs (kaiax/reward), Supply APIs (kaiax/supply)

  • kaia_getRewards: reward-result.log
    • failed to get state for block number error's block number returns source number
    • getRewards call from the block 156660001 returns missing trie node error (v1.0.3 archive node doesn't return error) -> the calculated sourcenum is not multiple of block interval.
  • kaia_getStakingInfo: staking-result.log
    • [] -> none : empty list became none. please refer the result log.
    • since kore, useGini is false: it seems fine, but need to be checked.
    • failed to get state for block number error's block number returns source number
    • 162900479 returns missing trie node error (but v1.0.3 archive node doesn't return error)
  • kaia_getTotalSupply: supply-result.log
    • totalSupply, totalBurnt, zeroBurn, deadBurn became None (but v1.0.3 archive does not return none) -> seems minor.
  • goveranance_getRewardsAccumulated: accumulated.log
    • UTC became number ( 2019-06-26 08:01:12 +0000 UTC -> 1561536072)
    • 98347377 returns wrong value. please refer the log file.
    • since 119145599, it returns wrong value. please refer the log file.
    • since 156659999, it returns missing trie node (but v1.0.3 archive node does not return error)

Test files and steps

  • test-script.zip
  • steps
    • unzip and setup python virtual enviroment.(python -m venv venv & source venv/bin/activate).
    • install requests, subprocess. (pip3 install requests, subprocess)
    • run the test - it runs in kairos testnet.

Randao API (kaia/randao)

Open deployed 4cn/4pn/4en private network

genesis.json

{
...
        "istanbulCompatibleBlock": 0,
        "londonCompatibleBlock": 0,
        "ethTxTypeCompatibleBlock": 0,
        "magmaCompatibleBlock": 0,
        "koreCompatibleBlock": 0,
        "shanghaiCompatibleBlock": 0,
        "randaoCompatibleBlock": 80,
        "cancunCompatibleBlock": 80,
        "kaiaCompatibleBlock": 80,
}

result

expected: before randao fork, it returns cannot read kip113 address error. After randao fork, it returns either bls-nodeinfos or missing trie error.

> kaia.getBlsInfos(0)
Error: cannot read kip113 address from registry before randao fork
        at web3.js:6814:9(39)
        at send (web3.js:5225:62(29))
        at <eval>:1:17(3)

> kaia.getBlsInfos(1)
Error: cannot read kip113 address from registry before randao fork
        at web3.js:6814:9(39)
        at send (web3.js:5225:62(29))
        at <eval>:1:17(3)

> kaia.getBlsInfos(79)
Error: cannot read kip113 address from registry before randao fork
        at web3.js:6814:9(39)
        at send (web3.js:5225:62(29))
        at <eval>:1:17(3)

> kaia.getBlsInfos(80)
Error: missing trie node a8df2e2190ff43ba1d7aed7623f07272b3932b20cce9401b28f3a99515f797de (path )
        at web3.js:6814:9(39)
        at send (web3.js:5225:62(29))
        at <eval>:1:17(3)

> kaia.getBlsInfos(kaia.blockNumber)
{
  0x01e90b85d592F174e3fA2d0f1973e05FB8858F86: {
    pop: "b6787b78a8420fb607c0a26816ef140f05c3002bd585744b5235f586bb6bdceb277cb3c8bce360b5838c9e0b46ba150711d4e31fbfe093c6af5ac4236469669363a2d33bbb066d6c93dcb6ee1014ed2331718367551ce989c2e2b0ccb24406dd",
    publicKey: "aae471a032af2aba2eb70e52974fbb2faa0b5c4bc0308cee92ce39b8207026fb080faa404c87438f4ded7c0a2962a38d",
    verifyErr: null
  },
  0x79C8E8d62DB69f290444091F4016244eC7658cda: {
    pop: "941d618321e58a415cc784cdde498038b099ebe7c50c8cab28ab398c1245c4b7ddda12c8eeb59cda14dd2602a50ac7ab1599cbdbdd8914157330ca1dc42385b0fe850a0294fb432ec64d39bba46e91d557ef7f56599b8d5ec33ae4e2f19ff268",
    publicKey: "ac59da24869f4b8507b7027392349d4a2939428f62aa577777bf04e097b4a9b963301aa741057c08b102db99bf1d326d",
    verifyErr: null
  },
  0xA117EBaBAf7137F97977C2ded39F3dB06EdD50EB: {
    pop: "95d136bb3aa432856d2bd8ca10b7669018a88c8a18294928a7b9f29a413555600a225c6ae2887a01d4642737446a89ee11e9724a3ce24355e70687bb96af0fd625e1dab3f7691fd418c3e584aabb520c4c3de8920d847993995bdfcf479428a0",
    publicKey: "95b8a97c13e2740a0b9162a069c2e45e3660191953793969a369d951c9099f31cade65b9aa36102544ff7f63ad861112",
    verifyErr: null
  },
  0xa339d44E324d34f0a2e858c1CAe6a3C7cE2B752C: {
    pop: "a425ea366650c83f6048a392c0d6fae7e1f88c54a74616b8c1422de052edeb7c302b15469ff0c4240eac00acc0acd47201fedb1a3043a1460104c8f79a5e5950bc6b19cf344d9503c080a88b278f5956e49265710ecabe3229d0b565c84d538e",
    publicKey: "8b91123813de9eb8e76f5b7e28b96362f920cb6c26f01a2857b2a297d85e5418b6c19670fffa0a062306737fb7c7163e",
    verifyErr: null
  }
}

@hyeonLewis
Copy link
Contributor

hyeonLewis commented Jan 23, 2025

Gov APIs (kaiax/gov), Consensus APIs (kaiax/valset)

  1. Governance (Kairos)
  • governance_nodeAddress: No problem
  • governance_votes: No problem (testing 162221160, 155903352, 155903442, 155903493, 126432843, 125383542, 118303506.
  • kaia_getParams:
    • Different types: reward.mintingamount, reward.minimumstake kaiax/gov: add crits and fix kaia_getParams #243
      • v1.0.3: 'reward.minimumstake': '5000000', 'reward.mintingamount': '6400000000000000000'
      • v2.0.0: 'reward.minimumstake': 5000000, 'reward.mintingamount': 6400000000000000000
    • Different governance.deriveshaimpl field before block 112492800. Since 112492800, both returns 0. But it returns 2 in v1.0.3 before 112492800. -> Fixed in rc.2
      • v1.0.3: 'governance.deriveshaimpl': 2
      • v2.0.0: 'governance.deriveshaimpl': 0
  • kaia_chainConfig:
    • Different governance.deriveshaimpl field before block 112492800. (same as getParams) -> Fixed in rc.2
      • v1.0.3: 'deriveShaImpl': 2
      • v2.0.0: 'deriveShaImpl': 0
  1. Consensus

Check consensus APIs on private network. Using this to make validator demote/promote situations.

  • homi setup --cn-num 4 --baobab --address-book-mock --gen-type local

  • Replace output/cn2/bin/kcn with v2.0.0 binary and keep v1.0.3 for other CNs.

  • hh run src/stakingInterval/script/main.ts

  • After finishing above test, hh run src/v2-api/main.ts

  • kaia_getCommittee

  • kaia_getCommitteeSize

  • kaia_getCouncil

  • kaia_getCouncilSize

  • istanbul_getDemotedValidators

  • istanbul_getDemotedValidatorsAtHash: unknown block: backend: Fix wrong nil check #227

  • istanbul_getValidators

  • istanbul_getValidatorsAtHash

  • istanbul_getValidatorsAtHash

  • kaia_getBlockWithConsensusInfoByNumber (ByHash)

    • Checked committee and proposer fields
  • kaia_getBlockWithConsensusInfoByNumberRange (

    • Checked committee and proposer fields

@yoomee1313
Copy link
Contributor

yoomee1313 commented Feb 12, 2025

Sync test

  platform network instance
EN0 gcp kairos c4-highcpu-16
EN1 gcp mainnet c4-highcpu-16
EN2 aws mainnet c7i.4xlarge
EN3 aws mainnet c7i.4xlarge
EN4 aws mainnet c7i.4xlarge
EN5 aws mainnet c7i.4xlarge
EN6 aws mainnet c7i.4xlarge
EN7 aws mainnet c7i.4xlarge
  start (12/31) target Jan 8 process ( % ) Jan 15 process ( % ) Jan 21process ( % ) Jan 31process ( % )
EN0 0 1,7400,0000 ssh fail ? 1,7207,1791 (98%) 1,7585,2056(100%) 1,7585,2056(100%)
EN1 0 6000,0000 3009,1237 (50%) 5415,5055 (90%) 6945,4832(100%) 6945,4832(100%)
EN2 6000,0000 8000,0000 7169,1407 (58.46%) 7627,2039 (81%) 8094,6687(100%) 8094,6687(100%)
EN3 8000,0000 1,1100,0000 8240,8709 (28.02%) 9116,5185 (36%) 1,0618,2937(87.2%) 1,1127,1343(100%, Jan 24)
EN4 1,1100,0000 1,3500,0000 1,1710,6458 (26.78%) 1,2325,2270 (51%) 1,2795,9328(67.8%) 1,3029,6883(100%)
EN5 1,3500,0000 1,4700,0000 1,3956,1134 (35.18%) 1,4461,1067 (80%) 1,5024,8895(100%) 1,5024,8895(100%)
EN6 1,4700,0000 1,6200,0000 1,5251,8015 (33.46%) 1,5720,2314 (68%) 1,6105,9035(93.7%) 1,6611,9259(100%)
EN7 1,6200,0000 1,7400,0000 1,6530,1365 (33.23%) 1,6851,5600 (54%) 1,7176,4520(81.3%) 1,7623,6232(100%)

@2dvorak
Copy link
Contributor

2dvorak commented Feb 19, 2025

RPM package installs systemd files

CentOS stream 9, clean install v2.0.0
$ ls -l /etc/init.d
ls: cannot access '/etc/init.d': No such file or directory
$ ls -l /etc/rc.d/init.d
total 4
-rw-r--r--. 1 root root 1161 Jan 28 09:59 README
$ ls -l /etc/systemd/system/kend*
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after install

$ ls -l /etc/init.d
lrwxrwxrwx. 1 root root 11 May 23  2023 /etc/init.d -> rc.d/init.d
$ ls -l /etc/rc.d/init.d
total 36
-rw-r--r--. 1 root root 18220 Aug 27 11:35 functions
-rwxr-xr--. 1 root root 10161 Feb 10 01:43 kend
-rw-r--r--. 1 root root  1161 Jan 28 09:59 README
$ ls -l /etc/systemd/system/kend.service
-rw-r--r--. 1 root root 158 Feb 10 01:43 /etc/systemd/system/kend.service
CentOS stream 9, upgrade from v1.0.3 to v2.0.0
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l '/etc/systemd/system/kend*'
ls: cannot access '/etc/init.d': No such file or directory
total 4
-rw-r--r--. 1 root root 1161 Jan 28 09:59 README
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after install v1.0.3
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l '/etc/systemd/system/kend*'
total 12
-rwxr-xr--. 1 root root 10157 Sep 26 06:18 kend
total 4
-rw-r--r--. 1 root root 1161 Jan 28 09:59 README
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after upgrade
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*
total 12
lrwxrwxrwx. 1 root root    26 Feb 18 13:42 functions -> /etc/rc.d/init.d/functions
-rwxr-xr--. 1 root root 10161 Feb 10 01:43 kend
total 24
-rw-r--r--. 1 root root 18220 Aug 27 11:35 functions
-rw-r--r--. 1 root root  1161 Jan 28 09:59 README
-rw-r--r--. 1 root root 158 Feb 10 01:43 /etc/systemd/system/kend.service
Rocky Linux 9, clean install v2.0.0
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*
ls: cannot access '/etc/init.d': No such file or directory
total 4
-rw-r--r--. 1 root root 1161 Nov 16 01:21 README
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after install
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*
lrwxrwxrwx. 1 root root 11 Nov 12 10:43 /etc/init.d -> rc.d/init.d
total 36
-rw-r--r--. 1 root root 18220 Mar  6  2024 functions
-rwxr-xr--. 1 root root 10161 Feb 10 01:43 kend
-rw-r--r--. 1 root root  1161 Nov 16 01:21 README
-rw-r--r--. 1 root root 158 Feb 10 01:43 /etc/systemd/system/kend.service
Rocky Linux 9, upgrade from v1.0.3 to v2.0.0
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*

ls: cannot access '/etc/init.d': No such file or directory
total 4
-rw-r--r--. 1 root root 1161 Nov 16 01:21 README
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after install v1.0.3
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*
total 12
-rwxr-xr--. 1 root root 10157 Sep 26 06:18 kend
total 4
-rw-r--r--. 1 root root 1161 Nov 16 01:21 README
ls: cannot access '/etc/systemd/system/kend*': No such file or directory

// after upgrade
$ ls -l /etc/init.d
ls -l /etc/rc.d/init.d
ls -l /etc/systemd/system/kend*
total 12
lrwxrwxrwx. 1 root root    26 Feb 18 13:50 functions -> /etc/rc.d/init.d/functions
-rwxr-xr--. 1 root root 10161 Feb 10 01:43 kend
total 24
-rw-r--r--. 1 root root 18220 Mar  6  2024 functions
-rw-r--r--. 1 root root  1161 Nov 16 01:21 README
-rw-r--r--. 1 root root 158 Feb 10 01:43 /etc/systemd/system/kend.service

@blukat29
Copy link
Contributor Author

blukat29 commented Mar 17, 2025

Pending block treatment in APIs (#260)

  1. Remove support for pending logs
  • eth_getLogs, kaia_getLogs
  • eth_newFilter, kaia_newFilter
  • eth_subscribe, kaia_subscribe
Details

Launch node

# Run mainnet EN
ken --rpcapi eth,kaia --rpcport 8551 --ws --wsapi eth,kaia --wsport 8552

HTTP RPC

> eth.getLogs({fromBlock: 'pending'})
Error: pending logs are not supported
> eth.getLogs({toBlock: 'pending'})
Error: pending logs are not supported
> kaia.getLogs({toBlock: 'pending'})
Error: pending logs are not supported
> eth.newFilter({toBlock: 'pending'})
Error: pending logs are not supported
> kaia.newFilter({toBlock: 'pending'})
Error: pending logs are not supported

WS RPC
The eth_subscribe.logs and kaia_subscribe.logs are keep working well.

$ wscat -c ws://localhost:8552

> {"jsonrpc":"2.0","id": 1, "method": "eth_subscribe", "params": ["logs", {}]}
> {"jsonrpc":"2.0","id": 1, "method": "kaia_subscribe", "params": ["logs", {}]}
  1. Add support for pending blocks for feehistory and recover APIs
  • eth_feeHistory, kaia_feeHistory
  • kaia_recoverFromTransaction
Details

The "latest" and "pending" arguments are treated equally in the EN.

> eth.feeHistory(4, 'latest')
{
  baseFeePerGas: ["0x0", "0x0", "0x0", "0x0", "0x0"],
  gasUsedRatio: [0, 0, 5.247300000005247e-8, 0],
  oldestBlock: "0x15a921"
}
> eth.feeHistory(4, 'pending')
{
  baseFeePerGas: ["0x0", "0x0", "0x0", "0x0", "0x0"],
  gasUsedRatio: [0, 0, 5.247300000005247e-8, 0],
  oldestBlock: "0x15a921"
}
> kaia.feeHistory(4, 'latest')
{
  baseFeePerGas: ["0x0", "0x0", "0x0", "0x0", "0x0"],
  gasUsedRatio: [0, 1.4958800000014958e-7, 0, 0],
  oldestBlock: "0x160c9c"
}
> kaia.feeHistory(4, 'pending')
{
  baseFeePerGas: ["0x0", "0x0", "0x0", "0x0", "0x0"],
  gasUsedRatio: [0, 0, 0, 0],
  oldestBlock: "0x161348"
}
> kaia.recoverFromTransaction('0xf9012c808505d21dba00831e848094000000000000000000000000000000000000040080b8c47894c3660000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000030000000000000000000000006969e313c778df1f27c0999cff1c3a06c1d903830000000000000000000000005e8cd1c5db6d11c4fb15b3573730d349ca1c7353000000000000000000000000445ab9941cd0ff4b86069e39796358fa53dfdfe4824056a093ea280f9ac3666dc286138b177940ab37e17aec6dc0b7068c582d57082dc4a9a038f80c0aefebeb06a2e4186502595943a2b0ab28f5839af1faf5242d9e92fee3', 'latest')
"0x854ca8508c8be2bb1f3c244045786410cb7d5d0a"
> kaia.recoverFromTransaction('0xf9012c808505d21dba00831e848094000000000000000000000000000000000000040080b8c47894c3660000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000030000000000000000000000006969e313c778df1f27c0999cff1c3a06c1d903830000000000000000000000005e8cd1c5db6d11c4fb15b3573730d349ca1c7353000000000000000000000000445ab9941cd0ff4b86069e39796358fa53dfdfe4824056a093ea280f9ac3666dc286138b177940ab37e17aec6dc0b7068c582d57082dc4a9a038f80c0aefebeb06a2e4186502595943a2b0ab28f5839af1faf5242d9e92fee3', 'pending')
"0x854ca8508c8be2bb1f3c244045786410cb7d5d0a"
  1. Do not return error from simple query APIs
  • eth_getBlockTransactionCountByNumber, kaia_getBlockTransactionCountByNumber
  • eth_getBlockTransactionCountByHash, kaia_getBlockTransactionCountByHash
  • eth_getTransactionByBlockNumberAndIndex, kaia_getTransactionByBlockNumberAndIndex
  • eth_getTransactionByBlockHashAndIndex, kaia_getTransactionByBlockHashAndIndex
  • eth_getRawTransactionByBlockNumberAndIndex, kaia_getRawTransactionByBlockNumberAndIndex
  • eth_getRawTransactionByBlockHashAndIndex, kaia_getRawTransactionByBlockHashAndIndex
Details

Nonexistent query would return null or "0x".

> eth.getBlockTransactionCount(999999999999)
null
> kaia.getBlockTransactionCount(999999999999)
null
> eth.getBlockTransactionCount('0x1111111122222222333333334444444455555555666666667777777788888888')
null
> kaia.getBlockTransactionCount('0x1111111122222222333333334444444455555555666666667777777788888888')
null
> eth.getTransactionFromBlock(980, 9999)
null
> kaia.getTransactionFromBlock(980, 9999)
null
> eth.getRawTransactionFromBlock(980, 9999)
"0x"
> kaia.getRawTransactionFromBlock(980, 9999)
"0x"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants