Add Sync stats, and report them in DebugAPI

This commit is contained in:
Eduard S
2020-11-11 18:15:25 +01:00
parent 7294d766cd
commit 6c0d48f4a2
11 changed files with 244 additions and 24 deletions

View File

@@ -43,3 +43,12 @@ type AuctionVariables struct {
// Number of blocks at the end of a slot in which any coordinator can forge if the winner has not forged one before
SlotDeadline uint8 `json:"slotDeadline" meddler:"slot_deadline" validate:"required"`
}
// Copy returns a deep copy of the Variables
func (v *AuctionVariables) Copy() *AuctionVariables {
vCpy := *v
for i := range v.DefaultSlotSetBid {
vCpy.DefaultSlotSetBid[i] = new(big.Int).SetBytes(v.DefaultSlotSetBid[i].Bytes())
}
return &vCpy
}

View File

@@ -163,3 +163,9 @@ type RollupVariables struct {
WithdrawalDelay uint64 `json:"withdrawalDelay" meddler:"withdrawal_delay" validate:"required"`
Buckets [RollupConstNumBuckets]Bucket `json:"buckets" meddler:"buckets,json"`
}
// Copy returns a deep copy of the Variables
func (v *RollupVariables) Copy() *RollupVariables {
vCpy := *v
return &vCpy
}

View File

@@ -23,3 +23,9 @@ type WDelayerVariables struct {
EmergencyModeStartingTime uint64 `json:"emergencyModeStartingTime" meddler:"emergency_start_time"`
EmergencyMode bool `json:"emergencyMode" meddler:"emergency_mode"`
}
// Copy returns a deep copy of the Variables
func (v *WDelayerVariables) Copy() *WDelayerVariables {
vCpy := *v
return &vCpy
}