Open dmkozh opened 4 months ago
@dmkozh Where is this network endpoint? Is it through Horizon? Currently we only use soroban-rpc. Do you suggest this should be a compile time constant?
No, this is not a constant, which is the reason for the issue. You need to fetch the stateArchivalSettings
ledger entry and use maxEntryTTL
from it. I'm not sure if RPC provides a shortcut for that, but if you just use the getLedgerEntry
API using a ledger key, then your key would be of type CONFIG_SETTING
with configSettingID
set to CONFIG_SETTING_STATE_ARCHIVAL
.
During TTL extension operation ledgers_to_extend is incorrectly truncated to
MAX_LEDGERS_TO_EXTEND
constant. Instead, the max ledgers to extend should be read from the network config, specifically from thestateArchivalSettings.maxEntryTTL
setting for the respective network. The check could probably happen on the simulation side, so it could be sufficient for CLI to simply remove the truncation code.