Skip to content

Commit

Permalink
Added mutex lock in blockNumber calculation (#1035)
Browse files Browse the repository at this point in the history
* Merge `v1.0.4` release to main branch  (#977)

* v1.2.0 (#965)

* Hotfix-logImprovements (#952)

* Set up blocknumber and epoch in logs

* updated blocknumber and epoch logger info in every command

* Hotfix-getDataFromAPI (#951)

* Changed numm of retry attempts

* removed redundant retry attempts

* corrected tests

* changed http timeout and logged time elapsed to fetch data (#954)

* Updated version (#960)

* Updated version

* updated version to v1.2.0

* version update (#972)

* Updated user in dockerfile (#1012)

* updating user in dockerfile

* updating readme for non-root user

* Revert "Updated user in dockerfile (#1012)" (#1021)

This reverts commit 7f95edb.

* Added mutex lock in blockNumber calculation

* Added new staging addresses and chainId

* updated version

Co-authored-by: Shrikant upadhyay <[email protected]>
  • Loading branch information
Yashk767 and Shrikant1212 authored Dec 6, 2022
1 parent dba7607 commit f33fb42
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 24 deletions.
20 changes: 10 additions & 10 deletions addresses.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"Governance": "0xAc40E8dA38B5a381008059a38bb9bf45f0D3C4e2",
"BlockManager": "0x11aB70d78f1Dd2c3F967180d8A64858Db03A0aBa",
"CollectionManager": "0x367962d1462C568A0dDd0e2448311469451bF5a3",
"StakeManager": "0xe0bC695203d9C9f379bcdE9260B9F71B64B85298",
"RewardManager": "0x301779E4c95f951D2E17B4c3EdDC717551df2EBb",
"VoteManager": "0x641BAD0641eB5B94B19568C0a22a55AEbDAF1870",
"Delegator": "0xC74745eA5a3fac1864FAcd8f48d72C21A4ab883D",
"RAZOR": "0xcbf70914Fae03B3acB91E953De60CfDAaCA8145f",
"StakedTokenFactory": "0xEffA78888Dc1b6033286E5dF9b170bc5223178AB",
"RandomNoManager": "0xC6eF45F5Add040800D30FE6dEe01b4EBC4BfC467"
"Governance": "0xFEb70E7Ad36b425b698184B3d5b1F856c8132a42",
"BlockManager": "0xa26232204879C4370806cA56F821b9fe97eAeF5B",
"CollectionManager": "0xbF5c5AD799b2245BA36562BebfcbAbc5D508Eb84",
"StakeManager": "0x03bD73afB6d3C5B86578010C099E5474aF1aABeF",
"RewardManager": "0xe4371caE0ab6Fb4875BB1002c0230CB0a1423616",
"VoteManager": "0x53Df936a3594777185DF12Cd073d9033cfF348D6",
"Delegator": "0x7f80398840D1bE49dD99609Abe405034bF97E97a",
"RAZOR": "0x328BAc5C2be4961252041EC589A22e55Ec132010",
"StakedTokenFactory": "0x36b309a9D1404a7B2Ae3429742F2967EF861606E",
"RandomNoManager": "0xC2d1F555168021d107bDB85380890281b3947493"
}
6 changes: 6 additions & 0 deletions block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/sirupsen/logrus"
"razor/core"
"sync"
"time"
)

var latestBlock *types.Header
var mu = sync.Mutex{}

func GetLatestBlock() *types.Header {
mu.Lock()
defer mu.Unlock()
return latestBlock
}

func SetLatestBlock(block *types.Header) {
mu.Lock()
latestBlock = block
mu.Unlock()
}

func CalculateLatestBlock(client *ethclient.Client) {
Expand Down
2 changes: 1 addition & 1 deletion core/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

var EpochLength int64 = 1200
var NumberOfStates int64 = 5
var ChainId = big.NewInt(0x109B4597)
var ChainId = big.NewInt(0x5a79c44e)
var StateLength = uint64(EpochLength / NumberOfStates)
var MaxRetries uint = 8
var NilHash = common.Hash{0x00}
Expand Down
10 changes: 5 additions & 5 deletions core/contracts.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package core

var StakeManagerAddress = "0xe0bC695203d9C9f379bcdE9260B9F71B64B85298"
var RAZORAddress = "0xcbf70914Fae03B3acB91E953De60CfDAaCA8145f"
var CollectionManagerAddress = "0x367962d1462C568A0dDd0e2448311469451bF5a3"
var VoteManagerAddress = "0x641BAD0641eB5B94B19568C0a22a55AEbDAF1870"
var BlockManagerAddress = "0x11aB70d78f1Dd2c3F967180d8A64858Db03A0aBa"
var StakeManagerAddress = "0x03bD73afB6d3C5B86578010C099E5474aF1aABeF"
var RAZORAddress = "0x328BAc5C2be4961252041EC589A22e55Ec132010"
var CollectionManagerAddress = "0xbF5c5AD799b2245BA36562BebfcbAbc5D508Eb84"
var VoteManagerAddress = "0x53Df936a3594777185DF12Cd073d9033cfF348D6"
var BlockManagerAddress = "0xa26232204879C4370806cA56F821b9fe97eAeF5B"
8 changes: 4 additions & 4 deletions core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package core
import "fmt"

const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionMeta = "beta" // Version metadata to append to the version string
VersionMajor = 1 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionMeta = "alpha-patch3" // Version metadata to append to the version string
)

// Version holds the textual version string.
Expand Down
9 changes: 5 additions & 4 deletions logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ package logger
import (
"errors"
"fmt"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/razor-network/goInfo"
"github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2"
"io"
"math/big"
"os"
"razor/block"
"razor/core"
"razor/path"
"runtime"

"github.com/ethereum/go-ethereum/ethclient"
"github.com/razor-network/goInfo"
"github.com/sirupsen/logrus"
"gopkg.in/natefinch/lumberjack.v2"
)

type StandardLogger struct {
Expand Down

0 comments on commit f33fb42

Please sign in to comment.