feat: add env var overrides for bind addresses#13
Open
huth-stacks wants to merge 205 commits into
Open
Conversation
- `Originator` mode: `deny` mode for origin account, `allow` mode for others - `MaySend` condition code for NFTs: the asset may be sent, but it doesn't have to be
Signed-off-by: Jacinta Ferrant <236437600+jacinta-stacks@users.noreply.github.com>
… into feat/variable-lookup-by-ref
…ck if is for a post condition aborted transaction Signed-off-by: Jacinta Ferrant <236437600+jacinta-stacks@users.noreply.github.com>
… into feat/variable-lookup-by-ref
`supports_sip040_post_conditions` is more clear and future-safe.
Modify tests to ensure they always pass through this function, just like in real world execution.
… into chore/stop-emitting-failed-transaction-events
Signed-off-by: Jacinta Ferrant <236437600+jacinta-stacks@users.noreply.github.com>
Signed-off-by: Jacinta Ferrant <236437600+jacinta-stacks@users.noreply.github.com>
Signed-off-by: Jacinta Ferrant <236437600+jacinta-stacks@users.noreply.github.com>
This reduces the scope of the change.
…d-const-callable Feat/improved const callable
chore: bump versions toml for 3.4.0.0.0
939da53 to
da0b2f7
Compare
Release binaries ship at ~130MB due to included debug info. Adding strip = true reduces binary size to ~17MB without affecting runtime behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The systemd unit had Restart=no, meaning any crash left the node permanently down until manual intervention. Changing to on-failure with a 30s delay enables automatic recovery while avoiding tight restart loops from configuration errors (exit code 0). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Dockerfile had no health check, preventing container orchestrators from detecting an unresponsive node. Adds curl-based check against /v2/info endpoint with 30s interval. Installs curl in the slim image since it's not present by default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The event dispatcher panicked on invalid observer URLs and had no retry limit, allowing a misconfigured observer to halt block processing indefinitely. Changes: - Replace panic on URL parse failure with error return - Replace expect on missing host with error return - Replace panic on HTTP request encoding with error return - Add max retry limit (25 attempts) to prevent infinite loops A misconfigured observer URL now logs an error and returns EventDispatcherError instead of crashing the node. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DNS resolution failures at startup caused the node to panic, which is a race condition in Docker environments where DNS may not be ready when the container starts. Now logs an error and skips the unresolvable bootstrap node, allowing the node to start and discover peers through other mechanisms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The add_deny_node function used chained unwrap() calls on DNS resolution, which panics if the deny node hostname can't be resolved. Now logs an error and skips the node, matching the bootstrap node fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Five P2P message validation functions used assert!() on peer-supplied payload_len values, allowing any unauthenticated peer to crash a node by sending a message with a small payload_len (GitHub stacks-network#6978). Replaced assert!() with proper error returns (net_error::DeserializeError) in: validate_blocks_push, validate_microblocks_push, validate_transaction_push, validate_stackerdb_push, and validate_nakamoto_block_push. Added tests for each function verifying that crafted short payloads return errors instead of panicking. Co-Authored-By: OpenAI Codex (GPT-5.4 xhigh) <noreply@openai.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The retry limit fix (cc7ae26) introduced a data loss regression: when max retries were exhausted, the event was still deleted from the DB, permanently losing it. Now keeps the event in the DB when delivery fails so retry_pending_payloads can pick it up on restart. Events are only deleted after successful delivery or when disable_retries is true (fire-and-forget mode). Also fixes stale comment that claimed make_http_request retries until successful, which is no longer true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change error!() calls in bootstrap/deny node resolution to use structured key-value fields instead of format-string interpolation, matching stacks-core logging conventions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Having debug = true with strip = true wastes compile time generating debug info that gets immediately stripped. Set debug = false to skip the generation entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs on every push to fork/** branches: - Format check (cargo fmt-stacks --check) - Clippy (cargo clippy-stacks + cargo clippy-stackslib) - Release build with binary size report - Quick tests via nextest (excluding slow stacks-node integration tests) Keeps the fork honest on every push without the full upstream CI weight. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The general sqlite_open() function set WAL and synchronous pragmas but no mmap_size, cache_size, or wal_autocheckpoint. This meant sortition, chainstate, mempool, cost estimate, burnchain, and signer databases all ran with SQLite defaults (2MB cache, no mmap, autocheckpoint every 1000 pages). Changes: - Add mmap_size=256MB to all databases via sqlite_open() - Add cache_size=32MB to all databases via sqlite_open() - Add wal_autocheckpoint=500 for more frequent WAL checkpointing - Increase MARF-specific mmap from 256MB to 1GB (state trie lookups benefit from a larger memory-mapped window) These are standard SQLite tuning parameters. mmap uses virtual address space (not physical RAM). cache_size is 32MB per connection. More frequent checkpointing prevents the WAL file from growing to GB+ during heavy block processing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The retry-on-startup path for pending event payloads used unwrap_or_else(panic!) for URL parsing of both the stored payload URL and the observer endpoint URL. A corrupt or changed URL in the pending payloads DB would crash the node on restart. Now logs an error and skips invalid payloads (deleting them from DB) or skips observers with unparseable endpoints. Matches the error handling pattern already applied to the main dispatch path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When no registered observer matches a pending payload (either because the observer was removed from config or its endpoint URL is malformed), the payload was being deleted from the DB. This silently loses events. Now keeps unmatched payloads in the DB for retry on next restart, when the observer may be reconfigured correctly. This matches the retry-limit behavior where exhausted retries also preserve events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test suite has ~9900 tests which exceeded the 30-minute timeout on GitHub Actions runners. Increasing to 60 minutes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The node previously had only two effective log levels: default (info) and debug (all 8,018 call sites fire, producing ~500GB/hour of logs). This made debugging specific subsystems impractical. Adds STACKS_LOG env var for per-component filtering: STACKS_LOG=net=debug,clarity=info,miner=warn Components match as substrings against module_path!() values. The "default" component sets the fallback level. Longest match wins. Backwards compatible: BLOCKSTACK_DEBUG=1 and STACKS_LOG_DEBUG=1 still enable all debug logging. When STACKS_LOG is not set, behavior is identical to before. Implementation: macro-level guard check using module_path!() with lazy_static component filter map. Zero overhead for filtered messages (string formatting is skipped entirely). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The node had no disk space awareness — when the disk fills, SQLite databases silently corrupt. Adds a check every 60 seconds in the relayer thread that: - Warns at <20GB free - Logs critical error at <5GB free - Initiates graceful shutdown at <1GB free (prevents corruption) Uses df command for simplicity (no new crate dependencies). Only runs on Linux; silently skips on other platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Container deployments need to override bind addresses without editing the TOML config file. Adds environment variable support for: - STACKS_RPC_BIND (overrides [node].rpc_bind) - STACKS_P2P_BIND (overrides [node].p2p_bind) - STACKS_PROMETHEUS_BIND (overrides [node].prometheus_bind) STACKS_RPC_BIND is applied to the local rpc_bind variable so that p2p_address and data_url correctly derive from it. Follows the same pattern as the existing STACKS_WORKING_DIR override. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
da0b2f7 to
11882b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
STACKS_RPC_BIND,STACKS_P2P_BIND,STACKS_PROMETHEUS_BINDenv varsSTACKS_WORKING_DIRpatternChanges
stackslib/src/config/mod.rs: 7 lines changed (3 env var lookups)Test plan
STACKS_RPC_BIND=0.0.0.0:30443 stacks-node start --config ...binds to port 30443STACKS_PROMETHEUS_BIND=0.0.0.0:9999overrides prometheus port🤖 Generated with Claude Code