Skip to content

Add S7 pubkeys and HF estimate#585

Merged
ca333 merged 2 commits intodevfrom
s7-pubkeys
May 29, 2023
Merged

Add S7 pubkeys and HF estimate#585
ca333 merged 2 commits intodevfrom
s7-pubkeys

Conversation

@smk762
Copy link
Copy Markdown

@smk762 smk762 commented May 17, 2023

Harvested via https://github.com/KomodoPlatform/NotaryNodes/blob/master/season7/elected_nn_social.json

Hardfork block estimate calculated with https://github.com/KomodoPlatform/NotaryNodes/blob/master/utils/generate_nn_social.py#L208-L227

Enter the target hardfork timestamp: 1688132253
Enter the current block height: 3423973
Seconds until HF: 3781131
Expected blocks until HF: 63018
Checkpoint block: 3360955
Checkpoint blocktime: 1680424784
Time since checkpoint: 3926338
Seconds per block average: 62
Estimated blocks until HF: 60985
Estimated HF block: 3484958

@smk762 smk762 requested review from Alrighttt, DeckerSU, ca333 and dimxy May 17, 2023 19:29
@smk762 smk762 mentioned this pull request May 17, 2023
18 tasks
@dimxy
Copy link
Copy Markdown
Collaborator

dimxy commented May 18, 2023

I looked over generate_nn_social.py and wonder why is for average block time estimation a depth equal to the blocks count till the planned hardfork used? Why not just take average for some rather long past period, like the whole year?
It seems to me that the longer time span the more precise estimations would be.
(btw is this a new algo or we use it every year?)

@smk762
Copy link
Copy Markdown
Author

smk762 commented May 18, 2023

I looked over generate_nn_social.py and wonder why is for average block time estimation a depth equal to the blocks count till the planned hardfork used? Why not just take average for some rather long past period, like the whole year? It seems to me that the longer time span the more precise estimations would be. (btw is this a new algo or we use it every year?)

I can do it over a longer period, though thought that more recent blocks may have a greater weight for recent conditions. I'll do a few more time frames to see how it compares.

Its a "new" algo - in the past I believe a simple assumed 1 block per minute was used, but last year due to slow block production it was inaccurate. Since then production has stabilised (we added some things in last years HF to help).

I was actually surprised to see the average over the last 6 weeks was pretty close to 60 sec, only 2 extra seconds.

@dimxy
Copy link
Copy Markdown
Collaborator

dimxy commented May 18, 2023

I looked over generate_nn_social.py and wonder why is for average block time estimation a depth equal to the blocks count till the planned hardfork used? Why not just take average for some rather long past period, like the whole year? It seems to me that the longer time span the more precise estimations would be. (btw is this a new algo or we use it every year?)

I can do it over a longer period, though thought that more recent blocks may have a greater weight for recent conditions. I'll do a few more time frames to see how it compares.

Maybe good to compare with the same period before the past hardfork

@Alrighttt
Copy link
Copy Markdown

Double checked that there were no errors in any of the keys submitted via:

#!/usr/bin/env python3

import json
import base58
import bitcoin
from bitcoin.wallet import P2PKHBitcoinAddress
from bitcoin.core import x
from bitcoin.core import CoreMainParams


with open("socials.json") as key_list:
    socials = json.load(key_list)

class CoinParams(CoreMainParams):
    BASE58_PREFIXES = {'PUBKEY_ADDR': 60,
                       'SCRIPT_ADDR': 85,
                       'SECRET_KEY': 188}
bitcoin.params = CoinParams

for op in socials:
	for region in socials[op]['regions']:
		for party in socials[op]['regions'][region]:
			key = socials[op]['regions'][region][party]
			assert str(P2PKHBitcoinAddress.from_pubkey(x(key['pubkey']))) == key['KMD address']

class CoinParams(CoreMainParams):
    BASE58_PREFIXES = {'PUBKEY_ADDR': 48,
                       'SCRIPT_ADDR': 50,
                       'SECRET_KEY': 176}
bitcoin.params = CoinParams

for op in socials:
	for region in socials[op]['regions']:
		for party in socials[op]['regions'][region]:
			key = socials[op]['regions'][region][party]
			assert str(P2PKHBitcoinAddress.from_pubkey(x(key['pubkey']))) == key['LTC address']

@smk762
Copy link
Copy Markdown
Author

smk762 commented May 19, 2023

Checked blocktimes over the last 360 days alongside each 30 day slice within that timeframe.
https://0bin.net/paste/EpHWcGsa#Pehpn6jG4jSEZPPKFkMsAUtoie+s7v7R8Enhs6B0wwg

HF estimated block range: 3484507 - 3485925
HF Estimated block average: 3485590

Open to any other methods or suggestions.

@dimxy
Copy link
Copy Markdown
Collaborator

dimxy commented May 19, 2023

Considering the fact that block generation is more stable this season,
I think the proposed estimation using the recent blocks should be okay

dimxy
dimxy previously approved these changes May 19, 2023
Copy link
Copy Markdown
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

DeckerSU
DeckerSU previously approved these changes May 25, 2023
Copy link
Copy Markdown

@DeckerSU DeckerSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

After merge this PR, we also need to merge #584 , it's already rebased on s7-pubkeys branch, and contains all needed pubkeys / constants changes.

p.s. KomodoOcean codebase also will have all of our S7 related changes cherry-picked in the https://github.com/DeckerSU/KomodoOcean/tree/patch-s7 branch.

@ca333 ca333 dismissed stale reviews from DeckerSU and dimxy via b416d47 May 29, 2023 19:25
@DeckerSU DeckerSU self-requested a review May 29, 2023 19:59
Copy link
Copy Markdown

@DeckerSU DeckerSU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ca333 ca333 merged commit 1ac4453 into dev May 29, 2023
who-biz pushed a commit to who-biz/komodo that referenced this pull request Jun 22, 2025
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 this pull request may close these issues.

5 participants