Skip to content

Commit

Permalink
CLN: Final cleaning after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Dec 19, 2024
1 parent 87500e4 commit ea06b70
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cmd/node/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@
[EpochStartConfig]
GenesisEpoch = 0
MinRoundsBetweenEpochs = 20
RoundsPerEpoch = 30
RoundsPerEpoch = 200
# Min and Max ShuffledOutRestartThreshold represents the minimum and maximum duration of an epoch (in percentage) after a node which
# has been shuffled out has to restart its process in order to start in a new shard
MinShuffledOutRestartThreshold = 0.05
Expand Down
3 changes: 1 addition & 2 deletions process/block/sovereignChainBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ var rootHash = "uncomputed root hash"
type extendedShardHeaderTrackHandler interface {
ComputeLongestExtendedShardChainFromLastNotarized() ([]data.HeaderHandler, [][]byte, error)
IsGenesisLastCrossNotarizedHeader() bool
DeleteMainChainHeader(nonce uint64)
}

type extendedShardHeaderRequestHandler interface {
Expand Down Expand Up @@ -681,7 +680,6 @@ func (scbp *sovereignChainBlockProcessor) requestIncomingTxsIfNeeded(extendedSha
func (scbp *sovereignChainBlockProcessor) requestExtendedShardHeaders(sovereignChainHeader data.SovereignChainHeaderHandler) uint32 {
_ = core.EmptyChannel(scbp.chRcvAllExtendedShardHdrs)

// todo: extra validity check: that there are no extended shard headers added to the epoch start block, only GetLastFinalizedCrossChainHeaderHandler
if len(sovereignChainHeader.GetExtendedShardHeaderHashes()) == 0 {
return scbp.computeAndRequestEpochStartExtendedHeaderIfMissing(sovereignChainHeader)
}
Expand Down Expand Up @@ -920,6 +918,7 @@ func (scbp *sovereignChainBlockProcessor) checkExtendedShardHeadersValidity(sove
return nil
}

// we should not have an epoch start block with main chain headers to be processed
if sovereignChainHeader.IsStartOfEpochBlock() {
return errors.ErrReceivedSovereignEpochStartBlockWithExtendedHeaders
}
Expand Down
14 changes: 0 additions & 14 deletions process/track/baseBlockTrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,20 +325,6 @@ func (bbt *baseBlockTrack) cleanupTrackedHeadersBehindNonce(shardID uint32, nonc
}
}

func (bbt *baseBlockTrack) DeleteMainChainHeader(nonce uint64) {
bbt.mutHeaders.Lock()
defer bbt.mutHeaders.Unlock()

headersForMainShard, ok := bbt.headers[core.MainChainShardId]
if !ok {
log.Error("DeleteMainChainHeader NOT FOUND")
return
}

log.Error("DeleteMainChainHeader SUCCESS")
delete(headersForMainShard, nonce)
}

// ComputeLongestChain returns the longest valid chain for a given shard from a given header
func (bbt *baseBlockTrack) ComputeLongestChain(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte) {
return bbt.blockProcessor.ComputeLongestChain(shardID, header)
Expand Down

0 comments on commit ea06b70

Please sign in to comment.