Skip to content

Commit ded2ebf

Browse files
committed
Merge branch 'v1_12_1' into 'main'
Version 1.12.1 See merge request flarenetwork/network/go-flare!4
2 parents 77530ea + 30f950f commit ded2ebf

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

avalanchego/version/constants.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var (
2525
Current = &Semantic{
2626
Major: 1,
2727
Minor: 12,
28-
Patch: 0,
28+
Patch: 1,
2929
}
3030
CurrentApp = &Application{
3131
Name: Client,
@@ -49,7 +49,7 @@ var (
4949
CurrentSgb = &Semantic{
5050
Major: 0,
5151
Minor: 10,
52-
Patch: 0,
52+
Patch: 1,
5353
}
5454
CurrentSgbApp = &Application{
5555
Name: Client,

avalanchego/vms/platformvm/block/executor/manager.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/ava-labs/avalanchego/vms/platformvm/state"
1717
"github.com/ava-labs/avalanchego/vms/platformvm/txs"
1818
"github.com/ava-labs/avalanchego/vms/platformvm/txs/executor"
19+
"github.com/ava-labs/avalanchego/vms/platformvm/txs/fee"
1920
"github.com/ava-labs/avalanchego/vms/platformvm/txs/mempool"
2021
"github.com/ava-labs/avalanchego/vms/platformvm/validators"
2122
)
@@ -168,6 +169,24 @@ func (m *manager) VerifyTx(tx *txs.Tx) error {
168169
return fmt.Errorf("failed to advance the chain time: %w", err)
169170
}
170171

172+
if timestamp := stateDiff.GetTimestamp(); m.txExecutorBackend.Config.UpgradeConfig.IsEtnaActivated(timestamp) {
173+
complexity, err := fee.TxComplexity(tx.Unsigned)
174+
if err != nil {
175+
return fmt.Errorf("failed to calculate tx complexity: %w", err)
176+
}
177+
gas, err := complexity.ToGas(m.txExecutorBackend.Config.DynamicFeeConfig.Weights)
178+
if err != nil {
179+
return fmt.Errorf("failed to calculate tx gas: %w", err)
180+
}
181+
182+
// TODO: After the mempool is updated, convert this check to use the
183+
// maximum mempool capacity.
184+
feeState := stateDiff.GetFeeState()
185+
if gas > feeState.Capacity {
186+
return fmt.Errorf("tx exceeds current gas capacity: %d > %d", gas, feeState.Capacity)
187+
}
188+
}
189+
171190
feeCalculator := state.PickFeeCalculator(m.txExecutorBackend.Config, stateDiff)
172191
_, _, _, err = executor.StandardTx(
173192
m.txExecutorBackend,

0 commit comments

Comments
 (0)