Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tholonious committed Apr 23, 2024
1 parent 4bc7b66 commit 03f90a4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions lib/block_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down
32 changes: 16 additions & 16 deletions lib/block_view_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)...)
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 03f90a4

Please sign in to comment.