Skip to content

Conversation

@illuzen
Copy link
Contributor

@illuzen illuzen commented Dec 22, 2025

This does not involve meaningful change to the block header. Instead, we reinterpret the 32 byte accountid as the wormhole address preimage and send rewards there.

Also deleted the redundant and outdated mining info in the readme and updated mining.md

* exponentially decaying token rewards

* script to simulate emissions

* clean up constants and switch python script to rust test

* log if we hit max supply somehow
* exponentially decaying token rewards

* script to simulate emissions

* clean up constants and switch python script to rust test

* log if we hit max supply somehow
@illuzen
Copy link
Contributor Author

illuzen commented Dec 22, 2025

ah looks like we got the decaying rewards in here too...maybe it's ok?

traits::{AccountIdConversion, Saturating},
};

const UNIT: u128 = 1_000_000_000_000u128;
Copy link
Contributor

Choose a reason for hiding this comment

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

we can pass this from the runtime as part of the Config as a constant. otherwise, duplicate definition

Comment on lines +140 to +157
// Log readable amounts (convert to tokens by dividing by 1e12)
if let (Ok(total), Ok(treasury), Ok(miner_amt), Ok(current), Ok(fees)) = (
TryInto::<u128>::try_into(total_reward),
TryInto::<u128>::try_into(treasury_reward),
TryInto::<u128>::try_into(miner_reward),
TryInto::<u128>::try_into(current_supply),
TryInto::<u128>::try_into(tx_fees),
) {
let remaining: u128 =
TryInto::<u128>::try_into(max_supply.saturating_sub(current_supply))
.unwrap_or(0);
log::debug!(target: "mining-rewards", "💰 Total reward: {:.6}", total as f64 / UNIT as f64);
log::debug!(target: "mining-rewards", "💰 Treasury reward: {:.6}", treasury as f64 / UNIT as f64);
log::debug!(target: "mining-rewards", "💰 Miner reward: {:.6}", miner_amt as f64 / UNIT as f64);
log::debug!(target: "mining-rewards", "💰 Current supply: {:.2}", current as f64 / UNIT as f64);
log::debug!(target: "mining-rewards", "💰 Remaining supply: {:.2}", remaining as f64 / UNIT as f64);
log::debug!(target: "mining-rewards", "💰 Transaction fees: {:.6}", fees as f64 / UNIT as f64);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to not have these lines? or at least have it as a single debug print call? it adds almost 20 lines of code just to print a debug log

Comment on lines +131 to +132
let treasury_reward =
total_reward.saturating_mul(treasury_portion.into()) / 100u32.into();
Copy link
Contributor

Choose a reason for hiding this comment

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

if we use Permill or Perbill we wouldn't need to have this division here

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.

3 participants