From 7a7f413e027a0c4e01c43c7b0b39db093212c499 Mon Sep 17 00:00:00 2001 From: Hussam Date: Thu, 5 Dec 2024 13:52:39 -0600 Subject: [PATCH] tm --- consensus/misc/statefee.go | 4 ++-- core/block_validator.go | 8 ++++---- core/worker.go | 2 +- p2p/node/p2p_services.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/consensus/misc/statefee.go b/consensus/misc/statefee.go index 83c429f30..fb44fc7bd 100644 --- a/consensus/misc/statefee.go +++ b/consensus/misc/statefee.go @@ -15,7 +15,7 @@ func CalcStateLimit(parent *types.WorkObject, stateCeil uint64) uint64 { // If parent gas is zero and we have passed the 5 day threshold, we can set the first block gas limit to min gas limit if parent.StateLimit() == 0 { - return params.MinGasLimit(parent.NumberU64(common.PRIME_CTX)) + return params.MinGasLimit(parent.NumberU64(common.ZONE_CTX)) } parentStateLimit := parent.StateLimit() @@ -33,7 +33,7 @@ func CalcStateLimit(parent *types.WorkObject, stateCeil uint64) uint64 { return limit + delta } } else { - desiredLimit = params.MinGasLimit(parent.NumberU64(common.PRIME_CTX)) + desiredLimit = params.MinGasLimit(parent.NumberU64(common.ZONE_CTX)) if limit-delta/2 < desiredLimit { return desiredLimit } else { diff --git a/core/block_validator.go b/core/block_validator.go index 14eb8772b..053d2cd15 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -157,7 +157,7 @@ func (v *BlockValidator) SanityCheckWorkObjectBlockViewBody(wo *types.WorkObject } } } else { - if wo.GasLimit() < params.MinGasLimit(wo.NumberU64(common.PRIME_CTX)) { + if wo.GasLimit() < params.MinGasLimit(wo.NumberU64(common.ZONE_CTX)) { return fmt.Errorf("zone gas limit is less than the required gas limit") } if len(wo.Manifest()) != 0 { @@ -281,7 +281,7 @@ func (v *BlockValidator) SanityCheckWorkObjectHeaderViewBody(wo *types.WorkObjec } } } else { - if wo.GasLimit() < params.MinGasLimit(wo.NumberU64(common.PRIME_CTX)) { + if wo.GasLimit() < params.MinGasLimit(wo.NumberU64(common.ZONE_CTX)) { return fmt.Errorf("zone gas limit is less than the required gas limit") } // Transactions, SubManifestHash, InterlinkHashes should be nil in the workshare in Zone context @@ -413,7 +413,7 @@ func CalcGasLimit(parent *types.WorkObject, gasCeil uint64) uint64 { // If parent gas is zero and we have passed the 5 day threshold, we can set the first block gas limit to min gas limit if parent.GasLimit() == 0 { - return params.MinGasLimit(parent.NumberU64(common.PRIME_CTX)) + return params.MinGasLimit(parent.NumberU64(common.ZONE_CTX)) } parentGasLimit := parent.GasLimit() @@ -431,7 +431,7 @@ func CalcGasLimit(parent *types.WorkObject, gasCeil uint64) uint64 { return limit + delta } } else { - desiredLimit = params.MinGasLimit(parent.NumberU64(common.PRIME_CTX)) + desiredLimit = params.MinGasLimit(parent.NumberU64(common.ZONE_CTX)) if limit-delta/2 < desiredLimit { return desiredLimit } else { diff --git a/core/worker.go b/core/worker.go index fd9bf4aa9..fd24118cc 100644 --- a/core/worker.go +++ b/core/worker.go @@ -247,7 +247,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, db ethdb.Databas uncles, _ := lru.New[common.Hash, types.WorkObjectHeader](c_uncleCacheSize) worker.uncles = uncles // Set the GasFloor of the worker to the minGasLimit - worker.config.GasFloor = params.MinGasLimit(headerchain.CurrentHeader().NumberU64(common.PRIME_CTX)) + worker.config.GasFloor = params.MinGasLimit(headerchain.CurrentHeader().NumberU64(common.ZONE_CTX)) phBodyCache, _ := lru.New[common.Hash, types.WorkObject](pendingBlockBodyLimit) worker.pendingBlockBody = phBodyCache diff --git a/p2p/node/p2p_services.go b/p2p/node/p2p_services.go index 13e26f0fb..b91b72c03 100644 --- a/p2p/node/p2p_services.go +++ b/p2p/node/p2p_services.go @@ -127,7 +127,7 @@ func (p *P2PNode) requestFromPeer(peerID peer.ID, topic *pubsubManager.Topic, re } case []*types.WorkObjectBlockView: for _, block := range recvdType.([]*types.WorkObjectBlockView) { - if block != nil && block.GasLimit() < params.MinGasLimit(block.NumberU64(common.PRIME_CTX)) { + if block != nil && block.GasLimit() < params.MinGasLimit(block.NumberU64(common.ZONE_CTX)) { p.AdjustPeerQuality(peerID, topic.String(), p2p.QualityAdjOnBadResponse) return nil, errors.New("invalid response") }