Skip to main content
Lerian SPB works within two operational realities of the STR. The STR opens only inside BACEN’s operating windows. Settlement is always asynchronous. The rail persists every message before it dispatches, so it never sends an unrecorded message.

Operating windows


BACEN announces the STR operating-window grades through GEN0021. The rail persists them, and you query the current grades with STR0001. The rail also sends an STR0001 for the grades of the day on each weekday. A live schedule view lists the opening and closing times per reference date. The last announcement for a reference date wins. The rail does not impose a generic rejection of every submit outside an operating window. Its explicit schedule-related admission rule is RLPI0007: during the additional-aporte window, it rejects an aporte to a foreign Conta PI. Aportes to the institution’s own Conta PI and resgates remain allowed. The rail closes a message that has not left by the close of its STR grade on its movement day. The message ends FAILED without being sent. A transfer, a movement, or an LTR0003 or LTR0006 leg reports settlement.failed. Any other LDL or LTR leg reports its spb.ldl failure fact, whose refusal.railClose reads GRADE_CLOSED or DAY_ENDED. When the rail holds no close time for that grade on that day, it closes the message when the movement day ends. A message that a send may have delivered does not close this way. The rail marks it SENT and does not send it again past its grade. The message waits for BACEN’s answer or for operators to close it as failed.

Certificate rotation


The rail hot-reloads the ICP-Brasil certificate and key of its SFN identity with no restart. A rotation loads the new key from the custody that SPB_SIGNER_KIND names, and writes audit evidence. The rail then signs with the new key. Until the next restart, it decrypts with the new key and the previous one, so messages that BACEN encrypted to the previous certificate still open. An activation announces the new certificate to BACEN through GEN0006. The rail reads the certifier code of the activation from the issuer of the certificate and records it at rotation. An activation answers SPB-0003 when the record of the certificate holds no certifier code. Rotate the certificate again to record it. Responses never expose the private key path or any key material. While the SFN signing certificate is outside its validity, its signing material is missing, or the custody does not sign, the rail refuses a request that would send a new STR message. It answers 503 with SPB-9001 and stores nothing. A retry succeeds after you rotate and activate a valid certificate, or after the custody answers again. Some operations check readiness first and answer 409 with SPB-3004. After a rotation, set PROCESS_CERT_PATH and the key setting of your custody to the new certificate and key before the next restart. The rail refuses to start with a certificate that expires before the rotated one. BACEN announces a new certificate of its own through GEN0018. The rail accepts inbound messages signed with that certificate as soon as the GEN0018 arrives. From 00:00 Brasília time on the activation date, it encrypts outbound messages to the new certificate. BACEN_PUBLIC_CERT_PATH needs no change, and the rail needs no restart.

Contingency and durability


  • Persist-before-send guarantees the rail dispatches no unrecorded message.
  • A dispatch sweep resends a message that has not left, with no attempt limit. DISPATCH_RETRY_BACKOFF_CEILING sets the longest wait between two sends.
  • While the connection to the queue manager is down, the rail refuses each request that would send a new STR message with 503 and SPB-1001. It stores nothing for that request. Reads and the other requests keep working. The ibm-mq check of /readyz reads down, and that check alone does not fail /readyz. The license check never fails /readyz, as the environment variables describe. When the queue manager refuses the rail’s configuration, /readyz fails. If it refuses the configuration on a reconnect, the rail stops listening and receives no BACEN message. Fix the setting and restart the service. An unreachable queue manager is retried with backoff.

Reconciliation


The rail opens a reconciliation case for an operation that needs review, such as one that is stuck or has an uncertain outcome. An operator resolves a case by recording an action against it. The rail resolves a case that a failed or uncertain send opened once the message no longer waits to be sent. A terminal case accepts no more actions. A case is filed under the family of the message it concerns, for example liquidity, rediscount or compulsory deposit.

Settlement invariants


Two invariants hold throughout:
  • A submit is dispatch, not confirmation. SUBMITTED (a TED) or PENDING (a Conta PI or SME movement) means the rail accepted the dispatch. The inbound R-leg moves the TED’s STR message to CONFIRMED or REJECTED. That R-leg carries BACEN’s settlement fields, for example numCtrlSTR and sitLancSTR, projected verbatim.
  • The rail is money-neutral. It forwards declared amounts exactly and computes no position or balance. Your ledger consumer records any accounting position.