Skip to content

Commit bc6c83f

Browse files
committed
fix: adust gas fee bigger for distributing
1 parent 4cc7b82 commit bc6c83f

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

cmd/dispatcher/handler.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ func handleRequest(w http.ResponseWriter, r *http.Request, cfg *config.Dispatche
113113
if interval <= 0 {
114114
interval = 10 // Default to distributing ten epochs
115115
}
116-
117-
go DistributeRewardsWithRetry(currentEpoch - uint64(interval), cfg, 3)
116+
if currentEpoch%uint64(interval) == 0 {
117+
for i := 1; i <= interval; i++ {
118+
time.Sleep(1 * time.Second)
119+
// Distribute rewards for the current epoch
120+
go DistributeRewardsWithRetry(currentEpoch-uint64(i), cfg, 3)
121+
}
122+
}
118123
}
119124
}
120125

cmd/dispatcher/report_eth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ func DistributeRewards(epochNum uint64, cfg *config.DispatcherConfig) error {
200200
return fmt.Errorf("failed to suggest gas price: %v", err)
201201
}
202202
auth.GasPrice = gasPrice
203-
auth.GasLimit = 5000000 // Set a higher gas limit for distribution
204-
203+
auth.GasLimit = 90000000 // Set a higher gas limit for distribution
204+
205205
// Log the distribution
206206
logger.Info("Distributing rewards for epoch %d", epochNum)
207207

docs/config/dis_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"ChainID": "hetu_560002-1",
1313
"EthRpcURL": "http://localhost:8545",
1414
"EthChainID": 560002,
15-
"ValidatorStakingAddress": "0x59FF9362DE95fcd19983677BcCB2f23062d2E14E",
15+
"ValidatorStakingAddress": "0xE7F6C60D813a17e2FA16869371351d8C800c7fC1",
1616
"RewardDistrInterval": 5
1717
}

docs/config/val_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"ListenAddr": "localhost",
99
"port": 0,
1010
"ChainRpcURL": "http://localhost:8545",
11-
"StakingTokenAddress": "0x98a4e8735E0F99a758a7Cd86b74BB7FA32EF9670",
12-
"ValidatorStakingAddress": "0x59FF9362DE95fcd19983677BcCB2f23062d2E14E",
11+
"StakingTokenAddress": "0x9E96fc769eFb3D2f681D4D4157aac04e97DC9953",
12+
"ValidatorStakingAddress": "0xE7F6C60D813a17e2FA16869371351d8C800c7fC1",
1313
"DispatcherURL": "http://localhost:8080",
1414
"ChainGRpcURL": "localhost:9090",
1515
"CometBFTSvr": "localhost:26657",

0 commit comments

Comments
 (0)