Skip to content

Commit

Permalink
Remove MinimumSorobanNetworkConfig::TX_MAX_CONTRACT_EVENTS_SIZE_BYTES
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Aug 8, 2023
1 parent c34f740 commit e5deeaa
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/herder/Upgrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1560,9 +1560,7 @@ ConfigUpgradeSetFrame::isValidForApply() const
cfg.contractLedgerCost().txMaxWriteBytes;
break;
case ConfigSettingID::CONFIG_SETTING_CONTRACT_EVENTS_V0:
valid = cfg.contractEvents().txMaxContractEventsSizeBytes >=
MinimumSorobanNetworkConfig::
TX_MAX_CONTRACT_EVENTS_SIZE_BYTES &&
valid = cfg.contractEvents().txMaxContractEventsSizeBytes >= 0 &&
cfg.contractEvents().feeContractEvents1KB >= 0;
break;
case ConfigSettingID::CONFIG_SETTING_STATE_EXPIRATION:
Expand Down
5 changes: 1 addition & 4 deletions src/invariant/LedgerEntryIsValid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,7 @@ LedgerEntryIsValid::checkIsValid(ConfigSettingEntry const& cfg,
}
break;
case ConfigSettingID::CONFIG_SETTING_CONTRACT_EVENTS_V0:
if (cfg.contractEvents().txMaxContractEventsSizeBytes <
MinimumSorobanNetworkConfig::
TX_MAX_CONTRACT_EVENTS_SIZE_BYTES ||
cfg.contractEvents().feeContractEvents1KB < 0)
if (cfg.contractEvents().feeContractEvents1KB < 0)
{
return "Invalid contractMetaData";
}
Expand Down
2 changes: 0 additions & 2 deletions src/ledger/NetworkConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ struct MinimumSorobanNetworkConfig
static constexpr uint32_t LEDGER_MAX_WRITE_LEDGER_ENTRIES = 2;
static constexpr uint32_t LEDGER_MAX_WRITE_BYTES = 5000;

static constexpr uint32_t TX_MAX_CONTRACT_EVENTS_SIZE_BYTES = 0;

static constexpr uint32_t TX_MAX_SIZE_BYTES = 10000;
static constexpr uint32_t LEDGER_MAX_TX_SIZE_BYTES = 10000;

Expand Down
3 changes: 1 addition & 2 deletions src/transactions/test/InvokeHostFunctionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1779,8 +1779,6 @@ overrideSettingsToMin(Application& app)
.contractLedgerCost() = costEntry;

ConfigSettingContractEventsV0 events;
events.txMaxContractEventsSizeBytes =
MinimumSorobanNetworkConfig::TX_MAX_CONTRACT_EVENTS_SIZE_BYTES;
ltx.load(
configSettingKey(ConfigSettingID::CONFIG_SETTING_CONTRACT_EVENTS_V0))
.current()
Expand Down Expand Up @@ -1856,6 +1854,7 @@ TEST_CASE("settings upgrade with minimum settings", "[tx][soroban][upgrades]")

// check a couple settings to make sure they're at the minimum
REQUIRE(cost.contractLedgerCost().feeRead1KB == 0);
REQUIRE(cost.contractLedgerCost().writeFee1KBBucketListLow == 0);
REQUIRE(cost.contractLedgerCost().ledgerMaxReadLedgerEntries ==
MinimumSorobanNetworkConfig::LEDGER_MAX_READ_LEDGER_ENTRIES);
REQUIRE(cost.contractLedgerCost().ledgerMaxReadBytes ==
Expand Down

0 comments on commit e5deeaa

Please sign in to comment.