Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mandate flow control in bytes #4353

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/stellar-core_example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,6 @@ PEER_FLOOD_READING_CAPACITY_BYTES=300000
# processes `FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES` bytes
FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES=100000

# Enable flow control in bytes. This config allows core to process large
# transactions on the network more efficiently and apply back pressure if
# needed.
ENABLE_FLOW_CONTROL_BYTES=true

# Byte limit for outbound transaction queue.
OUTBOUND_TX_QUEUE_BYTE_LIMIT=3145728

Expand Down
1 change: 1 addition & 0 deletions src/herder/Herder.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Herder

virtual VirtualTimer const& getTriggerTimer() const = 0;
virtual void setMaxClassicTxSize(uint32 bytes) = 0;
virtual void setMaxTxSize(uint32 bytes) = 0;
virtual void setFlowControlExtraBufferSize(uint32 bytes) = 0;

virtual ClassicTransactionQueue& getTransactionQueue() = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/herder/HerderImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ class HerderImpl : public Herder
{
mMaxClassicTxSize = std::make_optional<uint32_t>(bytes);
}
void
setMaxTxSize(uint32 bytes) override
{
mMaxTxSize = bytes;
}
std::optional<uint32_t> mFlowControlExtraBuffer;
void
setFlowControlExtraBufferSize(uint32 bytes) override
Expand Down
9 changes: 2 additions & 7 deletions src/main/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ Config::Config() : NODE_SEED(SecretKey::random())
LEDGER_PROTOCOL_VERSION = CURRENT_LEDGER_PROTOCOL_VERSION;
LEDGER_PROTOCOL_MIN_VERSION_INTERNAL_ERROR_REPORT = 18;

OVERLAY_PROTOCOL_MIN_VERSION = 32;
OVERLAY_PROTOCOL_VERSION = 34;
OVERLAY_PROTOCOL_MIN_VERSION = 33;
OVERLAY_PROTOCOL_VERSION = 35;

VERSION_STR = STELLAR_CORE_VERSION;

Expand Down Expand Up @@ -261,7 +261,6 @@ Config::Config() : NODE_SEED(SecretKey::random())
PEER_FLOOD_READING_CAPACITY_BYTES = 0;
FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES = 0;
OUTBOUND_TX_QUEUE_BYTE_LIMIT = 1024 * 1024 * 3;
ENABLE_FLOW_CONTROL_BYTES = true;

// WORKER_THREADS: setting this too low risks a form of priority inversion
// where a long-running background task occupies all worker threads and
Expand Down Expand Up @@ -1031,10 +1030,6 @@ Config::processConfig(std::shared_ptr<cpptoml::table> t)
FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES =
readInt<uint32_t>(item, 1);
}
else if (item.first == "ENABLE_FLOW_CONTROL_BYTES")
{
ENABLE_FLOW_CONTROL_BYTES = readBool(item);
}
else if (item.first == "OUTBOUND_TX_QUEUE_BYTE_LIMIT")
{
OUTBOUND_TX_QUEUE_BYTE_LIMIT = readInt<uint32_t>(item, 1);
Expand Down
5 changes: 0 additions & 5 deletions src/main/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,6 @@ class Config : public std::enable_shared_from_this<Config>
uint32_t PEER_FLOOD_READING_CAPACITY_BYTES;
uint32_t FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES;

// Enable flow control in bytes. This config allows core to process large
// transactions on the network more efficiently and apply back pressure if
// needed.
bool ENABLE_FLOW_CONTROL_BYTES;

// Byte limit for outbound transaction queue.
uint32_t OUTBOUND_TX_QUEUE_BYTE_LIMIT;

Expand Down
Loading
Loading