aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-10-31 14:00:13 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit3d61c2bd98c4f22c05585ed5448eb02b87e38869 (patch)
tree2e307739fb67d92a851e4fba212222385479dbcb /dex
parent53af3aa918f2d870b834952d14cf14efc365aca2 (diff)
downloaddexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar.gz
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar.bz2
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar.lz
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar.xz
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.tar.zst
dexon-3d61c2bd98c4f22c05585ed5448eb02b87e38869.zip
dex: add block gas limit into governance
Diffstat (limited to 'dex')
-rw-r--r--dex/app.go9
-rw-r--r--dex/governance.go6
2 files changed, 4 insertions, 11 deletions
diff --git a/dex/app.go b/dex/app.go
index a226aaa0c..b325f44d0 100644
--- a/dex/app.go
+++ b/dex/app.go
@@ -411,11 +411,10 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F
}
newBlock := types.NewBlock(&types.Header{
- Number: new(big.Int).SetUint64(result.Height),
- Time: big.NewInt(result.Timestamp.Unix()),
- Coinbase: common.BytesToAddress(block.ProposerID.Bytes()),
- // TODO(bojie): fix it
- GasLimit: 8000000,
+ Number: new(big.Int).SetUint64(result.Height),
+ Time: big.NewInt(result.Timestamp.Unix()),
+ Coinbase: common.BytesToAddress(block.ProposerID.Bytes()),
+ GasLimit: d.gov.DexconConfiguration(block.Position.Round).BlockGasLimit,
Difficulty: big.NewInt(1),
Round: block.Position.Round,
DexconMeta: dexconMeta,
diff --git a/dex/governance.go b/dex/governance.go
index 69c1e217f..bbb34ca50 100644
--- a/dex/governance.go
+++ b/dex/governance.go
@@ -87,12 +87,6 @@ func (d *DexconGovernance) DexconConfiguration(round uint64) *params.DexconConfi
// Configuration returns the system configuration for consensus core to use.
func (d *DexconGovernance) Configuration(round uint64) *coreTypes.Config {
- // Configuration in round r is activiated on round r + 2.
- if round < 2 {
- round = 0
- } else {
- round -= 2
- }
s := d.getGovStateAtRound(round)
c := s.Configuration()