Skip to content

Commit

Permalink
Update diff mechanism (#358)
Browse files Browse the repository at this point in the history
* update DifficultyBoundDivisor and devin energy limit & tests

* update DifficultyBoundDivisor and devin energy limit & tests

* fix GA

* version 46

* tests
  • Loading branch information
error2215 authored Feb 13, 2022
1 parent 751bd80 commit 6223b51
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
docker login docker.pkg.github.com -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
docker build . -t docker.pkg.github.com/core-coin/go-core/gocore:${{steps.vars.outputs.tag}} -t docker.pkg.github.com/core-coin/go-core/gocore:latest
docker push --all-tags
docker image push --all-tags docker.pkg.github.com/core-coin/go-core/gocore
debian:
name: debian
if: false && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
Expand Down
4 changes: 2 additions & 2 deletions cmd/gocore/consolecmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestConsoleWelcome(t *testing.T) {
gocore.SetTemplateFunc("gover", runtime.Version)
gocore.SetTemplateFunc("gocorever", func() string { return params.VersionWithCommit("", "") })
gocore.SetTemplateFunc("niltime", func() string {
return time.Unix(1599475790, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
return time.Unix(1644745792, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
})
gocore.SetTemplateFunc("apis", func() string { return ipcAPIs })

Expand Down Expand Up @@ -146,7 +146,7 @@ func testAttachWelcome(t *testing.T, gocore *testgocore, endpoint, apis string)
attach.SetTemplateFunc("gocorever", func() string { return params.VersionWithCommit("", "") })
attach.SetTemplateFunc("corebase", func() string { return gocore.Corebase })
attach.SetTemplateFunc("niltime", func() string {
return time.Unix(1599475790, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
return time.Unix(1644745792, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
})
attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") })
attach.SetTemplateFunc("datadir", func() string { return gocore.Datadir })
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func TestReorgLongHeaders(t *testing.T) { testReorgLong(t, false) }
func TestReorgLongBlocks(t *testing.T) { testReorgLong(t, true) }

func testReorgLong(t *testing.T, full bool) {
testReorg(t, []int64{0, 0, -9}, []int64{0, 0, 0, -9}, 24584, full)
testReorg(t, []int64{0, 0, -9}, []int64{0, 0, 0, -9}, 24580, full)
}

// Tests that reorganising a short difficult chain after a long easy one
Expand Down
4 changes: 2 additions & 2 deletions core/forkid/forkid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ func TestCreation(t *testing.T) {
params.MainnetChainConfig,
params.MainnetGenesisHash,
[]testcase{
{0, ID{Hash: checksumToBytes(0xbf76c5f1), Next: 0}},
{0, ID{Hash: checksumToBytes(0xd959dc39), Next: 0}},
},
},
// Devin test cases
{
params.DevinChainConfig,
params.DevinGenesisHash,
[]testcase{
{10, ID{Hash: checksumToBytes(0x5a2baa1c), Next: 0}},
{10, ID{Hash: checksumToBytes(0x546c4cf5), Next: 0}},
},
},
// Koliba test cases
Expand Down
8 changes: 4 additions & 4 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ func DefaultGenesisBlock() *Genesis {
return &Genesis{
Coinbase: DefaultCoinbaseMainnet,
Config: params.MainnetChainConfig,
Timestamp: 1599475790,
Timestamp: 1644745792,
Nonce: 66,
Difficulty: big.NewInt(1),
EnergyLimit: 12500000,
Difficulty: big.NewInt(8192),
EnergyLimit: 14700000,
}
}

Expand All @@ -357,7 +357,7 @@ func DefaultDevinGenesisBlock() *Genesis {
Config: params.DevinChainConfig,
Timestamp: 1635955256,
Nonce: 0x000000000002,
EnergyLimit: 12500000,
EnergyLimit: 14700000,
}
}

Expand Down
4 changes: 2 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (

// Genesis hashes to enforce below configs on.
var (
MainnetGenesisHash = common.HexToHash("0x6894bcf15a005884af1253227df1057885f2ccff132eff7665f9761b7e3ea98a")
DevinGenesisHash = common.HexToHash("0x21611412ade2545d2d37d318db038c04485a0b590c48e0ccb6e7c4f83136def7")
MainnetGenesisHash = common.HexToHash("0x15ecef048cdcf32af32ed5d7ff94cc8316e177b8a442055e89f57d3306c57e24")
DevinGenesisHash = common.HexToHash("0x519cbc309c9cf7472b120da57063da9286f5b897ad34de7046bb7030c4ed98f0")
KolibaGenesisHash = common.HexToHash("0x4d22056fa4d6321bf031c046f040a370128b10a557f620c2d169c6655e6ba30c")
)

Expand Down
4 changes: 2 additions & 2 deletions params/protocol_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const (
)

var (
DifficultyBoundDivisor = big.NewInt(1024) // The bound divisor of the difficulty, used in the update calculations.
DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations.
GenesisDifficulty = big.NewInt(8192) // Difficulty of the Genesis block.
MinimumDifficulty = big.NewInt(8192) // The minimum that the difficulty may ever be.
DurationLimit = big.NewInt(6) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
DurationLimit = big.NewInt(6) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
)
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionPatch = 45 // Patch version component of the current release
VersionPatch = 46 // Patch version component of the current release
VersionMeta = "stable" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 6223b51

Please sign in to comment.