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

fix decimal problem in CN/KIR/KGF reward #135

Merged
merged 4 commits into from
Oct 21, 2022
Merged

fix decimal problem in CN/KIR/KGF reward #135

merged 4 commits into from
Oct 21, 2022

Conversation

JayChoi1736
Copy link
Contributor

@JayChoi1736 JayChoi1736 commented Oct 21, 2022

Fixes # .

Motivation

Error in Baobab check:data:
Reconciliation failed for 0xB2bd3178AFFCcD9F9F5189457f1Cad7D17A01c9D at 102775656
computed: 85417893214482613665126234KLAY
live: 85417893214482613665126235KLAY

badger 2022/10/06 18:50:54 INFO: Storing value log head: {Fid:0 Len:30 Offset:373660}
Removing temporary directory /tmp/803135562
Missing ops for 0xB2bd3178AFFCcD9F9F5189457f1Cad7D17A01c9D in block 102775656:0xccf1988dfd388f27a4d43ace0ccac91b47cac71fe30409f19b03fafcd8bd980c

Error: failed to call "reconciliation fail" action: inactive reconciliation error for account address 0xB2bd3178AFFCcD9F9F5189457f1Cad7D17A01c9D at block index 102775880 (computed: 85418066482579957915126234KLAY, live: 85418066482579957915126235KLAY): reconciliation failure

The previous problem occurred because rosetta-klaytn calculates feeReward in units of transactions.
if there is two transactions which have 20 peb fee reward for each, klaytn calculates the reward as
CNreward : 40 * 0.34 = 13.6 -> 13
KIRreward : 40 * 0.54 = 21.6 -> 21
KGFReward : 40-13-21 = 6

but formal rosetta-klaytn calculates the reward as
CNreward : (20 * 0.34 = 6.8 -> 6) * 2 -> 12
KIRReward : (20* 0.54 = 10.8 ->10) *2 -> 20
KGFReward : (20-6-10 -> 4) *2 -> 8

This problem occurs after Magma hardfork (Since the basefee can no longer be in ston units... )

Solution

Changed the rosetta-klaytn fee operation method to the same method as Klaytn reward distributor

Open questions

@JayChoi1736 JayChoi1736 requested a review from kjeom October 21, 2022 00:00
@JayChoi1736 JayChoi1736 self-assigned this Oct 21, 2022
@JayChoi1736 JayChoi1736 requested a review from kjhman21 as a code owner October 21, 2022 00:00
@github-actions
Copy link

github-actions bot commented Oct 21, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@JayChoi1736 JayChoi1736 reopened this Oct 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2022
@klaytn klaytn unlocked this conversation Oct 21, 2022
@JayChoi1736 JayChoi1736 merged commit 83ca2bc into klaytn:dev Oct 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants