From eb26db04df1b9adfe8c49ad6c83fffa8e5ee11c5 Mon Sep 17 00:00:00 2001 From: trustfarm Date: Thu, 25 Mar 2021 00:02:12 +0900 Subject: [PATCH 1/5] KIP-1000 BlockGeneration Policy Core Consensus change proposals --- KIPs/kip-1000.md | 138 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 KIPs/kip-1000.md diff --git a/KIPs/kip-1000.md b/KIPs/kip-1000.md new file mode 100644 index 00000000..0341035d --- /dev/null +++ b/KIPs/kip-1000.md @@ -0,0 +1,138 @@ +--- +kip: 1000 +title: Klyatn Block generation consensus change proposals +author: KT Ahn "안씨아저씨" +status: Draft +type: Core +category: +created: 2021-03-23 +requires: None +--- + +## Simple Summary + +한글로 된 버전은 클레이튼 [포럼의 토픽 #790](https://forum.klaytn.com/t/topic/790) 을 참조하여 주세요. + + +Current Klyatn Consensus block generation scheme has target on 1block / 1seconds. +It is very ideal for fast payments confirm and one finality. +But, It makes burden on validator nodes and endpoint nodes. +And, Almost block has 0 TX. + +This IP(Improvement Proposal) is make klaytn networks more broaden and less burden on nodes. +Change default max (deadline) blocktime to 30seconds, and if there's at lease one of TX in TXpool, then generate blocks. it means 1tx/1block/1seconds or 1tx/1block/3seconds ... deadline 30seconds generate blocks. + +1Block/1Seconds It makes consume the P2P Network Bandwidth Overhead and Computing power overheads. +because of so heavy block generation makes heavy block overhead itself. + +Thus, It is one of big barrier for expand Klaytn ECO. +It means that whose hope to participates on Klyatn , they needs to spend many money for spend high performance node instance fees or high cost hw. + +Also, beginner or no technition , it is hard to join the networks, even though they have good willings on klaytn. + +So, it will finally blocking the Every nodes participates on Klaytn networks. +TX and Block increases remained nodes will very small (except klaytn organization and closed partners). +It will hazardous states on Klaytn blockchain networks, even though Klyan stance semi-public network or almost private domain network. + +## Abstract + +This standard outlines a apply deadline block generation policy. +In the aspect of many reasons for improve Klaytn networks. +Above [## Simple Summary] describes all. + +## Motivation + +Recent days, Klaytn has more interested on investors, developers, thirdparty company. +they have saying the slow sync problem. +I also tried to sync latest Klaytn EndPoint Node, very longer time spend, compared to Ethereum based chains. Compare with Overall TX counts. + +## Specification + +1. Deadline blocktime to 30 seconds. +2. if there's no TX , not generates block. +3. if there's atleast 1 TX generates block within deadline time. + +Pseudo Code of KIP-1000 consensus. +`C` language Style + +``` + struct SimpleBlockInfo { + bignumber blocknumber; + bytes512 blockhash; + datetime generatetime; + }; + struct SimpleBlockInfo __G_lastBlockinfo; + + void updateLastBlockInfo(BlockObj Block) + { + __G_lastBlockinfo.blocknumber = Block->blocknumber; + memcpy( <> (__G_lastBlockinfo.blockhash) , Block->blockhash , 512); + __G_lastBlockinfo.generatetime = Block->generatetime; + } + + struct SimpleBlockInfo <> getLastBlockInfo( struct <>lastBlockinfo ) + { + lastBlockinfo->blocknumber = __G_lastBlockinfo.blocknumber; + memcpy( <> (lastBlockinfo->blockhash) , <> __G_lastBlockinfo.blockhash , 512); + lastBlockinfo->generatetime = __G_lastBlockinfo.generatetime; + return <> lastBlockinfo; // self referencing pointer for outer function usability + } + + OnBlockReceived( BlockObj Block) + { + // updates blockinformation + updateLastBlockInfo(Block); + + // ToDo :: legacy jobs. + ... + } + + OnBlockGeneration( BlockObj newBlock ) { + // check conditions + // 1> timehas spend over 30Seconds or not + // 2> check TXpool is not empty + // 3> is this newblocknumber and blockhash is different than lastblock + + struct SimpleBlockInfo lastBlockinfo; + + getLastBlockInfo( <>lastBlockinfo ); + + // check blocknumber and blockhash + if ( (lastBlockinfo.blocknumber == newBlock->blocknumber) + || (lastBlockinfo.blockhash == newBlock->blockhash ) ) + { + debugLog("new block is same as last one ", newBlock->blocknumber , "\n"); + return; + } + + // check Time Spend 30Seconds deadline + if ( diffTime( now(), lastBlockinfo.generatetime) >= 30 ) + + // TODO :: GenerateBlock() + LegacyGenerateBlock(newBlock); + + updateLastBlockInfo(newBlock); + return; + ) + + // check TX has empty or not + if ( (newBlock->TxPool->count == 0) || (newBlock->TxPool->Txlist == NULL) ) + return; + + // TODO:: GenerateBlock() + LegacyGenerateBlock(newBlock); + + updateLastBlockInfo(newBlock); + return; + } + +``` + + +## History + +1. First Draft :: reference ideation and suggestion links [Forum Topic #790](https://forum.klaytn.com/t/topic/790) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 1715d0c67453260b67b41230d4f1d12744586852 Mon Sep 17 00:00:00 2001 From: Trustfarm-heart Date: Fri, 26 Mar 2021 01:07:08 +0900 Subject: [PATCH 2/5] Update KIPs/kip-1000.md Co-authored-by: Junghyun Colin Kim --- KIPs/kip-1000.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KIPs/kip-1000.md b/KIPs/kip-1000.md index 0341035d..db160b0c 100644 --- a/KIPs/kip-1000.md +++ b/KIPs/kip-1000.md @@ -14,7 +14,7 @@ requires: None 한글로 된 버전은 클레이튼 [포럼의 토픽 #790](https://forum.klaytn.com/t/topic/790) 을 참조하여 주세요. -Current Klyatn Consensus block generation scheme has target on 1block / 1seconds. +Current Klaytn Consensus block generation scheme has target on 1block / 1seconds. It is very ideal for fast payments confirm and one finality. But, It makes burden on validator nodes and endpoint nodes. And, Almost block has 0 TX. From f9253f51a9ceec444567193ddb40094c10e8782d Mon Sep 17 00:00:00 2001 From: Trustfarm-heart Date: Fri, 26 Mar 2021 01:17:47 +0900 Subject: [PATCH 3/5] Update and rename kip-1000.md to kip-55.md --- KIPs/{kip-1000.md => kip-55.md} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename KIPs/{kip-1000.md => kip-55.md} (97%) diff --git a/KIPs/kip-1000.md b/KIPs/kip-55.md similarity index 97% rename from KIPs/kip-1000.md rename to KIPs/kip-55.md index db160b0c..531bb71e 100644 --- a/KIPs/kip-1000.md +++ b/KIPs/kip-55.md @@ -1,6 +1,6 @@ --- -kip: 1000 -title: Klyatn Block generation consensus change proposals +kip: 55 +title: Klaytn Block generation consensus change proposals author: KT Ahn "안씨아저씨" status: Draft type: Core @@ -52,7 +52,7 @@ I also tried to sync latest Klaytn EndPoint Node, very longer time spend, compar 2. if there's no TX , not generates block. 3. if there's atleast 1 TX generates block within deadline time. -Pseudo Code of KIP-1000 consensus. +Pseudo Code of KIP-55 consensus. `C` language Style ``` From da63c32205d776db418b83ccc2e3e109b87effc4 Mon Sep 17 00:00:00 2001 From: Trustfarm-heart Date: Fri, 26 Mar 2021 01:32:29 +0900 Subject: [PATCH 4/5] Fix Typo :: Adds Validator Economic model **[No TxMining Activity, No Rewards]** --- KIPs/kip-55.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/KIPs/kip-55.md b/KIPs/kip-55.md index 531bb71e..b4b46a73 100644 --- a/KIPs/kip-55.md +++ b/KIPs/kip-55.md @@ -28,11 +28,11 @@ because of so heavy block generation makes heavy block overhead itself. Thus, It is one of big barrier for expand Klaytn ECO. It means that whose hope to participates on Klyatn , they needs to spend many money for spend high performance node instance fees or high cost hw. -Also, beginner or no technition , it is hard to join the networks, even though they have good willings on klaytn. +Also, beginner or no technition , it is hard to join the networks, even though they have good willings on Klaytn. So, it will finally blocking the Every nodes participates on Klaytn networks. TX and Block increases remained nodes will very small (except klaytn organization and closed partners). -It will hazardous states on Klaytn blockchain networks, even though Klyan stance semi-public network or almost private domain network. +It will hazardous states on Klaytn blockchain networks, even though Klaytn stance semi-public network or almost private domain network. ## Abstract @@ -128,10 +128,18 @@ Pseudo Code of KIP-55 consensus. ``` +## Validator Economic Model and Motivation to Validator + +Validators are responsible to expand ECO or promote Klaytn networks, and securing networks. +If they just funding but no activities increase network usability, finally they loose there funds values. +This model of consensus forces to validators more active, more promotes use of Klaytn networks, for get a more TX mining rewards and Block Rewards. +If there's TX has very low, their Block Rewards to decrease to 1/30. +"No TX mining action!, No Rewards" ## History -1. First Draft :: reference ideation and suggestion links [Forum Topic #790](https://forum.klaytn.com/t/topic/790) +1. 21/03/25 :: First Draft :: reference ideation and suggestion links [Forum Topic #790](https://forum.klaytn.com/t/topic/790) +2. 21/03/26 :: Fix Typo :: Adds Validator Economic model **[No TxMining Activity, No Rewards]** ## Copyright From e34701d42cb061f4949333c1dd1d2a4d53df3658 Mon Sep 17 00:00:00 2001 From: Trustfarm-heart Date: Fri, 26 Mar 2021 01:39:57 +0900 Subject: [PATCH 5/5] updates bold marks on core sentences. --- KIPs/kip-55.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/KIPs/kip-55.md b/KIPs/kip-55.md index b4b46a73..a5914d55 100644 --- a/KIPs/kip-55.md +++ b/KIPs/kip-55.md @@ -130,16 +130,16 @@ Pseudo Code of KIP-55 consensus. ## Validator Economic Model and Motivation to Validator -Validators are responsible to expand ECO or promote Klaytn networks, and securing networks. +**Validators are responsible to expand ECO or promote Klaytn networks, and securing networks.** If they just funding but no activities increase network usability, finally they loose there funds values. -This model of consensus forces to validators more active, more promotes use of Klaytn networks, for get a more TX mining rewards and Block Rewards. -If there's TX has very low, their Block Rewards to decrease to 1/30. -"No TX mining action!, No Rewards" +This model of consensus **forces to validators more active, more promotes use of Klaytn networks, for get a more TX mining rewards and Block Rewards.** +If there **TXs are very low, their Block Rewards to decrease to 1/30.** +***"No TX mining action!, No Rewards"*** ## History 1. 21/03/25 :: First Draft :: reference ideation and suggestion links [Forum Topic #790](https://forum.klaytn.com/t/topic/790) -2. 21/03/26 :: Fix Typo :: Adds Validator Economic model **[No TxMining Activity, No Rewards]** +2. 21/03/26 :: Fix Typo :: Adds Validator Economic model ***[No TxMining Activity, No Rewards]*** ## Copyright