mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-02-25 21:01:44 +00:00
Compare commits
4 Commits
update-has
...
mainnet-dn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a388112e86 | ||
|
|
0a1daae319 | ||
|
|
49285d64f2 | ||
|
|
131cd3357e |
@@ -28,7 +28,7 @@ func (s *server) CreateUnsignedTransaction(_ context.Context, request *pb.Create
|
||||
}
|
||||
|
||||
// TODO: Implement a better fee estimation mechanism
|
||||
const feePerInput = 1000
|
||||
const feePerInput = 10000
|
||||
selectedUTXOs, changeSompi, err := s.selectUTXOs(request.Amount, feePerInput)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -206,7 +206,7 @@ func (f *factory) NewConsensus(config *Config, db infrastructuredatabase.Databas
|
||||
config.CoinbasePayloadScriptPublicKeyMaxLength,
|
||||
config.GenesisHash,
|
||||
config.FixedSubsidySwitchPruningPointInterval,
|
||||
config.FixedSubsidySwitchHashRateDifference,
|
||||
config.FixedSubsidySwitchHashRateThreshold,
|
||||
dagTraversalManager,
|
||||
ghostdagDataStore,
|
||||
acceptanceDataStore,
|
||||
|
||||
@@ -49,7 +49,7 @@ func (c *coinbaseManager) isBlockRewardFixed(stagingArea *model.StagingArea, blo
|
||||
blueWorkDifference := new(big.Int).Sub(highPruningPointHeader.BlueWork(), lowPruningPointHeader.BlueWork())
|
||||
blueScoreDifference := new(big.Int).SetUint64(highPruningPointHeader.BlueScore() - lowPruningPointHeader.BlueScore())
|
||||
estimatedAverageHashRate := new(big.Int).Div(blueWorkDifference, blueScoreDifference)
|
||||
if estimatedAverageHashRate.Cmp(c.fixedSubsidySwitchHashRateDifference) >= 0 {
|
||||
if estimatedAverageHashRate.Cmp(c.fixedSubsidySwitchHashRateThreshold) >= 0 {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestBlockRewardSwitch(t *testing.T) {
|
||||
// Set the hash rate difference such that the switch would trigger exactly
|
||||
// on the `FixedSubsidySwitchPruningPointInterval + 1`th pruning point
|
||||
workToAcceptGenesis := difficulty.CalcWork(consensusConfig.GenesisBlock.Header.Bits())
|
||||
consensusConfig.FixedSubsidySwitchHashRateDifference = workToAcceptGenesis
|
||||
consensusConfig.FixedSubsidySwitchHashRateThreshold = workToAcceptGenesis
|
||||
|
||||
// Set the min, max, and post-switch subsidies to values that would make it
|
||||
// easy to tell whether the switch happened
|
||||
|
||||
@@ -22,7 +22,7 @@ type coinbaseManager struct {
|
||||
coinbasePayloadScriptPublicKeyMaxLength uint8
|
||||
genesisHash *externalapi.DomainHash
|
||||
fixedSubsidySwitchPruningPointInterval uint64
|
||||
fixedSubsidySwitchHashRateDifference *big.Int
|
||||
fixedSubsidySwitchHashRateThreshold *big.Int
|
||||
|
||||
databaseContext model.DBReader
|
||||
dagTraversalManager model.DAGTraversalManager
|
||||
@@ -364,7 +364,7 @@ func New(
|
||||
coinbasePayloadScriptPublicKeyMaxLength uint8,
|
||||
genesisHash *externalapi.DomainHash,
|
||||
fixedSubsidySwitchPruningPointInterval uint64,
|
||||
fixedSubsidySwitchHashRateDifference *big.Int,
|
||||
fixedSubsidySwitchHashRateThreshold *big.Int,
|
||||
|
||||
dagTraversalManager model.DAGTraversalManager,
|
||||
ghostdagDataStore model.GHOSTDAGDataStore,
|
||||
@@ -385,7 +385,7 @@ func New(
|
||||
coinbasePayloadScriptPublicKeyMaxLength: coinbasePayloadScriptPublicKeyMaxLength,
|
||||
genesisHash: genesisHash,
|
||||
fixedSubsidySwitchPruningPointInterval: fixedSubsidySwitchPruningPointInterval,
|
||||
fixedSubsidySwitchHashRateDifference: fixedSubsidySwitchHashRateDifference,
|
||||
fixedSubsidySwitchHashRateThreshold: fixedSubsidySwitchHashRateThreshold,
|
||||
|
||||
dagTraversalManager: dagTraversalManager,
|
||||
ghostdagDataStore: ghostdagDataStore,
|
||||
|
||||
@@ -185,7 +185,7 @@ type Params struct {
|
||||
|
||||
FixedSubsidySwitchPruningPointInterval uint64
|
||||
|
||||
FixedSubsidySwitchHashRateDifference *big.Int
|
||||
FixedSubsidySwitchHashRateThreshold *big.Int
|
||||
}
|
||||
|
||||
// NormalizeRPCServerAddress returns addr with the current network default
|
||||
@@ -211,6 +211,7 @@ var MainnetParams = Params{
|
||||
Net: appmessage.Mainnet,
|
||||
RPCPort: "16110",
|
||||
DefaultPort: "16111",
|
||||
DNSSeeds: []string{"mainnet-dnsseed.daglabs-dev.com"},
|
||||
|
||||
// DAG parameters
|
||||
GenesisBlock: &genesisBlock,
|
||||
@@ -262,7 +263,7 @@ var MainnetParams = Params{
|
||||
CoinbasePayloadScriptPublicKeyMaxLength: defaultCoinbasePayloadScriptPublicKeyMaxLength,
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateDifference: big.NewInt(1_000_000),
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
}
|
||||
|
||||
// TestnetParams defines the network parameters for the test Kaspa network.
|
||||
@@ -324,7 +325,7 @@ var TestnetParams = Params{
|
||||
CoinbasePayloadScriptPublicKeyMaxLength: defaultCoinbasePayloadScriptPublicKeyMaxLength,
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateDifference: big.NewInt(1_000_000),
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
}
|
||||
|
||||
// SimnetParams defines the network parameters for the simulation test Kaspa
|
||||
@@ -390,7 +391,7 @@ var SimnetParams = Params{
|
||||
CoinbasePayloadScriptPublicKeyMaxLength: defaultCoinbasePayloadScriptPublicKeyMaxLength,
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateDifference: big.NewInt(1_000_000),
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
}
|
||||
|
||||
// DevnetParams defines the network parameters for the development Kaspa network.
|
||||
@@ -452,7 +453,7 @@ var DevnetParams = Params{
|
||||
CoinbasePayloadScriptPublicKeyMaxLength: defaultCoinbasePayloadScriptPublicKeyMaxLength,
|
||||
PruningProofM: defaultPruningProofM,
|
||||
FixedSubsidySwitchPruningPointInterval: defaultFixedSubsidySwitchPruningPointInterval,
|
||||
FixedSubsidySwitchHashRateDifference: big.NewInt(1_000_000),
|
||||
FixedSubsidySwitchHashRateThreshold: big.NewInt(150_000_000_000),
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -81,10 +81,6 @@ func (networkFlags *NetworkFlags) ResolveNetwork(parser *flags.Parser) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if numNets == 0 {
|
||||
return errors.Errorf("Mainnet has not launched yet, use --testnet to run in testnet mode")
|
||||
}
|
||||
|
||||
err := networkFlags.overrideDAGParams()
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user