aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-17 13:18:34 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:18 +0800
commite5ebb174d61a6f7b0b9c6023b15c33a246b2c14f (patch)
treebde9aad9a676129fdb92732ea7a9d92bdfeb7e8b /dex
parent10697136e876446a2807d9fd4799a0a5b9605e30 (diff)
downloadgo-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar.gz
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar.bz2
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar.lz
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar.xz
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.tar.zst
go-tangerine-e5ebb174d61a6f7b0b9c6023b15c33a246b2c14f.zip
core: more fix on light node synchronization (#32)
Fix gas calculation in governance contract. Correctly register round height when processing pending blocks. We should register the mapping when we get the pending block instead of waiting for block confirmation.
Diffstat (limited to 'dex')
-rw-r--r--dex/config.go4
-rw-r--r--dex/governance.go11
2 files changed, 7 insertions, 8 deletions
diff --git a/dex/config.go b/dex/config.go
index 282de494f..b90a344c8 100644
--- a/dex/config.go
+++ b/dex/config.go
@@ -48,8 +48,8 @@ var DefaultConfig = Config{
},
BlockProposerEnabled: false,
DefaultGasPrice: big.NewInt(params.GWei),
- GasFloor: 8000000,
- GasCeil: 8000000,
+ GasFloor: 80000000,
+ GasCeil: 80000000,
GasLimitTolerance: 1000000,
}
diff --git a/dex/governance.go b/dex/governance.go
index 0251d2afd..f555b3508 100644
--- a/dex/governance.go
+++ b/dex/governance.go
@@ -79,6 +79,7 @@ func (d *DexconGovernance) getGovStateAtRound(round uint64) *vm.GovernanceStateH
state, _, err := d.b.StateAndHeaderByNumber(ctx, rpc.BlockNumber(blockHeight))
if state == nil || err != nil {
+ log.Error("Failed to retrieve governance state", "round", round, "height", blockHeight)
return nil
}
return &vm.GovernanceStateHelper{state}
@@ -119,17 +120,15 @@ func (d *DexconGovernance) sendGovTx(ctx context.Context, data []byte) error {
return err
}
- log.Info("sendGovTx", "nonce", nonce)
-
- // Increase gasPrice to 5 times of suggested gas price to make sure it will
+ // Increase gasPrice to 10 times of suggested gas price to make sure it will
// be included in time.
- gasPrice = new(big.Int).Mul(gasPrice, big.NewInt(5))
+ gasPrice = new(big.Int).Mul(gasPrice, big.NewInt(10))
tx := types.NewTransaction(
nonce,
vm.GovernanceContractAddress,
big.NewInt(0),
- uint64(2000000),
+ uint64(10000000),
gasPrice,
data)
@@ -140,7 +139,7 @@ func (d *DexconGovernance) sendGovTx(ctx context.Context, data []byte) error {
return err
}
- log.Info("Send governance transaction", "fullhash", tx.Hash().Hex())
+ log.Info("Send governance transaction", "fullhash", tx.Hash().Hex(), "nonce", nonce)
return d.b.SendTx(ctx, tx)
}