Skip to content

Conversation

@ogtownsend
Copy link
Collaborator

@ogtownsend ogtownsend commented Nov 3, 2025

  • Apply TXM and LogPoller default config values field by field
  • Updates the TXM config to use Durations instead of uints that represent different units
  • Add hooks for ValidateConfig and ApplyDefaults in the TXM and logPoller config
  • Add config tests for overall TOML, logpoller, and TXM

MaxSendRetryAttempts: 5,
TxExpirationMins: 5,
CleanupIntervalMins: 60,
StickyNodeContextEnabled: true,
Copy link
Collaborator Author

@ogtownsend ogtownsend Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing StickyNodeContextEnabled as it doesn't seem to be used anywhere...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah the flag is about keeping a consistent connection with the same lite server to avoid state difference between nodes, by default lite client implements connection pool(but we're only feeding one atm)

ref: https://github.com/xssnick/tonutils-go#connection

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool thanks, we can add it back when needed. Also would prefer to add it as StickyNodeContextDisabled since default/unset bool values are false

@ogtownsend ogtownsend marked this pull request as ready for review November 3, 2025 17:58
@ogtownsend ogtownsend requested a review from a team as a code owner November 3, 2025 17:58
Copilot AI review requested due to automatic review settings November 3, 2025 17:58
@ogtownsend ogtownsend requested review from archseer, huangzhen1997 and jadepark-dev and removed request for patricios-space November 3, 2025 17:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the TXM and LogPoller configuration by changing from primitive types with mixed units to proper Duration types, and implements field-by-field default application. The key changes include migrating from uint fields representing different time units to consistent *config.Duration types and adding proper configuration validation and default application methods.

  • Replaced TXM config fields with Duration types (ConfirmPollSecsConfirmPollInterval, etc.)
  • Added ApplyDefaults() and ValidateConfig() methods to both TXM and LogPoller configs
  • Updated TOML configuration to apply defaults field-by-field rather than replacing entire config sections

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/txm/txm.go Updated to use Duration methods instead of manual time conversions
pkg/txm/config.go Added Duration fields, ApplyDefaults and ValidateConfig methods
pkg/txm/config_test.go Added comprehensive tests for default application behavior
pkg/logpoller/config.go Added ApplyDefaults and ValidateConfig methods
pkg/logpoller/config_test.go Added tests for LogPoller default application
pkg/config/toml.go Modified to apply defaults field-by-field and call validation hooks
pkg/config/toml_test.go Updated tests to verify field-by-field default behavior
integration-tests/txm/txm_test.go Updated to use new Duration-based config field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@jadepark-dev jadepark-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great 🎉

@ogtownsend ogtownsend merged commit 425fbd9 into main Nov 3, 2025
35 checks passed
@ogtownsend ogtownsend deleted the ogt/add-fallback-field-logic-for-default-configs branch November 3, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants