From 6bd1a19f8de1440cafb9f1647a34f13ed981cdea Mon Sep 17 00:00:00 2001 From: iamsofonias Date: Mon, 22 Apr 2024 16:24:10 -0400 Subject: [PATCH] Rename --- lib/block_view.go | 20 ++++++++++---------- lib/block_view_types.go | 32 ++++++++++++++++---------------- lib/constants.go | 4 ++-- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/block_view.go b/lib/block_view.go index 1c75c0f4e..e38f72dee 100644 --- a/lib/block_view.go +++ b/lib/block_view.go @@ -3508,22 +3508,22 @@ func (bav *UtxoView) _connectUpdateGlobalParams( } newGlobalParamsEntry.MempoolCongestionFactorBasisPoints = val } - if len(extraData[PastBlocksCongestionFactorBasisPointsKey]) > 0 { + if len(extraData[MempoolPastBlocksCongestionFactorBasisPointsKey]) > 0 { val, bytesRead := Uvarint( - extraData[PastBlocksCongestionFactorBasisPointsKey], + extraData[MempoolPastBlocksCongestionFactorBasisPointsKey], ) if val > MaxBasisPoints { return 0, 0, nil, fmt.Errorf( - "_connectUpdateGlobalParams: PastBlocksCongestionFactorBasisPoints must be <= %d", + "_connectUpdateGlobalParams: MempoolPastBlocksCongestionFactorBasisPoints must be <= %d", MaxBasisPoints, ) } if bytesRead <= 0 { return 0, 0, nil, fmt.Errorf( - "_connectUpdateGlobalParams: unable to decode PastBlocksCongestionFactorBasisPoints as uint64", + "_connectUpdateGlobalParams: unable to decode MempoolPastBlocksCongestionFactorBasisPoints as uint64", ) } - newGlobalParamsEntry.PastBlocksCongestionFactorBasisPoints = val + newGlobalParamsEntry.MempoolPastBlocksCongestionFactorBasisPoints = val } if len(extraData[MempoolPriorityPercentileBasisPointsKey]) > 0 { val, bytesRead := Uvarint( @@ -3542,22 +3542,22 @@ func (bav *UtxoView) _connectUpdateGlobalParams( } newGlobalParamsEntry.MempoolPriorityPercentileBasisPoints = val } - if len(extraData[PastBlocksPriorityPercentileBasisPointsKey]) > 0 { + if len(extraData[MempoolPastBlocksPriorityPercentileBasisPointsKey]) > 0 { val, bytesRead := Uvarint( - extraData[PastBlocksPriorityPercentileBasisPointsKey], + extraData[MempoolPastBlocksPriorityPercentileBasisPointsKey], ) if val > MaxBasisPoints { return 0, 0, nil, fmt.Errorf( - "_connectUpdateGlobalParams: PastBlocksPriorityPercentileBasisPoints must be <= %d", + "_connectUpdateGlobalParams: MempoolPastBlocksPriorityPercentileBasisPoints must be <= %d", MaxBasisPoints, ) } if bytesRead <= 0 { return 0, 0, nil, fmt.Errorf( - "_connectUpdateGlobalParams: unable to decode PastBlocksPriorityPercentileBasisPoints as uint64", + "_connectUpdateGlobalParams: unable to decode MempoolPastBlocksPriorityPercentileBasisPoints as uint64", ) } - newGlobalParamsEntry.PastBlocksPriorityPercentileBasisPoints = val + newGlobalParamsEntry.MempoolPastBlocksPriorityPercentileBasisPoints = val } if len(extraData[MaxBlockSizeBytesPoSKey]) > 0 { val, bytesRead := Uvarint( diff --git a/lib/block_view_types.go b/lib/block_view_types.go index 6019bb165..9bc0d5fae 100644 --- a/lib/block_view_types.go +++ b/lib/block_view_types.go @@ -4236,17 +4236,17 @@ type GlobalParamsEntry struct { // the fee for a new txn. MempoolFeeEstimatorNumPastBlocks uint64 - // DefaultMempoolCongestionFactorBasisPoints and DefaultPastBlocksCongestionFactorBasisPoints are the default values - // for GlobalParams.MempoolCongestionFactorBasisPoints and GlobalParams.DefaultPastBlocksCongestionFactorBasisPoints. + // DefaultMempoolCongestionFactorBasisPoints and DefaultMempoolPastBlocksCongestionFactorBasisPoints are the default values + // for GlobalParams.MempoolCongestionFactorBasisPoints and GlobalParams.DefaultMempoolPastBlocksCongestionFactorBasisPoints. /// See comments in GlobalParamsEntry for a description of their usage. - MempoolCongestionFactorBasisPoints uint64 - PastBlocksCongestionFactorBasisPoints uint64 + MempoolCongestionFactorBasisPoints uint64 + MempoolPastBlocksCongestionFactorBasisPoints uint64 - // MempoolPriorityPercentileBasisPoints and PastBlocksPriorityPercentileBasisPoints are the default values - // for GlobalParams.DefaultMempoolPriorityPercentileBasisPoints and GlobalParams.DefaultPastBlocksPriorityPercentileBasisPoints. + // MempoolPriorityPercentileBasisPoints and MempoolPastBlocksPriorityPercentileBasisPoints are the default values + // for GlobalParams.DefaultMempoolPriorityPercentileBasisPoints and GlobalParams.DefaultMempoolPastBlocksPriorityPercentileBasisPoints. // See comments in GlobalParamsEntry for a description of their usage. - MempoolPriorityPercentileBasisPoints uint64 - PastBlocksPriorityPercentileBasisPoints uint64 + MempoolPriorityPercentileBasisPoints uint64 + MempoolPastBlocksPriorityPercentileBasisPoints uint64 // MaxBlockSizeBytesPoS is the maximum size of a block in bytes. MaxBlockSizeBytesPoS uint64 @@ -4288,9 +4288,9 @@ func (gp *GlobalParamsEntry) Copy() *GlobalParamsEntry { MempoolFeeEstimatorNumMempoolBlocks: gp.MempoolFeeEstimatorNumMempoolBlocks, MempoolFeeEstimatorNumPastBlocks: gp.MempoolFeeEstimatorNumPastBlocks, MempoolCongestionFactorBasisPoints: gp.MempoolCongestionFactorBasisPoints, - PastBlocksCongestionFactorBasisPoints: gp.PastBlocksCongestionFactorBasisPoints, + MempoolPastBlocksCongestionFactorBasisPoints: gp.MempoolPastBlocksCongestionFactorBasisPoints, MempoolPriorityPercentileBasisPoints: gp.MempoolPriorityPercentileBasisPoints, - PastBlocksPriorityPercentileBasisPoints: gp.PastBlocksPriorityPercentileBasisPoints, + MempoolPastBlocksPriorityPercentileBasisPoints: gp.MempoolPastBlocksPriorityPercentileBasisPoints, MaxBlockSizeBytesPoS: gp.MaxBlockSizeBytesPoS, SoftMaxBlockSizeBytesPoS: gp.SoftMaxBlockSizeBytesPoS, MaxTxnSizeBytesPoS: gp.MaxTxnSizeBytesPoS, @@ -4326,9 +4326,9 @@ func (gp *GlobalParamsEntry) RawEncodeWithoutMetadata(blockHeight uint64, skipMe data = append(data, UintToBuf(gp.MempoolFeeEstimatorNumMempoolBlocks)...) data = append(data, UintToBuf(gp.MempoolFeeEstimatorNumPastBlocks)...) data = append(data, UintToBuf(gp.MempoolCongestionFactorBasisPoints)...) - data = append(data, UintToBuf(gp.PastBlocksCongestionFactorBasisPoints)...) + data = append(data, UintToBuf(gp.MempoolPastBlocksCongestionFactorBasisPoints)...) data = append(data, UintToBuf(gp.MempoolPriorityPercentileBasisPoints)...) - data = append(data, UintToBuf(gp.PastBlocksPriorityPercentileBasisPoints)...) + data = append(data, UintToBuf(gp.MempoolPastBlocksPriorityPercentileBasisPoints)...) data = append(data, UintToBuf(gp.MaxBlockSizeBytesPoS)...) data = append(data, UintToBuf(gp.SoftMaxBlockSizeBytesPoS)...) data = append(data, UintToBuf(gp.MaxTxnSizeBytesPoS)...) @@ -4430,17 +4430,17 @@ func (gp *GlobalParamsEntry) RawDecodeWithoutMetadata(blockHeight uint64, rr *by if err != nil { return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading MempoolCongestionFactorBasisPoints") } - gp.PastBlocksCongestionFactorBasisPoints, err = ReadUvarint(rr) + gp.MempoolPastBlocksCongestionFactorBasisPoints, err = ReadUvarint(rr) if err != nil { - return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading PastBlocksCongestionFactorBasisPoints") + return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading MempoolPastBlocksCongestionFactorBasisPoints") } gp.MempoolPriorityPercentileBasisPoints, err = ReadUvarint(rr) if err != nil { return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading MempoolPriorityPercentileBasisPoints") } - gp.PastBlocksPriorityPercentileBasisPoints, err = ReadUvarint(rr) + gp.MempoolPastBlocksPriorityPercentileBasisPoints, err = ReadUvarint(rr) if err != nil { - return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading PastBlocksPriorityPercentileBasisPoints") + return errors.Wrapf(err, "GlobalParamsEntry.Decode: Problem reading MempoolPastBlocksPriorityPercentileBasisPoints") } gp.MaxBlockSizeBytesPoS, err = ReadUvarint(rr) if err != nil { diff --git a/lib/constants.go b/lib/constants.go index b2b0681c3..66960a993 100644 --- a/lib/constants.go +++ b/lib/constants.go @@ -1754,9 +1754,9 @@ const ( MempoolFeeEstimatorNumMempoolBlocksKey = "MempoolFeeEstimatorNumMempoolBlocks" MempoolFeeEstimatorNumPastBlocksKey = "MempoolFeeEstimatorNumPastBlocks" MempoolCongestionFactorBasisPointsKey = "MempoolCongestionFactorBasisPoints" - PastBlocksCongestionFactorBasisPointsKey = "PastBlocksCongestionFactorBasisPoints" + MempoolPastBlocksCongestionFactorBasisPointsKey = "MempoolPastBlocksCongestionFactorBasisPoints" MempoolPriorityPercentileBasisPointsKey = "MempoolPriorityPercentileBasisPoints" - PastBlocksPriorityPercentileBasisPointsKey = "PastBlocksPriorityPercentileBasisPoints" + MempoolPastBlocksPriorityPercentileBasisPointsKey = "MempoolPastBlocksPriorityPercentileBasisPoints" MaxBlockSizeBytesPoSKey = "MaxBlockSizeBytesPoS" SoftMaxBlockSizeBytesPoSKey = "SoftMaxBlockSizeBytesPoS" MaxTxnSizeBytesPoSKey = "MaxTxnSizeBytesPoS"