Skip to content

Commit

Permalink
Refactor system contract upgrade. (node-real#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx authored and MakarovSg committed Jul 19, 2024
1 parent 7267989 commit e465cbc
Show file tree
Hide file tree
Showing 6 changed files with 500 additions and 1,274 deletions.
161 changes: 24 additions & 137 deletions core/system_contract_lookup.go

Large diffs are not rendered by default.

1,144 changes: 16 additions & 1,128 deletions core/systemcontracts/upgrade.go

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions erigon-lib/chain/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,11 @@ func (c *CliqueConfig) String() string {
}

type ParliaConfig struct {
DBPath string
InMemory bool
Period uint64 `json:"period"` // Number of seconds between blocks to enforce
Epoch uint64 `json:"epoch"` // Epoch length to update validatorSet
DBPath string
InMemory bool
Period uint64 `json:"period"` // Number of seconds between blocks to enforce
Epoch uint64 `json:"epoch"` // Epoch length to update validatorSet
BlockAlloc map[string]interface{} `json:"blockAlloc"` // For systemContract upgrade
}

// String implements the stringer interface, returning the consensus engine details.
Expand Down
178 changes: 177 additions & 1 deletion params/chainspecs/bsc.json

Large diffs are not rendered by default.

276 changes: 275 additions & 1 deletion params/chainspecs/chapel.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions turbo/stages/headerdownload/header_algos.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (hd *HeaderDownload) InsertHeader(hf FeedHeaderFunc, terminalTotalDifficult
}
for hd.persistedLinkQueue.Len() > hd.persistedLinkLimit {
link := heap.Pop(&hd.persistedLinkQueue).(*Link)
log.Debug("HeaderEvicted", "link.blockHeight", link.blockHeight)
// log.Debug("HeaderEvicted", "link.blockHeight", link.blockHeight)
dataflow.HeaderDownloadStates.AddChange(link.blockHeight, dataflow.HeaderEvicted)
delete(hd.links, link.hash)
link.ClearChildren()
Expand Down Expand Up @@ -1117,8 +1117,8 @@ func (hd *HeaderDownload) ProcessHeader(sh ChainSegmentHeader, newBlock bool, pe
}
anchor.fLink = link
hd.anchors[anchor.parentHash] = anchor
_, success := hd.anchorTree.ReplaceOrInsert(anchor)
log.Debug("AnchorTree add anchor", "anchor.blockHeight", anchor.blockHeight, "success", success)
hd.anchorTree.ReplaceOrInsert(anchor)
// log.Debug("AnchorTree add anchor", "anchor.blockHeight", anchor.blockHeight, "success", success)
return true
}
return false
Expand Down

0 comments on commit e465cbc

Please sign in to comment.