This commit is contained in:
jagdeep sidhu 2024-10-08 11:41:04 -07:00
parent f11bec9e55
commit 819aaf5b70
4 changed files with 6 additions and 28 deletions

View file

@ -41,7 +41,7 @@ var (
beaconDifficulty = common.Big0 // The default block difficulty in the beacon consensus beaconDifficulty = common.Big0 // The default block difficulty in the beacon consensus
beaconNonce = types.EncodeNonce(0) // The default block nonce in the beacon consensus beaconNonce = types.EncodeNonce(0) // The default block nonce in the beacon consensus
// SYSCOIN // SYSCOIN
SyscoinBlockReward, _ = new(big.Int).SetString("10550000000000000000", 10) // 10.55 Block reward for successfully mining a block upward from Syscoin SyscoinBlockReward = uint256.NewInt(10550000000000000000) // 10.55 Block reward for successfully mining a block upward from Syscoin
allowedFutureBlockTimeSeconds = int64(150) // Max seconds from current time allowed for blocks, before they're considered future blocks allowedFutureBlockTimeSeconds = int64(150) // Max seconds from current time allowed for blocks, before they're considered future blocks
) )
@ -383,7 +383,7 @@ func (beacon *Beacon) Prepare(chain consensus.ChainHeaderReader, header *types.H
// reward. The total reward consists of the static block reward and rewards for // reward. The total reward consists of the static block reward and rewards for
// included uncles. The coinbase of each uncle block is also rewarded. // included uncles. The coinbase of each uncle block is also rewarded.
func accumulateRewards(stateDB *state.StateDB, header *types.Header) { func accumulateRewards(stateDB *state.StateDB, header *types.Header) {
stateDB.AddBalance(header.Coinbase, uint256.MustFromBig(SyscoinBlockReward), tracing.BalanceIncreaseRewardMineBlock) stateDB.AddBalance(header.Coinbase, SyscoinBlockReward, tracing.BalanceIncreaseRewardMineBlock)
} }
// Finalize implements consensus.Engine and processes withdrawals on top. // Finalize implements consensus.Engine and processes withdrawals on top.

View file

@ -377,9 +377,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
// ensure 5 seconds has passed between blocks before we start peering so we are sure sync has finished // ensure 5 seconds has passed between blocks before we start peering so we are sure sync has finished
if time.Now().Unix()-eth.timeLastBlock >= 5 { if time.Now().Unix()-eth.timeLastBlock >= 5 {
log.Info("Networking and peering start...") log.Info("Networking and peering start...")
eth.handler.Start(eth.handler.maxPeers)
eth.handler.peers.open() eth.handler.peers.open()
eth.Downloader().Peers().Open()
eth.p2pServer.Start() eth.p2pServer.Start()
eth.Downloader().DoneEvent() eth.Downloader().DoneEvent()
eth.handler.synced.Store(true) eth.handler.synced.Store(true)
@ -532,19 +530,15 @@ func (s *Ethereum) Start() error {
// Regularly update shutdown marker // Regularly update shutdown marker
s.shutdownTracker.Start() s.shutdownTracker.Start()
// Start the networking layer
s.handler.Start(s.p2pServer.MaxPeers)
// SYSCOIN // SYSCOIN
if s.blockchain.GetChainConfig().SyscoinBlock != nil { if s.blockchain.GetChainConfig().SyscoinBlock != nil {
log.Info("Skip networking and peering...") log.Info("Skip networking and peering...")
s.handler.maxPeers = s.p2pServer.MaxPeers
s.handler.peers.close() s.handler.peers.close()
s.p2pServer.Stop() s.p2pServer.Stop()
} else {
// Start the networking layer
s.handler.Start(s.p2pServer.MaxPeers)
} }
return nil return nil
} }

View file

@ -233,20 +233,6 @@ func (ps *peerSet) Register(p *peerConnection) error {
return nil return nil
} }
// SYSCOIN
func (ps *peerSet) Close() {
ps.lock.Lock()
defer ps.lock.Unlock()
ps.closed = true
}
func (ps *peerSet) Open() {
ps.lock.Lock()
defer ps.lock.Unlock()
ps.closed = false
}
// Unregister removes a remote peer from the active set, disabling any further // Unregister removes a remote peer from the active set, disabling any further
// actions to/from that particular entity. // actions to/from that particular entity.
func (ps *peerSet) Unregister(id string) error { func (ps *peerSet) Unregister(id string) error {

View file

@ -38,8 +38,6 @@ func newUint64(val uint64) *uint64 { return &val }
var ( var (
MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0) MainnetTerminalTotalDifficulty, _ = new(big.Int).SetString("58_750_000_000_000_000_000_000", 0)
// SYSCOIN
SyscoinTerminalTotalDifficulty, _ = new(big.Int).SetString("0", 0)
// MainnetChainConfig is the chain parameters to run a node on the main network. // MainnetChainConfig is the chain parameters to run a node on the main network.
MainnetChainConfig = &ChainConfig{ MainnetChainConfig = &ChainConfig{
@ -85,11 +83,11 @@ var (
RolluxBlock: big.NewInt(268500), RolluxBlock: big.NewInt(268500),
NexusBlock: big.NewInt(600000), NexusBlock: big.NewInt(600000),
LondonBlock: big.NewInt(1), LondonBlock: big.NewInt(1),
TerminalTotalDifficulty: SyscoinTerminalTotalDifficulty, TerminalTotalDifficulty: big.NewInt(1),
TerminalTotalDifficultyPassed: true, TerminalTotalDifficultyPassed: true,
ShanghaiTime: newUint64(1679618404), ShanghaiTime: newUint64(1679618404),
CancunTime: newUint64(1679618404), CancunTime: newUint64(1679618404),
Ethash: nil, Ethash: nil,
} }
TanenbaumChainConfig = &ChainConfig{ TanenbaumChainConfig = &ChainConfig{
ChainID: big.NewInt(5700), ChainID: big.NewInt(5700),