Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
HardFork at block-6713000 to limit emission of Atlantis.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainDero committed Mar 20, 2022
1 parent 4682128 commit aca1d8f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,11 @@ skip_checks:
// and leave the original TX untouched
total_reward := base_reward + total_fees

if hard_fork_version_current >= 5 {
total_reward = 1 // 1 atomic unit
base_reward = 0 // 0 atomic unit
}

// store total reward
dbtx.StoreUint64(BLOCKCHAIN_UNIVERSE, GALAXY_BLOCK, bl_current_hash[:], PLANET_MINERTX_REWARD, total_reward)

Expand Down
2 changes: 2 additions & 0 deletions blockchain/hardfork_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ var mainnet_hard_forks = []Hard_fork{
{2, 95551, 0, 0, 0, true}, // version 2 hard fork where Atlantis bootstraps , it's mandatory
{3, 721000, 0, 0, 0, true}, // version 3 hard fork emission fix, it's mandatory
{4, 4550555, 0, 0, 0, true}, // version 4 hard fork AstroBWT CPU Mining enabled. It's mandatory
{5, config.HF5_HEIGHT, 0, 0, 0, true}, // version 5 hard fork where we keep the chain alive, so who could not swap earlier can swap later
}

// current testnet_hard_forks
var testnet_hard_forks = []Hard_fork{
//{1, 0, 0, 0, 0, true}, // version 1 hard fork where genesis block landed
{3, 0, 0, 0, 0, true}, // version 3 hard fork where we started , it's mandatory
{4, 3, 0, 0, 0, true}, // version 4 hard fork where we change mining algorithm it's mandatory
{5, 4, 0, 0, 0, true}, // version 5 hard fork where we keep the chain alive, so who could not swap earlier can swap later
}

// current simulation_hard_forks
Expand Down
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ const MAINNET_MINIMUM_DIFFICULTY = uint64(5* 1000 * BLOCK_TIME_hf4) // 5 KH/s
const TESTNET_BOOTSTRAP_DIFFICULTY = uint64(1600 * BLOCK_TIME_hf4) // testnet bootstrap at 800 H/s
const TESTNET_MINIMUM_DIFFICULTY = uint64(800 * BLOCK_TIME_hf4) // 800 H

const HF5_HEIGHT = 6713000 // hf applies at this height


// this single parameter controls lots of various parameters
// within the consensus, it should never go below 7
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ import "github.com/blang/semver"

// right now it has to be manually changed
// do we need to include git commitsha??
var Version = semver.MustParse("2.2.1-0.Atlantis.Astrobwt+03072020")
var Version = semver.MustParse("2.2.2-13.Atlantis.Astrobwt+11032022")
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/deroproject/derosuite

go 1.17
3 changes: 2 additions & 1 deletion walletapi/wallet_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,8 @@ func (w *Wallet) select_outputs_for_transfer(needed_amount uint64, fees uint64,
continue
}

if inputmaturity.Is_Input_Mature(w.Get_Height(),
// do not select indexes which are past HF and which are dust
if tx.TXdata.Height <= config.HF5_HEIGHT && tx.WAmount > 20 && inputmaturity.Is_Input_Mature(w.Get_Height(),

This comment has been minimized.

Copy link
@Matoran

Matoran Mar 27, 2022

any index past HF can't be selected

This comment has been minimized.

Copy link
@Matoran

Matoran Mar 27, 2022

what you want to do is probably (tx.TXdata.Height < config.HF5_HEIGHT || tx.WAmount > 20) &&

tx.TXdata.Height,
tx.TXdata.Unlock_Height,
tx.TXdata.SigType) && !w.IsKeyImageSpent(tx.WKimage) {
Expand Down

0 comments on commit aca1d8f

Please sign in to comment.