4972 Commits

Author SHA1 Message Date
coopops de24cd822e feat(chain): chain-historical-exceptions registry for action_mroot bypass
Adds a generic per-chain exception mechanism that lets a controller skip
the producer_block_id != ab._id assert in apply_block when the only
header divergence is a known historical action_mroot=0 inside a declared
block-number window for the matching chain_id.

Motivation: on 2026-05-11 the mainnet Коопеномикс BP briefly ran a dev
build (v5.2.0-dev-294edf3b8) that did not register the on_activation
handler for ASSERT_RECOVER_KEY_ACCOUNT (id=24). For ~20 minutes (blocks
113273322..113275716) onblock did not register intrinsics,
_action_receipt_digests was empty and finalized action_mroot was the
zero digest. The window is now permanently irreversible. Any current
binary refuses to replay past block 113273322 with
block_validate_exception, so new full-history archive nodes / fresh BPs
/ --hard-replay-blockchain on mainnet are blocked.

Design (see exception-notes.md):
- New struct chain_historical_exceptions { chain_id, windows[] }
  loaded from a JSON file path supplied via the new config option
  chain-historical-exceptions. Absent / empty file => no change in
  behavior, strict upstream Antelope validation. Forks and subnets
  reusing this codebase without supplying a file are unaffected.
- Loader fires from controller_impl::init() right after
  protocol_features.init(db) (where self.get_chain_id() is valid) and
  EOS_ASSERTs that the file's chain_id matches the running chain — so
  the mainnet exception file cannot accidentally be applied to a
  different chain.
- Bypass site is the existing producer_block_id != ab._id branch in
  apply_block. Bypass fires only when all three hold: block_num is
  inside a declared window, b->action_mroot is strictly the zero
  digest, and a new other_header_fields_match helper confirms every
  other header field (timestamp, producer, confirmed, previous,
  transaction_mroot, schedule_version, new_producers,
  header_extensions) matches the locally-assembled block. Any other
  header divergence still throws block_validate_exception as before.
- Every bypass application is logged via wlog with the configured
  reason for forensics.

The data file for mainnet Коопеномикс is shipped separately (lives in
the playbooks repo, deployed to /etc/coopos/exceptions/) so the data
never leaks into forks that simply pull this codebase.

Unit tests cover JSON round-trip, chain_id mismatch -> startup refusal,
in-window action_mroot=0 -> bypass accepts, out-of-window -> rejected,
and in-window-but-other-field-altered -> rejected.

Refs: incident 2026-05-11, coopos commit 2c23b8108 (root-cause fix that
arrived too late for the dirty window).
2026-06-03 06:19:06 +00:00
Alex Ant 26e43fbc85 workflow and api specification change 2025-08-27 14:26:05 +05:00
Kevin Heifner a7b948afea Remove sync() call to improve performance 2024-04-04 09:44:02 -05:00
Kevin Heifner 0eb578e421 Avoid unused http variable by accessing it where needed. 2024-03-27 13:01:15 -05:00
Kevin Heifner 82d8961dc1 GH-2334 Avoid unused warning 2024-03-27 12:13:24 -05:00
Matt Witherspoon 94e08f7d83 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-03-22 23:24:49 -04:00
Matt Witherspoon d80b1437b6 explicit capture list 2024-03-22 22:47:33 -04:00
Matt Witherspoon 484115e636 fix usage of stack variable after return 2024-03-12 23:45:14 -04:00
Matt Witherspoon 4074b15a76 specialized to_variant() for chainbase::environment's packedness 2024-03-11 21:23:03 -04:00
Matt Witherspoon b47a64c742 fix net_plugin_impl dtor order 2024-03-11 14:56:54 -04:00
Kevin Heifner 998135e3e9 Merge remote-tracking branch 'origin/release/5.0' into GH-2228-return-value-main 2024-02-20 14:32:14 -06:00
Kevin Heifner 0a74525b3e GH-2228 Fix merge issue 2024-02-20 13:48:36 -06:00
Kevin Heifner 20281737ee Merge remote-tracking branch 'origin/release/4.0' into GH-2228-return-value-5.0-merge 2024-02-20 13:48:00 -06:00
Kevin Heifner 3c957c1bb5 Merge remote-tracking branch 'origin/release/3.2' into GH-2228-return-value-4.0 2024-02-20 13:09:27 -06:00
Kevin Heifner 5e34f3e78a Fix merge 2024-02-20 11:56:50 -06:00
Kevin Heifner 2a10c5d0db GH-2228 Correctly handle action return value conversion by ABI 2024-02-20 11:48:04 -06:00
Matt Witherspoon c37b99e6ed Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-08 23:23:02 -05:00
Matt Witherspoon a89b860338 use discrete ports for each test case to workaround defect 2024-02-08 13:48:40 -05:00
Kevin Heifner 1ec3662f16 GH-2215 Start after lib 2024-02-06 20:19:18 -06:00
Kevin Heifner cc75dbcca0 GH-2215 Reset syncing on unlinkable blocks 2024-02-06 20:19:03 -06:00
Matt Witherspoon d0a449e5cc Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-06 10:48:47 -05:00
Matt Witherspoon 6e063a612a move some tests that open localhost sockets to NP tests 2024-02-05 23:11:31 -05:00
Matt Witherspoon 3f51727da3 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-05 21:35:31 -05:00
Matt Witherspoon d77bcd560f improve test reliablity 2024-02-05 19:02:21 -05:00
Matt Witherspoon bb07d0b149 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-05 18:11:17 -05:00
Matt Witherspoon 0d8325af88 don't require keep alive for non-200 responses 2024-02-05 18:10:58 -05:00
Matt Witherspoon 861519da54 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-05 18:02:44 -05:00
Matt Witherspoon 6e3c378fb0 Merge pull request #2209 from AntelopeIO/max-requests_fix_50
[5.0] fix crash/UB when exceeding `http-max-requests-in-flight`
2024-02-05 22:20:59 +00:00
Matt Witherspoon 345bd73658 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-05 16:34:56 -05:00
Matt Witherspoon 874b80ea2d fix crash/UB when exceeding max-requests-in-flight 2024-02-05 15:39:44 -05:00
Matt Witherspoon b8441f2caf some tests for max-*-in-flight 2024-02-05 13:33:06 -05:00
Kevin Heifner bb536e9d36 always update max_bytes_in_flight in http_response_handler 2024-02-05 12:37:17 -05:00
Matt Witherspoon ba04659f7c Merge remote-tracking branch 'origin/release/4.0' into HEAD 2024-02-05 10:25:32 -05:00
Matt Witherspoon 8a0388ff16 Merge remote-tracking branch 'origin/release/3.2' into HEAD 2024-02-05 10:06:33 -05:00
Matt Witherspoon 66f2f2739f Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-02-05 10:00:54 -05:00
Matt Witherspoon 67c1f3259b make read-only-threads defaults clearer in help text 2024-02-04 23:27:24 -05:00
Matt Witherspoon a82f152658 change max inflight bytes/requests from 429 to 503 2024-02-04 22:54:03 -05:00
Kevin Heifner 91fcc5ee47 Merge remote-tracking branch 'origin/release/5.0' into GH-2104-find-chain_api_plugin-main 2024-01-29 13:55:36 -06:00
Kevin Heifner 7a5076319b GH-2104 Search options instead of querying appbase as initialization order is not guaranteed 2024-01-29 07:28:27 -06:00
Kevin Heifner 3539b718e4 Merge remote-tracking branch 'origin/release/5.0' into report-read-only-error-main 2024-01-29 07:09:50 -06:00
Kevin Heifner 1a6e19bac6 Report error to next 2024-01-27 10:42:50 -06:00
Kevin Heifner c723c2d0b7 Report error before callback in case callback throws 2024-01-27 10:39:47 -06:00
Kevin Heifner fbae89664f Add missing } 2024-01-27 10:38:49 -06:00
Kevin Heifner eda7e1c7eb Merge remote-tracking branch 'origin/release/5.0' into net-lib-catchup-main 2024-01-25 07:00:23 -06:00
Kevin Heifner 5a46157f94 Also need to switch to lib_catchup if in head_catchup; not just when in_sync. 2024-01-24 12:54:14 -06:00
Matt Witherspoon eee73128e5 Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-01-19 18:18:01 -05:00
Matt Witherspoon bb8400db4d don't assume chain_api_plugin is linked 2024-01-18 16:37:57 -05:00
Matt Witherspoon 576984b093 different approach to detecting if chain_api_plugin enabled 2024-01-18 12:16:04 -05:00
Matt Witherspoon a95464957c Merge remote-tracking branch 'origin/release/5.0' into HEAD 2024-01-16 10:41:06 -05:00
Matt Witherspoon 76c3b635ea Merge pull request #2042 from AntelopeIO/http_plugin_state_life_50
[5.0] extend life of `http_plugin_state` to ensure no invalid memory accesses during nodeos shutdown
2024-01-16 15:36:41 +00:00