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 v1.0.1 #14

Closed
22 tasks done
blukat29 opened this issue Jun 20, 2024 · 8 comments · Fixed by #44
Closed
22 tasks done

QA for v1.0.1 #14

blukat29 opened this issue Jun 20, 2024 · 8 comments · Fixed by #44

Comments

@blukat29
Copy link
Contributor

blukat29 commented Jun 20, 2024

Sign-Off PR: #40

@blukat29
Copy link
Contributor Author

blukat29 commented Jul 2, 2024

kaia_getTransaction returns correct gasPrice for mined transactions

  • Compare the results for v1.0.0 and v1.0.1
eth.chainId()
txhash = '0xe7880de31406cc082a67716e9275915fbf76049bc11d1f608cac9f812972912f'
eth.getTransaction(txhash).gasPrice
eth.getTransactionReceipt(txhash).effectiveGasPrice
kaia.getTransaction(txhash).gasPrice
kaia.getTransactionReceipt(txhash).effectiveGasPrice
v1.0.0
> eth.chainId()
"0x2019"
> txhash = '0xe7880de31406cc082a67716e9275915fbf76049bc11d1f608cac9f812972912f'
"0xe7880de31406cc082a67716e9275915fbf76049bc11d1f608cac9f812972912f"
> eth.getTransaction(txhash).gasPrice
25000000000
> eth.getTransactionReceipt(txhash).effectiveGasPrice
"0x5d21dba00"             // 25000000000
> kaia.getTransaction(txhash).gasPrice
55000000000
> kaia.getTransactionReceipt(txhash).effectiveGasPrice
"0x5d21dba00"             // 25000000000
v1.0.1-rc.1
> eth.chainId()
"0x2019"
> txhash = '0xe7880de31406cc082a67716e9275915fbf76049bc11d1f608cac9f812972912f'
"0xe7880de31406cc082a67716e9275915fbf76049bc11d1f608cac9f812972912f"
> eth.getTransaction(txhash).gasPrice
25000000000
> eth.getTransactionReceipt(txhash).effectiveGasPrice
"0x5d21dba00"             // 25000000000
> kaia.getTransaction(txhash).gasPrice
25000000000
> kaia.getTransactionReceipt(txhash).effectiveGasPrice
"0x5d21dba00"             // 25000000000

kaia_getTotalSupply returns all fields for Kairos testnet

  • Compare the results for v1.0.0 and v1.0.1
klay.clientVersion()
eth.chainId()
eth.blockNumber
var hfnum = 156660000
var before = hfnum - (hfnum % 128)
var after = before + 128
kaia.getTotalSupply(before)
kaia.getTotalSupply(after)
v1.0.0
> klay.clientVersion()
"Klaytn/v1.0.0/linux-amd64/go1.22.3"
> eth.chainId()
"0x3e9"
> eth.blockNumber
158473941
> eth.chainId()
"0x3e9"
> eth.blockNumber
158473957
> var hfnum = 156660000
undefined
> var before = hfnum - (hfnum % 128)
undefined
> var after = before + 128
undefined
> kaia.getTotalSupply(before)
{
  burntFee: "0x6cbef8620275e76d6b48",
  deadBurn: "0x320a0a48336030a8cd",
  kip103Burn: "0x6a15eef7e3a354cf657913",
  kip160Burn: "0x0",
  number: "0x9567100",
  totalBurnt: "0x6a893c6ba9a1edb1600602",
  totalMinted: "0x446c3b15f9926687d2c85ac1d1e0d41a7dc4b60000",
  totalSupply: "0x446c3b15f9926687d2c7f03895752a78901355f9fe",
  zeroBurn: "0x65c7159b3ef9a5c78da"
}
> kaia.getTotalSupply(after)
{
  burntFee: "0x6cbf249f95f8a8ead370",
  deadBurn: "0x320a0a48336030a8cd",
  error: "cannot determine rebalance (kip103, kip160) burn amount: invalid character 'b' looking for beginning of value",
  kip103Burn: "0x6a15eef7e3a354cf657913",
  kip160Burn: null,
  number: "0x9567180",
  totalBurnt: null,
  totalMinted: "0x446c3b15f9926687d2c85ac213cc37efd8dfb60000",
  totalSupply: null,
  zeroBurn: "0x65c7159b3ef9a5c78da"
}
v1.0.1-rc.1
> klay.clientVersion()
"Klaytn/v1.0.1/linux-amd64/go1.22.3"
> eth.chainId()
"0x3e9"
> eth.blockNumber
158474358
> var hfnum = 156660000
undefined
> var before = hfnum - (hfnum % 128)
undefined
> var after = before + 128
undefined
> kaia.getTotalSupply(before)
{
  burntFee: "0x6cbef8620275e76d6b48",
  deadBurn: "0x320a0a48336030a8cd",
  kip103Burn: "0x6a15eef7e3a354cf657913",
  kip160Burn: "0x0",
  number: "0x9567100",
  totalBurnt: "0x6a893c6ba9a1edb1600602",
  totalMinted: "0x446c3b15f9926687d2c85ac1d1e0d41a7dc4b60000",
  totalSupply: "0x446c3b15f9926687d2c7f03895752a78901355f9fe",
  zeroBurn: "0x65c7159b3ef9a5c78da"
}
> kaia.getTotalSupply(after)
{
  burntFee: "0x6cbf249f95f8a8ead370",
  deadBurn: "0x320a0a48336030a8cd",
  kip103Burn: "0x6a15eef7e3a354cf657913",
  kip160Burn: "-0xbf82646906be407e42a4800",
  number: "0x9567180",
  totalBurnt: "-0xb8d9d09f884ae97714cd9d6",
  totalMinted: "0x446c3b15f9926687d2c85ac213cc37efd8dfb60000",
  totalSupply: "0x446c3b15f9926687d2d3e85f1dc4bc9e705102d9d6",
  zeroBurn: "0x65c7159b3ef9a5c78da"
}

Message signing RPCs are EIP-191 compliant

v1.0.1-rc.1
  1. Sample data
  • signer private key: 0x6397f5bfcef382017268d21294aed3b82d479b67323f94f7065d92a43643f20f
  • signer address: 0xbC7d1aBe33E6EC19cA873A3042A4DCF49149BC7A
  • message 0x61626364
  • signature created by MetaMask's personal_sign (EIP-191)
    window.ethereum.request({ method: "eth_requestAccounts" })
    window.ethereum.request({ method: "personal_sign", params: ["0x61626364", "0xbC7d1aBe33E6EC19cA873A3042A4DCF49149BC7A"] }).then(console.log)
    0xe67ddbb12ad7c85a28b082bb3f159e637229454d34824bd96c0df38e49bf92d42167ffba7565855585de0c32407b0622b0b66fdfe7bd6566d4a19ca40b39ec631b
  • signature created by Kaikas's eth_sign (KIP-97)
    window.klaytn.request({ method: "eth_requestAccounts" })
    window.klaytn.request({ method: "eth_sign", params: ["0xbC7d1aBe33E6EC19cA873A3042A4DCF49149BC7A", "0x61626364"] }).then(console.log)
    0x90824271750d7a09f90a76b6f8ec1e5e2afd31790fea9f43e26c120fef3152be46ad09c76f87bd6c495859fa37127754f1f0780180df53eda80034dac036b8d31b
  1. personal_ecrecover is EIP-191
> personal.ecRecover('0x61626364', '0xe67ddbb12ad7c85a28b082bb3f159e637229454d34824bd96c0df38e49bf92d42167ffba7565855585de0c32407b0622b0b66fdfe7bd6566d4a19ca40b39ec631b')
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a" // EIP-191 signature yields the signer address
> personal.ecRecover('0x61626364', '0x90824271750d7a09f90a76b6f8ec1e5e2afd31790fea9f43e26c120fef3152be46ad09c76f87bd6c495859fa37127754f1f0780180df53eda80034dac036b8d31b')
"0x83810e56c2bb4969cc3dffe6a1afeb262cafe7d4" // KIP-97 signature yields an unrelated address
  1. kaia_recoverFromMessage accepts both EIP-191 and KIP-191
> kaia.recoverFromMessage('0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', '0x61626364', '0xe67ddbb12ad7c85a28b082bb3f159e637229454d34824bd96c0df38e49bf92d42167ffba7565855585de0c32407b0622b0b66fdfe7bd6566d4a19ca40b39ec631b', 'latest')
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a" // both returns the signer address
> kaia.recoverFromMessage('0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', '0x61626364', '0x90824271750d7a09f90a76b6f8ec1e5e2afd31790fea9f43e26c120fef3152be46ad09c76f87bd6c495859fa37127754f1f0780180df53eda80034dac036b8d31b', 'latest')
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a" // both returns the signer address
  1. personal_sign, eth_sign, kaia_sign are EIP-191
> personal.importRawKey('6397f5bfcef382017268d21294aed3b82d479b67323f94f7065d92a43643f20f', 'pass')
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a"
> personal.unlockAccount('0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', 'pass')
true
> personal.ecRecover('0x61626364', personal.sign('0x61626364', '0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', 'pass'))
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a"
> personal.ecRecover('0x61626364', eth.sign('0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', '0x61626364'))
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a"
> personal.ecRecover('0x61626364', kaia.sign('0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a', '0x61626364'))
"0xbc7d1abe33e6ec19ca873a3042a4dcf49149bc7a"

@blukat29
Copy link
Contributor Author

blukat29 commented Jul 3, 2024

gasPrice and maxPriorityFeePerGas APIs - Under low traffic, {eth,kaia}_gasPrice and {eth,kaia}_maxPriorityFeePerGas return a zero-tip price despite feeHistory containing high fees

  • Setup. Monitor two nodes on Kairos: one v1.0.0, another v1.0.1
setInterval(() => console.log(
  eth.blockNumber,
  parseInt(eth.gasPrice/1e9),
  parseInt(eth.maxPriorityFeePerGas/1e9), '\t',
  eth.feeHistory(20, 'latest', [60]).reward.flat().map((n) => parseInt(parseInt(n)/1e9)), '\t',
  eth.feeHistory(20, 'latest').baseFeePerGas.map((n) => parseInt(parseInt(n)/1e9))
), 1000)  
  • Test 1. Intentionally create high-tip transactions and compare the results

  • base fee is maintaining lower bound (25)

  • send many txs with (maxfee = 70, maxtip = 30), filling up the feeHistory.

burst_tx.ts

import hre from "hardhat";

const totalBlock = 25;
const tpb = 5;

async function main() {
  const [sender] = await hre.ethers.getSigners();
  const initialNonce = await sender.getTransactionCount();

  for (let i = 0; i < totalBlock; i++) {
    for (let j = 0; j < tpb; j++) {
      await sender.sendTransaction({
        to: sender.address,
        value: hre.ethers.utils.parseEther("0.0001"),
        maxFeePerGas: hre.ethers.utils.parseUnits("70", "gwei"),
        maxPriorityFeePerGas: hre.ethers.utils.parseUnits("30", "gwei"),
        nonce: initialNonce + i * tpb + j,
      });
    }
    await new Promise((resolve) => setTimeout(resolve, 1000));
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

v1.0.0 - recommends gasPrice=(25+30), tip=30

       158495353 26.5 1.5        0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495355 26.5 1.5        0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495356 26.5 1.5        0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495357 26.5 1.5        0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495358 26.5 1.5        0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495359 55 30   225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495360 55 30   0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495361 55 30   0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495362 55 30   0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495363 55 30   0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495363 55 30   0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495365 55 30   0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495366 55 30   0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495367 55 30   0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495368 55 30   0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495369 55 30   0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495370 55 30   0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495371 55 30   0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495372 55 30   30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495373 55 30   225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495374 55 30   30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495375 55 30   30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495376 55 30   225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495377 55 30   225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495378 55 30   225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495379 55 30   225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495380 55 30   225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495381 55 30   30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495382 55 30   30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495383 55 30   30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495384 55 30   30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495385 55 30   30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495386 55 30   30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495387 55 30   30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495388 55 30   30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495389 55 30   30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495390 55 30   30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495391 55 30   30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495392 55 30   0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495393 55 30   30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495394 55 30   30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495395 55 30   30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495396 55 30   30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495397 55 30   30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495398 55 30   30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495399 55 30   30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495400 55 30   30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495401 55 30   30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495402 55 30   0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495403 55 30   30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495404 55 30   0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495405 55 30   0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495406 55 30   0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25

v1.0.1-rc.1 - recommends gasPrice=(25+0), tip=0


       158495349 25 0    0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495350 25 0    0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495351 25 0    0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495352 25 0    0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495353 25 0    0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495354 25 0    0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495355 25 0    0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495356 25 0    0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495357 25 0    0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495358 25 0    0,225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495359 25 0    225,0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495360 25 0    0,0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495361 25 0    0,0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495362 25 0    0,0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495363 25 0    0,0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495364 25 0    0,0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495365 25 0    0,0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495366 25 0    0,0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495367 25 0    0,0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495368 25 0    0,0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495369 25 0    0,0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495370 25 0    0,0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495371 25 0    0,30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495372 25 0    30,225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495373 25 0    225,30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495374 25 0    30,30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495375 25 0    30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495375 25 0    30,225,225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495377 25 0    225,225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495378 25 0    225,225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495379 25 0    225,225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495380 25 0    225,30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495381 25 0    30,30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495382 25 0    30,30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495383 25 0    30,30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495384 25 0    30,30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495385 25 0    30,30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495386 25 0    30,30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495387 25 0    30,30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495388 25 0    30,30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495389 25 0    30,30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495390 25 0    30,30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495391 25 0    30,0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495392 25 0    0,30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495393 25 0    30,30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495394 25 0    30,30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495395 25 0    30,30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495396 25 0    30,30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0          25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495397 25 0    30,30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0   25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495398 25 0    30,30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495399 25 0    30,30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495400 25 0    30,30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30    25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495401 25 0    30,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0     25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495402 25 0    0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495403 25 0    30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0      25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495404 25 0    0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495405 25 0    0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495406 25 0    0,0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495407 25 0    0,0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495408 25 0    0,0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158495409 25 0    0,0,0,0,0,0,0,0,0,30,30,0,0,0,0,0,0,0,0,0       25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25

  • Test 2. Intentionally create high-gas-fee transactions to increase the basefee and compare the results
heavy_tx.ts

import hre from "hardhat";

const totalBlock = 5;
const tpb = 2;
const testonce = 0;

/*
// SPDX-License-Identifier: MIT

pragma solidity ^0.8;

contract GasBurner {
    uint256[10000] arr;
    function consume(uint256 num) public {
        for (uint256 i=0; i<num; i++) {
            arr[i] += i;
        }
    }
}
*/
const abi = '[{"inputs":[{"internalType":"uint256","name":"num","type":"uint256"}],"name":"consume","outputs":[],"stateMutability":"nonpayable","type":"function"}]';
const code = '0x6080604052348015600e575f80fd5b506101b48061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063483f31ab1461002d575b5f80fd5b610047600480360381019061004291906100c6565b610049565b005b5f5b8181101561008b57805f826127108110610068576100676100f1565b5b015f828254610077919061014b565b92505081905550808060010191505061004b565b5050565b5f80fd5b5f819050919050565b6100a581610093565b81146100af575f80fd5b50565b5f813590506100c08161009c565b92915050565b5f602082840312156100db576100da61008f565b5b5f6100e8848285016100b2565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61015582610093565b915061016083610093565b92508282019050808211156101785761017761011e565b5b9291505056fea2646970667358221220b7ea334535cbbee97b700012dc6cce67791b4f5333b217b9150e5a3e2b28979664736f6c634300081a0033';
const addr = '0xa921ed8f8d991b1b0cd8ea23ea8eea503a694f02'; // baobab

async function main() {
  const [sender] = await hre.ethers.getSigners();

  const iface = new hre.ethers.utils.Interface(abi);
  const data = iface.encodeFunctionData('consume', [8000]);

  let to = addr;
  if (to.length == 0) {
    const deployTx = await sender.sendTransaction({ data: code });
    const deployRc = await deployTx.wait();
    to = deployRc.contractAddress;
    console.log('GasBurner deployed at', to);
  } else {
    console.log('Using GasBurner at', to);
  }

  if (testonce) {
    const callTx = await sender.sendTransaction({ to, data })
    const callRc = await callTx.wait();
    console.log('One call costs', callRc.gasUsed, 'gas');
    return;
  }

  const initialNonce = await sender.getTransactionCount();

  for (let i = 0; i < totalBlock; i++) {
    let p = [];
    for (let j = 0; j < tpb; j++) {
      const tx = sender.sendTransaction({
        to: to,
        data: data,
        maxFeePerGas: hre.ethers.utils.parseUnits("27", "gwei"),
        maxPriorityFeePerGas: hre.ethers.utils.parseUnits("2", "gwei"),
        nonce: initialNonce + i * tpb + j,
      });
      p.push(tx);
    }
    await Promise.all(p);
    console.log(i);
    await new Promise((resolve) => setTimeout(resolve, 100));
  }
}

main().catch((error) => {
  console.error(error);
  process.exitCode = 1;
});

v1.0.0

       158527026 26 1    0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158527028 26 1    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25
       158527029 26 1    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25
       158527030 26 1    1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25
       158527030 26 1    1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25
       158527032 26 1    0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25
       158527033 26 1    0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25
       158527033 26 1    0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25
       158527035 26 1    0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25
       158527036 26 1    0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25
       158527037 26 1    0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0         25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25
       158527038 27 1    0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2         25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26
       158527039 26 1    0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0         25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25
       158527040 26 1    0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1         25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25
       158527042 26 1    0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0         25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25
       158527043 26 1    0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0         25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25
       158527044 26 1    1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0,0         25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25,25
       158527045 26 1    0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0,0,0         25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25,25,25

v1.0.1-rc.1 - sudden increases

       158527026 25 0    0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25
       158527028 25 0    0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25
       158527029 25 0    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25
       158527030 25 0    1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25
       158527031 50 25   0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26
       158527032 25 0    0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25
       158527033 25 0    0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25
       158527034 51 25   0,0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2         25,25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26
       158527035 25 0    0,0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0         25,25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25
       158527036 25 0    0,0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0         25,25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25
       158527037 25 0    0,0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0         25,25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25
       158527038 51 25   0,0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2         25,25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26
       158527039 25 0    0,0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0         25,25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25
       158527040 25 0    0,0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1         25,25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25
       158527041 51 25   0,0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2         25,25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26
       158527042 25 0    0,0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0         25,25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25
       158527043 25 0    0,1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0         25,25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25
       158527044 25 0    1,0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0,0         25,25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25,25
       158527045 25 0    0,2,0,0,0,2,0,0,2,0,0,0,2,0,1,2,0,0,0,0         25,25,26,25,25,25,26,25,25,26,25,25,25,26,25,25,26,25,25,25,25

v1.0.1-rc.3 (temp)

bn  Original    Buffered    TipCap        Reward history                              Base fee history                                                    Base fee (Next)
530 25000000000 27500000000 0        	 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25 	 25000000000
531 26250000000 28875000000 0 	         0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26 	 26250000000
532 27562500000 30318750000 0 	         0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27 	 27562500000
533 28940625000 31834687500 0 	         0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28 	 28940625000
534 30387656250 33426421875 0 	         0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30 	 30387656250
535 31907039062 35097742968 0 	         0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30,31 	 31907039062
536 33502391014 40527749666 2000000000 	 0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,2,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30,31,33 	 33502391014
537 35177510564 42454137148 2000000000 	 0,0,0,0,0,1,0,0,0,1,0,0,0,2,2,2,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30,31,33,35 	 35177510564
538 36936386092 44476844005 2000000000 	 0,0,0,0,1,0,0,0,1,0,0,0,2,2,2,2,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30,31,33,35,36 	 36936386092
539 38783205396 46600686205 2000000000 	 0,0,0,1,0,0,0,1,0,0,0,2,2,2,2,2,2,2,2,2 	 25,25,25,25,25,25,25,25,25,25,25,25,26,27,28,30,31,33,35,36,38 	 38783205396
...
564 29267846602 35658023592 2000000000 	 2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 49,51,54,57,60,63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29 	 29267846602
565 27804454272 33975122412 2000000000 	 2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 51,54,57,60,63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27 	 27804454272
566 26414231558 32376366291 2000000000 	 2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 54,57,60,63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26 	 26414231558
567 25093519981 30857547977 2000000000 	 2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 57,60,63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26,25 	 25093519980
568 25000000000 27500000000 0 	         2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 60,63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26,25,25 	 25000000000
569 25000000000 27500000000 0 	         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 63,60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26,25,25,25 	 25000000000
570 25000000000 27500000000 0 	         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 60,57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26,25,25,25,25 	 25000000000
571 25000000000 27500000000 0 	         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 	 57,54,51,48,46,44,41,39,37,35,34,32,30,29,27,26,25,25,25,25,25 	 25000000000

@blukat29
Copy link
Contributor Author

blukat29 commented Jul 3, 2024

The Go RPC client supports type-2 transactions

  • Deploy private network

    • generate and setup the private network directory by executing ./homi setup --gen-type=local --cn-num 1 --chainID 292929 --test-num 3
    • prepare the test account. (1) Should be unlocked (2) Should have KAIAs
      • in here, used the generated test account by homi
      • in here, unlocked by passing unlock flags ADDITIONAL="--unlock 0,1 --password ~~/pwd.txt"
  • testscript: Archive.zip

    • (1) go.mod: used kaia-v1.0.1-rc.1 (2) kaiaClientTestScript.go: should modify the parameters for the test
  • Result result.log

    • import of kaia-v1.0.1-rc.1
    • [PASSED] TestClientEstimateGas: Expected - should return gas. Actual - Returned gas.
      • TxTypeLegacyTransaction when gasPrice > baseFee.
      • TxTypeLegacyTransaction when gasPrice < baseFee.
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee+100 and gasTipCap is (0~100).
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee and gasTipCap is (0~50000).
    • [PASSED] TestClientCallContract: Expected - should return res. Actual -
      • TxTypeLegacyTransaction && gasPrice > baseFee.
      • TxTypeLegacyTransaction && gasPrice < baseFee.
      • TxTypeEthereumDynamicFee && gasFeeCap is baseFee+10000 && gasTipCap is (0~100).
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee and gasTipCap is (0~50000).
    • [PASSED] TestClientSendTx: Expected - should match txtype, effectiveGasPrice is correct. Actual -matched,correct.
      • TxTypeLegacyTransaction when gasPrice == baseFee
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee+10000 and gasTipCap is (0~100).
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee and gasTipCap is (0~50000).
    • [FAILED->PASSED with fix] TestClientSendUnsignedTransaction: Expected - should match txtype, effectiveGasPrice is correct. Actual - TxType is not matched.
      • TxTypeLegacyTransaction when gasPrice == baseFee
      • TxTypeLegacyTransaction when gasPrice < baseFee. Expected - failed, Actual - failed.
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee+10000 and gasTipCap is (0~100). Expected-effectiveGasPrice is basefee+gasTipCap. txtype should matched. Actual - baseFee+gasTipCap, txType matched.
      • TxTypeEthereumDynamicFee when gasFeeCap is baseFee and gasTipCap is (0~50000). Expected-effectiveGasPrice is basefee. txtype should matched. Actual - basefee, txType matched.

@blukat29
Copy link
Contributor Author

blukat29 commented Jul 3, 2024

CI packaging pipeline

  • 1. rpm package
$ wget https://packages.kaia.io/kaia/v1.0.1~rc.1/kend-v1.0.1~rc.1-0.el7.x86_64.rpm
$ rpm -qlp kend-v1.0.1~rc.1-0.el7.x86_64.rpm
/etc/init.d/kend
/etc/kend/conf/kend.conf
/usr/bin/ken
$ sudo yum remove kend.x86_64  # remove v1.12.1-0.el7 package (if installed)
$ sudo yum install ./kend-v1.0.1~rc.1-0.el7.x86_64.rpm
Installed:
  kend.x86_64 0:v1.0.1~rc.1-0.el7
Complete!
  
$ ken version
Kaia v1.0.1
$ sudo /etc/init.d/kend start
$ sudo ken attach /var/kend/data/klay.ipc
> kaia.clientVersion()
"Klaytn/v1.0.1/linux-amd64/go1.22.1"
  • 2. tgz package
$ uname -a
Linux workspace 6.5.0-1020-aws #20~22.04.1-Ubuntu SMP Wed May  1 16:10:50 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ wget https://packages.kaia.io/kaia/v1.0.1~rc.1/ken-v1.0.1~rc.1-0-linux-amd64.tar.gz
$ tar xf ken-v1.0.1~rc.1-0-linux-amd64.tar.gz
$ tree ken-linux-amd64
ken-linux-amd64/
├── bin
│   ├── ken
│   └── kend
└── conf
    └── kend.conf

$ cd ken-linux-amd64
$ ./bin/ken version
Kaia v1.0.1~rc.1+1aca7b125c
$ echo "DATA_DIR=data" >> conf/kend.conf && echo "LOG_DIR=logs" >> conf/kend.conf && mkdir -p data && mkdir -p logs
$ ./bin/kend start
$ ./bin/ken attach ./data/klay.ipc
> kaia.clientVersion()
"Klaytn/v1.0.1~rc.1/linux-amd64/go1.22.1"

@yoomee1313
Copy link
Contributor

yoomee1313 commented Jul 4, 2024

Regular test

  • RPC/WS test Passed. KaiaTestReport.pdf
  • Governance test Passed. result.log
  • Rolling update test Passed. kaia-v1.0.0 -> kaia-v1.0.1
  • (optional) Rosetta-test

@hyunsooda
Copy link
Contributor

hyunsooda commented Jul 4, 2024

kscn can successfully query the main chain's data via subbridge_parentOperatorBalance

v1.0.0:

> subbridge.parentOperatorBalance
Error: the method klay_getBalance does not exist/is not available
        at web3.js:6810:9(39)
        at get (web3.js:6710:66(14))
        at <eval>:1:11(1)

v1.0.1-rc.1:

> subbridge.parentOperatorBalance
6.25e+48

@blukat29
Copy link
Contributor Author

blukat29 commented Jul 10, 2024

debug trace

  • archive node
    • RPC callTracer format
    • chaindatafetcher trace format (with fix)
    • state regeneration
  • full node
    • RPC callTracer format
    • chaindatafetcher trace format (with fix)
    • state regeneration
debug_trace RPC test cases (#15)

CallTrace formats (see #15)

conf={tracer: 'callTracer'}
debug.traceTransaction('0xf3b71a6f97667dba14aef6d512c9bb01c7af43756e464c57e12b2fdfa7a9d3f2', conf)
debug.traceTransaction('0x49aa6074a3b4970399ef2af12b109c4cb4a65ab8a833d1540e4cefa657a3c0c7', conf)
debug.traceTransaction('0x931c5af31bfb906fc20effa0f90f1a8e66edefac9879729fedd18a65d64a11be', conf)
debug.traceTransaction('0xb71df5a6628cd2c193c5155c4dabbd45604a6207334c793b512293e165a04526', conf)
debug.traceTransaction('0xdf06945964fb2f966c89716bb936da523964c73ee30c0f556baaad90263facfd', conf)
debug.traceTransaction('0xac43859eb4064916e8be8e74645d6019cc48cb6791f68ea21d42ead6bba569b5', conf)
chaindatafetcher test (#16)

Launch local kafka

# Test kafka docker-compose.yml. Not for production.
services:
  kafka:
    image: bitnami/kafka:3.7
    ports:
      - "9092:9092"
    environment:
      KAFKA_CFG_NODE_ID: 0
      KAFKA_CFG_PROCESS_ROLES: controller,broker
      KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: [email protected]:9093
      KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
      KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
      KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
      KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
      KAFKA_CFG_INTER_BROKER_LISTENER_NAME: PLAINTEXT

Print incoming kafka messages

docker-compose up -d
docker-compose exec kafka kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic local.klaytn.chaindatafetcher.en-0.tracegroup.v1

Setup chaindatafetcher

ADDITIONAL="--chaindatafetcher \
--chaindatafetcher.mode kafka \
--chaindatafetcher.kafka.brokers localhost:9092"

Call range fetching for the blocks containing debug_trace RPC test cases

chaindatafetcher.startRangeFetching(156280235,156280235,'trace')
chaindatafetcher.startRangeFetching(156322608,156322608,'trace')
chaindatafetcher.startRangeFetching(157093750,157093750,'trace')
chaindatafetcher.startRangeFetching(157223508,157223508,'trace')
chaindatafetcher.startRangeFetching(157225294,157225294,'trace')
chaindatafetcher.startRangeFetching(156280549,156280549,'trace')
State regen test case (#43)

State regeneration

// Test
txid='0x3b0fa88a91ac18b91e0aae17fb85a7d78aad92ffed66803ec7e3b10d3d217878'
block=157805568
idx = 0
conf={tracer: 'callTracer'}
T = debug.traceTransaction(txid, conf).calls[0].value
B = debug.traceBlockByNumber(block, conf)[idx].result.calls[0].value
R = debug.traceBlockByNumberRange(block, block, conf)[block].traces[idx].result.calls[0].value

// Correct value
to = '0x97d88c37e7086decc0a207426fbc38bc9c6e5e3e'
kaia.getAccount(to, block).account.balance
"0xc83bc715f06e921dfa"
kaia.getAccount(to, block-1).account.balance
"0xc678ada73997e4ce4c"
>>> v = 0xc83bc715f06e921dfa - 0xc678ada73997e4ce4c
>>> v, hex(v)
(32505133517088051118, '0x1c3196eb6d6ad4fae')

@blukat29 blukat29 reopened this Jul 11, 2024
@blukat29
Copy link
Contributor Author

blukat29 commented Jul 14, 2024

istanbul snapshot and staking info

  • 1. no 'failed to update kaia stakingInfo' error during node startup
v1.0.1-rc.2 - ERROR messages from the last multiple of 1024 to current block
$ kend restart
...
INFO[07/14,14:44:09 Z] [5] Loaded most recent local header           number=159386816 hash=61ecf4…10fc59 td=159386817 age=7s99ms
INFO[07/14,14:44:09 Z] [5] Loaded most recent local full block       number=159386816 hash=61ecf4…10fc59 td=159386817 age=7s99ms
INFO[07/14,14:44:09 Z] [5] Loaded most recent local fast block       number=159386816 hash=61ecf4…10fc59 td=159386817 age=7s99ms
INFO[07/14,14:44:09 Z] [5] prefetchTxWorkers are started             num=32
INFO[07/14,14:44:09 Z] [41] Live pruning is disabled because flag not stored in database
INFO[07/14,14:44:09 Z] [5] InitDeriveSha                             initial=0 withGov=true
INFO[07/14,14:44:09 Z] [5] Loaded local transaction journal          transactions=0 dropped=0
INFO[07/14,14:44:09 Z] [5] Regenerated local transaction journal     transactions=0 accounts=0
ERROR[07/14,14:44:09 Z] [44] failed to update kaia stakingInfo         block number=159386625 err="failed to get state at number 159386625. root err: missing trie node 1e7248fae3d7fd0aad75c5c0d566ce28bf8fd4addb215a1a94fcdf3ab696b07b (path )"
ERROR[07/14,14:44:09 Z] [44] failed to update kaia stakingInfo         block number=159386626 err="failed to get state at number 159386626. root err: missing trie node 91c427030d7c3dcb61d69f2595e5da292fe57c16dabea6b847e79e875c3ff92a (path )"
...
ERROR[07/14,14:44:09 Z] [44] failed to update kaia stakingInfo         block number=159386814 err="failed to get state at number 159386814. root err: missing trie node ad6ada614fdbd7daeb3ccee99dd7f6a6bd758caf40a2db30f5cf556d233fb930 (path )"
ERROR[07/14,14:44:09 Z] [44] failed to update kaia stakingInfo         block number=159386815 err="failed to get state at number 159386815. root err: missing trie node f93cdecd7b9fb5001f3db5bdd97d6161bd301fcd8a16a78ce516416dfe962d5b (path )"
INFO[07/14,14:44:09 Z] [40] Starting P2P networking
...
INFO[07/14,14:44:39 Z] [28] Downloader queue stats                    receiptTasks=0 blockTasks=0 stakingInfoTasks=0 itemSize=744.90B throttle=8192
INFO[07/14,14:44:39 Z] [5] Inserted a new block                      number=159386817 hash=5d860d…e8bd7d txs=0 gas=0 elapsed=50.456ms  processTxs=176ns finalize=6.710ms validateState=608.51µs totalWrite=1.587822ms trieWrite=991.401µs
v1.0.1-rc.3 - creating Istanbul snapshot at startup
$ kend restart
INFO[07/17,11:58:53 Z] [49] Initialized local trie node cache (fastCache)  LoadedMiB=0 LoadedEntries=0 elapsed=318.647µs
INFO[07/17,11:58:53 Z] [5] Loaded most recent local header           number=159636098 hash=c30d76…52cb00 td=159636099 age=9s784ms
INFO[07/17,11:58:53 Z] [5] Loaded most recent local full block       number=159636098 hash=c30d76…52cb00 td=159636099 age=9s784ms
INFO[07/17,11:58:53 Z] [5] Loaded most recent local fast block       number=159636098 hash=c30d76…52cb00 td=159636099 age=9s784ms
INFO[07/17,11:58:53 Z] [5] prefetchTxWorkers are started             num=32
INFO[07/17,11:58:53 Z] [41] Live pruning is disabled because flag not stored in database
INFO[07/17,11:58:53 Z] [5] InitDeriveSha                             initial=0 withGov=true
INFO[07/17,11:58:53 Z] [5] Loaded local transaction journal          transactions=0 dropped=0
INFO[07/17,11:58:53 Z] [5] Regenerated local transaction journal     transactions=0 accounts=0
INFO[07/17,11:58:53 Z] [41] Start creating istanbul snapshot
INFO[07/17,11:59:08 Z] [41] Finished creating istanbul snapshot
INFO[07/17,11:59:08 Z] [40] Starting P2P networking
  • 2. staking info related APIs for historic blocks

Check that archive nodes successfully serve for any block/block range.
Check that full nodes (a) serve some blocks or (b) return a 'missing trie node' error otherwise.

  • single-block APIs that work for num % 128 == 1 or any block on archive mode -- those who depend on staking info
    • kaia_getStakingInfo
    • kaia_getRewards
  • single-block APIs that work for num % 1024 == 1 or any block on archive mode -- those who depend on staking info and Istanbul snapshot
    • kaia_getCouncil
    • kaia_getCouncilSize
    • kaia_getCommittee
    • kaia_getCommitteeSize
    • istanbul_getSnapshot -- (exceptional) work for num % 1024 == 0
    • istanbul_getValidators
    • istanbul_getDemotedValidators
    • kaia_getBlockWithConsensusInfoByNumber
  • multi-block APIs that only works in archive mode
    • governance_getRewardsAccumulated
    • kaia_getBlockWithConsensusInfoByNumberRange
console test case
n = 159520000 // multiple of 128, not multiple of 1024
n % 1024
n % 128
m = 159519744 // multiple of 1024
m % 1024
m % 128

kaia.getStakingInfo(n)
kaia.getStakingInfo(n+1)
kaia.getRewards(n)
kaia.getRewards(n+1)

kaia.getCouncil(m)
kaia.getCouncil(m+1)
kaia.getCouncilSize(m)
kaia.getCouncilSize(m+1)
kaia.getCommittee(m)
kaia.getCommittee(m+1)
kaia.getCommitteeSize(m)
kaia.getCommitteeSize(m+1)
istanbul.getSnapshot(m)
istanbul.getSnapshot(m+1)
istanbul.getValidators(m)
istanbul.getValidators(m+1)
istanbul.getDemotedValidators(m)
istanbul.getDemotedValidators(m+1)
kaia.getBlockWithConsensusInfo(m)
kaia.getBlockWithConsensusInfo(m+1)

governance.getRewardsAccumulated(n+1,n+1) // rare case that works in full node
governance.getRewardsAccumulated(n,n+1) // missing trie node

kaia.getBlockWithConsensusInfoRange(m, m+2) // Result for some blocks are `nil` 
  • 3. Block ConsensusInfo via chaindatafetcher blockgroup message
    • live blocks (startFetching), archive node: works ok
    • live blocks (startFetching), full node:
      • initial batch (from checkpoint to head) skipped with WARN messages ("skip fetching block")
      • head blocks are correctly published to Kafka
    • historic blocks (startRangeFetching), archive node: works ok
    • historic blocks (startRangeFetching), full node: skipped with WARN messages ("skip fetching block")

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

Successfully merging a pull request may close this issue.

3 participants