Skip to content

[pull] master from dfinity:master - #1

Merged
pull[bot] merged 1 commit into
bit-cook:masterfrom
dfinity:master
May 13, 2021
Merged

pull[bot] merged 1 commit into
bit-cook:masterfrom
dfinity:master

Conversation

@pull

@pull pull Bot commented May 13, 2021 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added the ⤵️ pull label May 13, 2021
@pull
pull Bot merged commit 779549e into bit-cook:master May 13, 2021
pull Bot pushed a commit that referenced this pull request Mar 7, 2022
lint: add a negative dependency checker

Add a program that looks for undesired dependencies in the workspace
dependency graph.

Example output:
```
Found 3 dependency policy violations.

================================================================================
Found a violation of rule #1 defined in depcheck/src/main.rs:
================================================================================
'*' should not depend on 'git2'.

If you need to get data from Git, consider executing 'git' command as a
subprocess. 'git2' requires native libraries and increases compile time by ~10s,
usually providing little value.

Shortest dependency path:
depcheck:0.1.0
└── git2:0.7.2

================================================================================
Found a violation of rule #2 defined in depcheck/src/main.rs:
================================================================================
'ic-replica' should not depend on 'dfn_core'.

Replica must not depend on Rust CDK.

Shortest dependency path:
ic-replica:0.8.0
└── ic-crypto:0.8.0
    └── ic-crypto-tls-cert-validation:0.8.0
        └── dfn_core:0.8.0

================================================================================
Found a violation of rule #3 defined in depcheck/src/main.rs:
================================================================================
'ic-interfaces' should not depend on 'tokio'.

Interfaces should not depend on implementation details.

Shortest dependency path:
ic-interfaces:0.8.0
└── tokio:1.17.0

``` 

See merge request dfinity-lab/public/ic!3524
pull Bot pushed a commit that referenced this pull request Oct 19, 2022
CRP-1669: Reading node's keys from both dedicated folders and from crypto_root.

This is step #1 of CRP-1669.  Changing the logic when reading nodes's keys:
- public keys are read either from `${crypto_root}/public` or from `${crypto_root}` (if not present in the dedicated folder).
- secret keys are read either from `${crypto_root}/vault` or from `${crypto_root}` (if not present in the dedicated folder), and written to the location from which they were read.

In subsequent steps:
- Write the keys to the new location only (dedicated folders).
- Don't attempt to read from `${crypto_root}` anymore, use only the dedicated folders. 

See merge request dfinity-lab/public/ic!8207
pull Bot pushed a commit that referenced this pull request Mar 3, 2023
…aster'

perf: [EXC-1119] optimise Scheduler::execute_round by removing excessive canister state lookups

This MR removes an extra lookups for canister state and metric updates.

Optimisation #1. Canister metric update.

Before this MR in order to record the metric there is a loop that iterates over all the canister IDs, looks up their state in states and modifies the state. When the number of canisters is big then the lookup introduces a significant factor to an O(n) iteration. Eg. for a subnet with 100k total and 100 active canisters it might be ~10% of `execute_round` function time.

This MR moves the metric update to the already existing loop with a lookup in a previous step `apply_scheduling_strategy`.

Optimisation #2. Canister state update.

Both `canister_states` and `round_states` contain the elements in the same order, but when iterating over `round_states` it requires to do an expensive canister state lookup. The optimisation iterates over those two collections simultaneously (relying on the same elements order) which get the canister state for free.

On a testnet with 100k total and 100 active canisters this optimisation saves 4.8-5.2% of DSM critical path (scheduling step, no optimisation 7.5-8.2%, with optimisation 2.7-3%). 

See merge request dfinity-lab/public/ic!11052
pull Bot pushed a commit that referenced this pull request May 3, 2023
… 'master'

feat(crypto) CRP-1894: Zeroize old secret key store when writing new content

The way the SKS is currently updated is as follows:

1. On startup, the SKS is read from disk, and maintained in memory.
2. If changes are made to the SKS (new key generated, old key deleted), the changes are made in memory, and then written to disk. The writing to disk is performed as follows:
    1. Write the updated SKS to a new, temporary file.
    2. Atomically replace the existing SKS by moving/renaming the new SKS to the location of the existing SKS.

To zeroize the old SKS, the proposed approach when writing the new SKS to disk is as follows:

1. Create a hard link to the old SKS - same path and filename, but with “.old” suffix
2. Write the new SKS to disk using the temporary file and rename to replace the existing SKS as above.
3. Zeroize the old SKS file using the hard link created in step #1.
4. Remove the hard link created in step #1.

In case the node/process crashes while writing the new SKS (in practice, somewhere after step #1 but before step #4), some cleanup needs to be done:

- If the crash happened after #1 but before #2, the hard link with the “.old” suffix will point to the current SKS - in this case, simply remove the hard link to the SKS, but do not zeroize it.
- If the crash happened after #2, perform steps #3 and #4 from above (zeroize the old file and delete it).
 
The cleanup can be done when opening the SKS to read it. To determine which of the two cleanup actions should be done, check to see if a hard link with “.old” suffix exists, and if so, if it points to the same file (inode) as the current SKS - if yes, zeroize and delete the “.old” file; if no, simply delete the “.old” file.

One scenario where this zeroization introduces a new security exposure is in case we crash between steps #2 and #3 above, where the new keystore has been written, but there is still a hard link to the old keystore, and the old keystore has not been zeroized. 

See merge request dfinity-lab/public/ic!10724
pull Bot pushed a commit that referenced this pull request Jun 15, 2026
…tracts offline (dfinity#10459)

## Problem

`//rs/tests/cross_chain:ic_xc_cketh_test` and
`…:ic_xc_cketh_test_head_nns` are
flaky in data centers with unreliable IPv4 connectivity (e.g. `dm1`),
panicking
in `deploy_smart_contract`:

```
thread 'main' panicked at rs/tests/cross_chain/ic_xc_cketh_test.rs:
called `Result::unwrap()` on an `Err` value: block_on_bash_script: exit_status = 1. Output:
  Err: Error: error sending request for url (https://binaries.soliditylang.org/linux-amd64/list.json)
  - Error #1: tcp connect error: Network unreachable (os error 101)
```

## Root cause

The `foundry` container ships `forge`/`cast`/`anvil` but **no `solc`**.
When `forge create` compiles a helper contract, it downloads the
Solidity compiler from `binaries.soliditylang.org` at test runtime
(first the release index `list.json`, then the `solc` binary). That is
why the foundry UVM was created with `.enable_ipv4()`. Whenever the
UVM's IPv4 connectivity is unavailable, the download fails and the test
flakes.

This is a third, distinct source of flakiness from the two fixed in
dfinity#9209.

This is also
[preventing](https://github.com/dfinity/ic/pull/10253/changes#r3387217110.)
these tests to run on the local system-test backend which doesn't have
external network access.

## Fix

Vendor the required `solc` compilers as pinned, hash-verified Bazel
`http_file` dependencies, ship them in the ckETH UVM config image,
bind-mount them into the foundry container, and pass them to `forge
create --use <path>`. Compilation now happens fully offline and the
`.enable_ipv4()` dependency is removed.

- **MODULE.bazel**: add the `solc` and `solc_eth_deposit_helper`
`http_file` deps (sha256 taken from `list.json`). The compilers are
named by role rather than version, so a future compiler bump only
touches the `http_file` URL and sha256.
- **rs/tests/cross_chain/BUILD.bazel**: add both binaries to the
`cketh_uvm_config_image` srcmap (→ `/config/solc` and
`/config/solc_eth_deposit_helper`).
- **rs/tests/cross_chain/ic_xc_cketh_test.rs**: drop `.enable_ipv4()`;
copy the compilers to a writable path + `chmod +x` (vfat drops the exec
bit); pass the compiler matching each contract's `pragma` to `forge
create --use`.

This also removes a source of non-determinism: contracts declaring
`pragma solidity ^0.8.20` previously let `svm` pick the latest 0.8.x
available at runtime; they are now pinned to exactly 0.8.20.
`EthDepositHelper.sol` stays on 0.8.18 to remain faithful to the
[deployed mainnet helper
contract](https://etherscan.io/address/0x7574eB42cA208A4f6960ECCAfDF186D627dCC175),
so it gets its own `solc_eth_deposit_helper` compiler.

## Verification

Ran on `dm1` (the flaky environment) with caching disabled:

```
bazel test //rs/tests/cross_chain:ic_xc_cketh_test --cache_test_results=no
```

```
============== Summary for //rs/tests/cross_chain:ic_xc_cketh_test ==============
Task setup                            PASSED  in 118.22s
Task ic_xc_cketh_test                 PASSED  in 225.80s
Task assert_no_metrics_errors         PASSED  in   3.96s
Task assert_no_unallowed_log_patterns PASSED  in   0.85s
//rs/tests/cross_chain:ic_xc_cketh_test    PASSED in 353.9s
```

The foundry UVM came up without IPv4, `forge create --use` compiled and
deployed all four contracts from the vendored compilers, and every
ETH/ERC-20/subaccount deposit flow passed — no network fetch to
`binaries.soliditylang.org`.
pull Bot pushed a commit that referenced this pull request Jul 16, 2026
This PR implements regression tests for this
[PR](dfinity#10593).

  Unit tests (`rs/execution_environment/tests/canister_snapshots.rs`):
1. `upload_and_load_snapshot_with_wasm_memory` — Uploads a snapshot
declaring 2 MiB (32 pages) of wasm memory for a `(memory 1 1)` module,
loads it, and asserts inc fails gracefully (the
  1-page max can't grow to 32).
2. `upgrade_with_keep_heap_exceeds_module_max_fails_gracefully` —
Installs a 20-page module with orthogonal persistence, upgrades to
`(memory 1 1)` with `wasm_memory_persistence: Keep`,
and asserts the retained 20-page heap exceeding the new 1-page max fails
gracefully.
  
System test
(`rs/tests/execution/general_execution_tests/canister_snapshots.rs`):
3. `upload_and_load_snapshot_with_wasm_memory` — The end-to-end mirror
of unit test #1: same setup driven over the public API against an
application subnet (heap uploaded in 1 MiB
chunks), asserting inc fails gracefully rather than panicking the
replica.

All three exercise the same code path — the embedder returning `IC0521
("Failed to grow wasm memory … exceeds module's declared maximum")`
instead of the old `.expect("memory grow
  failed")` panic.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
pull Bot pushed a commit that referenced this pull request Aug 12, 2026
…y#11112)

## What

The second node provider reward reduction round (added in dfinity#10965 /
proposal 143260) was populated from the **July 27 smoke test alone**
rather than from the **June 13 + July 27 pair**, so it did not implement
the "failed two consecutive drills" rule established by motion 142724.

Two providers were affected:

| Provider | Jun 13 | Jul 27 | Was | Should be | Why |
|---|:--:|:--:|---|---|---|
| **MI Servers** (37 nodes) | ✅ in 24h | ❌ no reply | in round 2 |
**out** | Replied in time in June — never missed two in a row |
| **ParaFi Technologies NS LLC** (37 nodes) | ⚠️ late | ⚠️ late | absent
| **in** | Late in both, and a late reply counts as a failure |

Round 2 stays at 18 providers. **Round 1 is unchanged.**

## Why this is safe to edit rather than append

The table is append-only precisely because editing a past entry silently
rewrites days that have already been minted. That does not apply here:
round 2 starts 2026-08-01 and **no day of its window has been minted
yet** — the 2026-07-15..2026-08-15 reward period is still open. Nothing
already paid out is rewritten.

This is also why it is urgent. The next minting is due **on or just
after 2026-08-14 12:39 UTC** (governance mints every `ONE_YEAR_SECONDS /
12` = 30.4375 days; last mint was 2026-07-15 02:09 UTC per
`get_most_recent_monthly_node_provider_rewards`). After that, MI Servers
will have been paid at 50% for the first half of August and cannot be
made whole through this table, because multipliers are constrained to
`(0, 1)`.

## Duration for the 13 providers in both rounds

The 13 providers in both rounds are reduced continuously from 2026-07-15
to 2026-11-01, so 3.5 months rather than three. That is the intended
outcome, not an artefact of the overlap: they missed the May 20 + June
13 pair and then missed the June 13 + July 27 pair, and each pair of
consecutive misses starts a fresh three-month clock. Round 1's window is
therefore deliberately left as it is.

This settles the open question raised in dfinity#10965, which asked whether the
first round's `end` should instead be shortened so those providers get
three months in total. Under a restarting clock it should not, and
shortening it would in any case rewrite days that have already been
minted.

## Verification against the rule

Both rounds were re-derived from the drill results below, independently
of the code, and now match it exactly:

- **Round 1** = failed 20 May **and** 13 Jun → **19 providers** ✅
matches
- **Round 2** = failed 13 Jun **and** 27 Jul → **18 providers** ✅
matches

Before this change, round 2 was instead exactly the 27 Jul "no reply"
list.

## Full smoke test tracking table

All 79 providers that were in the population for at least one drill. A
**late (>24h) reply counts as a failure**, same as no reply.

✅ replied in 24h · ⚠️ late · ❌ no reply · – not in that drill's
population · ● in that reduction round

| Node provider | 20 May | 13 Jun | 27 Jul | R1 | R2 | Nodes |
|---|:--:|:--:|:--:|:--:|:--:|--:|
| 100 Count Holdings, LLC | ⚠️ | ⚠️ | ❌ | ● | ● | 28 |
| 43rd Big Idea Films | ❌ | ❌ | ❌ | ● | ● | 14 |
| 87m Neuron, LLC | ⚠️ | ❌ | ✅ | ● |  | 42 |
| ACCUSET SOLUTIONS | ✅ | ❌ | ❌ |  | ● | 10 |
| achermann.swiss | ✅ | ❌ | ✅ |  |  | 1 |
| Aitubi AG | ✅ | ✅ | ✅ |  |  | 1 |
| Allusion | ✅ | ✅ | ✅ |  |  | 37 |
| AlpineDC SA | ✅ | ⚠️ | ✅ |  |  | 1 |
| Anonstake | ✅ | ❌ | ❌ |  | ● | 16 |
| ANTHONY ISAAKIDIS | ✅ | ✅ | ✅ |  |  | 23 |
| ANYPOINT PTY LTD | ✅ | ❌ | ✅ |  |  | 10 |
| Arceau NP LLC | ❌ | ❌ | ❌ | ● | ● | 23 |
| Artem Horodyskyi | ✅ | ✅ | ✅ |  |  | 7 |
| Avalution AG | ✅ | ❌ | ✅ |  |  | 1 |
| Bianca-Martina Rohner | ✅ | ✅ | ✅ |  |  | 4 |
| Bigger Capital | ✅ | ✅ | ✅ |  |  | 28 |
| Bitmoon | ❌ | ❌ | ❌ | ● | ● | 3 |
| Blockchain Development Labs | ✅ | ✅ | ✅ |  |  | 42 |
| Blockchain Innovation Group | ✅ | ✅ | ✅ |  |  | 1 |
| BlockFinance | ✅ | ✅ | ✅ |  |  | 9 |
| BlockTech Ventures, LLC | ❌ | ❌ | ❌ | ● | ● | 28 |
| BLP22, LLC | ⚠️ | ❌ | ❌ | ● | ● | 14 |
| Blue Ant LLC | ❌ | ✅ | ⚠️ |  |  | 37 |
| Conic Ventures | ❌ | ❌ | ✅ | ● |  | 4 |
| CoreLedger | ✅ | ❌ | ✅ |  |  | 1 |
| Decentralized | ✅ | ❌ | ✅ |  |  | 1 |
| Decentralized Entities Foundation | ❌ | ❌ | ❌ | ● | ● | 17 |
| Extragone SA | ❌ | ❌ | ❌ | ● | ● | 37 |
| Fractal Labs AG | ✅ | ✅ | ✅ |  |  | 37 |
| Geeta Kalwani | ✅ | ✅ | ✅ |  |  | 4 |
| Geodd Pvt Ltd | ✅ | ✅ | ✅ |  |  | 6 |
| GeoNodes LLC | ✅ | ✅ | ✅ |  |  | 16 |
| George Bassadone | ✅ | ✅ | ✅ |  |  | 25 |
| Giant Leaf, LLC | ❌ | ✅ | ✅ |  |  | 37 |
| Honeycomb Capital (Pty) Ltd | ✅ | ✅ | ✅ |  |  | 12 |
| Iancu Aurel | ❌ | ❌ | ❌ | ● | ● | 28 |
| Icaria Systems Pty Ltd | ✅ | ✅ | ✅ |  |  | 18 |
| Illusions In Art (Pty) Ltd | ✅ | ✅ | ✅ |  |  | 6 |
| InfoObjects | ❌ | ❌ | ❌ | ● | ● | 4 |
| Ivanov Oleksandr | ✅ | ✅ | ✅ |  |  | 7 |
| Karel Frank | ✅ | ✅ | ✅ |  |  | 18 |
| Kontrapunt (Pty) Ltd | ✅ | ✅ | ✅ |  |  | 6 |
| Krishna Enterprises | ✅ | ⚠️ | ✅ |  |  | 15 |
| LTIN AG | ✅ | ✅ | ✅ |  |  | 1 |
| Lukas Helebrandt | ✅ | ✅ | ✅ |  |  | 6 |
| Maksym Ishchenko | ✅ | ✅ | ✅ |  |  | 7 |
| Mariano Stoll | ✅ | ✅ | ✅ |  |  | 4 |
| Marvelous Web3 | ✅ | ❌ | ✅ |  |  | 14 |
| MB Patrankos šūvis | ✅ | ✅ | ✅ |  |  | 10 |
| MI Servers **← removed** | ✅ | ✅ | ❌ |  |  | 37 |
| Neptune Partners | ❌ | ❌ | ❌ | ● | ● | 25 |
| NODAO | ✅ | ✅ | ✅ |  |  | 37 |
| NOKU SA | ✅ | ❌ | – |  |  | 1 |
| NoviSystems, LLC | ✅ | ✅ | ✅ |  |  | 3 |
| OneSixtyTwo Digital Capital | ✅ | ✅ | ✅ |  |  | 42 |
| Origin Game | ⚠️ | ✅ | ✅ |  |  | 7 |
| ParaFi Technologies NS LLC **← added** | ✅ | ⚠️ | ⚠️ |  | ● | 37 |
| Pindar Technology Limited | ❌ | ❌ | ✅ | ● |  | 36 |
| Power Meta Corporation | ❌ | ❌ | ✅ | ● |  | 5 |
| Privoxy Solutions, LLC | ✅ | ✅ | ✅ |  |  | 3 |
| Protocol16 | ✅ | ✅ | ✅ |  |  | 23 |
| Reist Telecom AG | ✅ | ❌ | ❌ |  | ● | 23 |
| Rivram Inc | ✅ | ⚠️ | ✅ |  |  | 13 |
| senseLAN | ✅ | ✅ | ✅ |  |  | 1 |
| SolNet | ✅ | ⚠️ | ✅ |  |  | 1 |
| Starbase | ✅ | ❌ | ❌ |  | ● | 38 |
| Swiss Datalink AG | ✅ | ❌ | ✅ |  |  | 1 |
| Sygnum Bank | ✅ | ✅ | ✅ |  |  | 37 |
| Tomahawk | ✅ | ✅ | – |  |  | — |
| Uvaca Labs LLC | ⚠️ | ✅ | ⚠️ |  |  | 23 |
| vestra ICT AG | ✅ | ❌ | ✅ |  |  | 1 |
| Virtual Hive Ltd | ✅ | ✅ | ✅ |  |  | 23 |
| Vladyslav Popov | ✅ | ✅ | ✅ |  |  | 14 |
| Wancloud limited | ⚠️ | ⚠️ | ✅ | ● |  | 10 |
| Web3game | ⚠️ | ✅ | ✅ |  |  | 17 |
| Wolkboer (Pty) Ltd | ✅ | ✅ | ✅ |  |  | 6 |
| Zarety LLC | ❌ | ❌ | ❌ | ● | ● | 37 |
| Zenith Code LLC | ❌ | ❌ | ✅ | ● |  | 2 |
| Zondax AG | ❌ | ❌ | ❌ | ● | ● | 2 |

**Drill participation:** #1 20 May 55/79 · #2 13 Jun 42/79 · #3 27 Jul
56/77.

Two providers left the population and are out of scope either way:
Tomahawk (left the network; replied in time in both drills it was part
of) and NOKU SA (no active nodes on 27 Jul).

## Testing

Adds `second_round_follows_the_two_consecutive_misses_rule`, which pins
both principals by name. The existing
`reward_reduction_round_membership_is_as_intended` only asserts round
sizes (19/18/13) — a one-for-one swap passes it unchanged, which is
exactly how the original error went unnoticed.

- `cargo check -p ic-node-rewards-canister --lib` — clean
- `cargo fmt --check` — clean
- clippy `--all-targets` with the repo's deny-set — clean
- `bazel build //rs/node_rewards/canister:{nrc,nrc-test}` — clean
- `bazel test` on all 5 affected targets — **5/5 pass**, 36/36 tests in
`nrc_test`

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: Bjoern Assmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant