@ -15,6 +15,8 @@ const (
PangaeaHTTPPattern = "http://s%d.pga.hmny.io:9500"
// PangaeaWSPattern is the websocket pattern for pangaea.
PangaeaWSPattern = "ws://s%d.pga.hmny.io:9800"
// transaction throttling disabled on pangaea network
pangaeaEnableTxnThrottling = false
)
// PangaeaSchedule is the Pangaea sharding configuration schedule.
@ -22,12 +24,12 @@ var PangaeaSchedule pangaeaSchedule
type pangaeaSchedule struct { }
func ( pangaeaSchedule ) InstanceForEpoch ( epoch * big . Int ) Instance {
func ( ps p angaeaSchedule ) InstanceForEpoch ( epoch * big . Int ) Instance {
return pangaeaV0
}
func ( pangaeaSchedule ) BlocksPerEpoch ( ) uint64 {
return 10800 // 1 day with 8 seconds/block
func ( ps p angaeaSchedule ) BlocksPerEpoch ( ) uint64 {
return 2700 // 6 hours with 8 seconds/block
}
func ( ps pangaeaSchedule ) CalcEpochNumber ( blockNum uint64 ) * big . Int {
@ -43,11 +45,11 @@ func (ps pangaeaSchedule) EpochLastBlock(epochNum uint64) uint64 {
return blocks * ( epochNum + 1 ) - 1
}
func ( pangaeaSchedule ) VdfDifficulty ( ) int {
func ( ps p angaeaSchedule ) VdfDifficulty ( ) int {
return testnetVdfDifficulty
}
func ( pangaeaSchedule ) ConsensusRatio ( ) float64 {
func ( ps p angaeaSchedule ) ConsensusRatio ( ) float64 {
return mainnetConsensusRatio
}
@ -58,32 +60,36 @@ var pangaeaV0 = MustNewInstance(
// TODO: remove it after randomness feature turned on mainnet
//RandonnessStartingEpoch returns starting epoch of randonness generation
func ( pangaeaSchedule ) RandomnessStartingEpoch ( ) uint64 {
func ( ps p angaeaSchedule ) RandomnessStartingEpoch ( ) uint64 {
return mainnetRandomnessStartingEpoch
}
func ( pangaeaSchedule ) MaxTxAmountLimit ( ) * big . Int {
func ( ps p angaeaSchedule ) MaxTxAmountLimit ( ) * big . Int {
amountBigInt := big . NewInt ( mainnetMaxTxAmountLimit )
amountBigInt = amountBigInt . Mul ( amountBigInt , big . NewInt ( denominations . One ) )
return amountBigInt
}
func ( pangaeaSchedule ) MaxNumRecentTxsPerAccountLimit ( ) uint64 {
func ( ps p angaeaSchedule ) MaxNumRecentTxsPerAccountLimit ( ) uint64 {
return mainnetMaxNumRecentTxsPerAccountLimit
}
func ( pangaeaSchedule ) MaxTxPoolSizeLimit ( ) int {
func ( ps p angaeaSchedule ) MaxTxPoolSizeLimit ( ) int {
return mainnetMaxTxPoolSizeLimit
}
func ( pangaeaSchedule ) MaxNumTxsPerBlockLimit ( ) int {
func ( ps p angaeaSchedule ) MaxNumTxsPerBlockLimit ( ) int {
return mainnetMaxNumTxsPerBlockLimit
}
func ( pangaeaSchedule ) RecentTxDuration ( ) time . Duration {
func ( ps p angaeaSchedule ) RecentTxDuration ( ) time . Duration {
return mainnetRecentTxDuration
}
func ( ps pangaeaSchedule ) EnableTxnThrottling ( ) bool {
return pangaeaEnableTxnThrottling
}
func ( ps pangaeaSchedule ) TxsThrottleConfig ( ) * TxsThrottleConfig {
return & TxsThrottleConfig {
MaxTxAmountLimit : ps . MaxTxAmountLimit ( ) ,
@ -91,6 +97,7 @@ func (ps pangaeaSchedule) TxsThrottleConfig() *TxsThrottleConfig {
MaxTxPoolSizeLimit : ps . MaxTxPoolSizeLimit ( ) ,
MaxNumTxsPerBlockLimit : ps . MaxNumTxsPerBlockLimit ( ) ,
RecentTxDuration : ps . RecentTxDuration ( ) ,
EnableTxnThrottling : ps . EnableTxnThrottling ( ) ,
}
}