Skip to content

Commit

Permalink
Extra payment validation
Browse files Browse the repository at this point in the history
  • Loading branch information
phearnot committed Aug 15, 2024
1 parent 7914f70 commit 2f9e61c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ waves {

# Required number of connections (both incoming and outgoing) to attempt block generation. Setting this value to 0
# enables "off-line generation".
quorum = 1
quorum = 3

# Enable block generation only in the last block is not older the given period of time
interval-after-last-block-then-generation-is-allowed = 1d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ case class FunctionalitySettings(
xtnBuybackAddress: Option[String] = None,
xtnBuybackRewardPeriod: Int = Int.MaxValue,
lightNodeBlockFieldsAbsenceInterval: Int = 1000,
blockRewardBoostPeriod: Int = 1000
blockRewardBoostPeriod: Int = 1000,
paymentsCheckHeight: Int = 0
) {
val allowLeasedBalanceTransferUntilHeight: Int = blockVersion3AfterHeight
val allowTemporaryNegativeUntil: Long = lastTimeBasedForkParameter
Expand Down Expand Up @@ -132,7 +133,8 @@ object FunctionalitySettings {
daoAddress = Some("3PEgG7eZHLFhcfsTSaYxgRhZsh4AxMvA4Ms"),
xtnBuybackAddress = Some("3PFjHWuH6WXNJbwnfLHqNFBpwBS5dkYjTfv"),
xtnBuybackRewardPeriod = 100000,
blockRewardBoostPeriod = 300_000
blockRewardBoostPeriod = 300_000,
paymentsCheckHeight = 4303300
)

val TESTNET: FunctionalitySettings = apply(
Expand Down Expand Up @@ -162,7 +164,8 @@ object FunctionalitySettings {
ethInvokePaymentsCheckHeight = 1311110,
daoAddress = Some("3MaFVH1vTv18FjBRugSRebx259D7xtRh9ic"),
xtnBuybackAddress = Some("3MbhiRiLFLJ1EVKNP9npRszcLLQDjwnFfZM"),
xtnBuybackRewardPeriod = 1000
xtnBuybackRewardPeriod = 1000,
paymentsCheckHeight = 2195900
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.wavesplatform.metrics.*
import com.wavesplatform.state.*
import com.wavesplatform.state.diffs.BalanceDiffValidation
import com.wavesplatform.state.diffs.invoke.CallArgumentPolicy.*
import com.wavesplatform.state.SnapshotBlockchain
import com.wavesplatform.transaction.Asset.{IssuedAsset, Waves}
import com.wavesplatform.transaction.TxValidationError.*
import com.wavesplatform.transaction.smart.DAppEnvironment.ActionLimits
Expand Down Expand Up @@ -217,6 +216,13 @@ object InvokeScriptDiff {
wrapDAppEnv
))
for {
_ <-
if (
blockchain.height >= blockchain.settings.functionalitySettings.paymentsCheckHeight && blockchain
.isFeatureActivated(BlockchainFeatures.LightNode)
)
validateIntermediateBalances(blockchain, paymentsPartInsideDApp, 0, Nil)
else traced(Right(()))
evaluated <- CoevalR(
evaluateV2(
version,
Expand Down

0 comments on commit 2f9e61c

Please sign in to comment.