Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(IDX): sync from gitlab #200

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7272d79
chore(sns): Remove useless `restore_dapp_controllers` function [overr…
anchpop Jun 7, 2024
86bf40c
Merge branch '@anchpop/remove-useless-function' into 'master'
anchpop Jun 7, 2024
d78df25
fix: [EXC-1643] count sign_with_schnorr contexts per key
maksymar Jun 7, 2024
0667b4f
Merge branch 'maksym/ic-1687-queue' into 'master'
maksymar Jun 7, 2024
fcbf596
chore(CON-1257): Remove unused ecdsa code
Sawchord Jun 7, 2024
a28a0e6
Merge branch 'leon/remove_unued_code_ecdsa' into 'master'
Sawchord Jun 7, 2024
4c07797
chore(github-sync): PR#197 / chore(IDX): pigz: 2.7 -> 2.8
Jun 7, 2024
eabfe18
Merge branch 'mirroring-basvandijk/upgrade-pigz-2.8-2nd-attempt' into…
marko-k0 Jun 7, 2024
dca67c1
chore(github-sync): PR#198 / feat(CI): PR title cov workflow
Jun 7, 2024
a886918
Merge branch 'mirroring-marko-conv-commit-action' into 'master'
marko-k0 Jun 7, 2024
c0c9a04
feat(schnorr): CON-1262 EXC-1598 Match tSchnorr pre-signatures with r…
eichhorl Jun 7, 2024
0bd73f6
Merge branch 'eichhorl/matching-test-2' into 'master'
eichhorl Jun 7, 2024
3f98735
chore(crypto): CRP-2504 Reject non-canonical Ed25519 point encodings …
randombit Jun 7, 2024
dcd0789
Merge branch 'jack/crp-2504' into 'master'
randombit Jun 7, 2024
c42da8c
test(consensus): [CON-1298] Create integration test for subnet with s…
dist1ll Jun 7, 2024
10397eb
Merge branch 'alic/CON-1298-3' into 'master'
dist1ll Jun 7, 2024
fa60cfe
feat(schnorr): CON-1262 Switch signer to new generalized signature re…
eichhorl Jun 7, 2024
e2849a8
Merge branch 'eichhorl/use-new-contexts' into 'master'
eichhorl Jun 7, 2024
51940c0
fix: Fix `Request` and `Payload` debug formatting
alin-at-dfinity Jun 8, 2024
7fbb84a
Merge branch 'alin/fix-Request-and-Response-debug-formatting' into 'm…
alin-at-dfinity Jun 8, 2024
1c22713
chore(IDX): sync from gitlab
marko-k0 Jun 10, 2024
c605588
trigger
marko-k0 Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows-source/ci-pr-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,6 @@ jobs:
if: steps.filter.outputs.lock-generate == 'false'
run: echo "No changes in lock-generate, skipping run"

commit-lint:
name: Commit Lint
<<: *default-setup
steps:
- <<: *before-script
- <<: *checkout
- name: Commit Lint
id: commit-lint
run: ./gitlab-ci/src/ci-scripts/commit-lint.sh

pre-commit:
name: Pre Commit Test
<<: *dind-small-setup
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/ci-pr-only-cov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI PR Only COV

on:
pull_request:
types:
- ready_for_review
- edited

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
validate-pr-title:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/PRConventionalCommits@8d258b54939f6769fcd935a52b96d6b0383a00c5
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
23 changes: 0 additions & 23 deletions .github/workflows/ci-pr-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,29 +98,6 @@ jobs:
- name: No run
if: steps.filter.outputs.lock-generate == 'false'
run: echo "No changes in lock-generate, skipping run"
commit-lint:
name: Commit Lint
runs-on:
labels: default-runner
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
timeout-minutes: 30
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
id: before-script
shell: bash
run: |
git config --global http.postBuffer 524288000
git config --global safe.directory '*'
if [ -e /__w/cache ]; then sudo ln -s /__w/cache /; fi
if [ -n "${NODE_NAME:-}" ]; then echo "Node: $NODE_NAME"; fi
- name: Checkout
uses: actions/checkout@v4
- name: Commit Lint
id: commit-lint
run: ./gitlab-ci/src/ci-scripts/commit-lint.sh
pre-commit:
name: Pre Commit Test
runs-on:
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/gitlab-sync-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
name: GitLab Sync Branches

on:
schedule:
- cron: '0 */3 * * *'
push:
branches:
- master
workflow_dispatch:

jobs:
Expand All @@ -24,8 +25,25 @@ jobs:
# Normally this would fail, as branch protection rules only allow merging via a PR
# But we gave sa-github-api a custom role that allows bypassing branch rules and use its PAT for this job
- name: Update mirroring branch
shell: bash
run: |
git fetch origin master mirroring
git checkout -B mirroring
git rebase --onto origin/master origin/mirroring
git push origin mirroring --force-with-lease
set -eu
# fetch the list of workflows running on the 'mirroring' branch
RESPONSE=$(curl -s -H "Authorization: token $TOKEN" \
"https://api.github.com/repos/${REPO}/actions/runs?branch=mirroring&status=in_progress")
# extract workflow runs and check if any head_branch starts with "gh-readonly-queue/"
COUNT=$(echo "$RESPONSE" | jq '[.workflow_runs[] | select(.head_branch | startswith("gh-readonly-queue/"))] | length')
echo "Number of workflows in merge queue: $COUNT"

if [ "$COUNT" -eq 0 ]; then
git fetch origin master mirroring
git checkout -B mirroring
git rebase --onto origin/master origin/mirroring
git push origin mirroring --force-with-lease
else
echo "Workflows in merge queue detected. Skipping sync to 'mirroring' branch!"
fi
env:
REPO: ${{ github.repository }}
TOKEN: ${{ secrets.IDX_PUSH_TO_PR }}

6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ cc_binary(
deps = [":zopfli"],
visibility = ["//visibility:public"],
)""",
sha256 = "d4396b58bc2875daf8dc3ae9a657be945c2c2697944894fea8a72634eded93ab",
strip_prefix = "pigz-2.7",
url = "https://github.com/madler/pigz/archive/refs/tags/v2.7.zip",
sha256 = "688fe1d805b33a4ae8cbf86ba56aa1a5d647e959219c7d3aeb7d041c228af1ef",
strip_prefix = "pigz-2.8",
url = "https://github.com/madler/pigz/archive/refs/tags/v2.8.zip",
)

http_archive(
Expand Down
14 changes: 7 additions & 7 deletions rs/consensus/src/consensus/catchup_package_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ impl CatchUpPackageMaker {
mod tests {
//! CatchUpPackageMaker unit tests
use crate::ecdsa::test_utils::{
add_available_quadruple_to_payload, empty_ecdsa_payload, fake_ecdsa_key_id,
fake_sign_with_ecdsa_context_with_quadruple, fake_state_with_ecdsa_contexts,
add_available_quadruple_to_payload, empty_ecdsa_payload, fake_ecdsa_master_public_key_id,
fake_signature_request_context_with_pre_sig, fake_state_with_signature_requests,
};

use super::*;
Expand Down Expand Up @@ -394,23 +394,23 @@ mod tests {
.expect_get_state_hash_at()
.return_const(Ok(CryptoHashOfState::from(CryptoHash(vec![1, 2, 3]))));

let key_id = fake_ecdsa_key_id();
let key_id = fake_ecdsa_master_public_key_id();

// Create three quadruple Ids and contexts, quadruple "2" will remain unmatched.
let pre_sig_id1 = PreSigId(1);
let pre_sig_id2 = PreSigId(2);
let pre_sig_id3 = PreSigId(3);

let contexts = vec![
fake_sign_with_ecdsa_context_with_quadruple(1, key_id.clone(), Some(pre_sig_id1)),
fake_sign_with_ecdsa_context_with_quadruple(2, key_id.clone(), None),
fake_sign_with_ecdsa_context_with_quadruple(3, key_id.clone(), Some(pre_sig_id3)),
fake_signature_request_context_with_pre_sig(1, key_id.clone(), Some(pre_sig_id1)),
fake_signature_request_context_with_pre_sig(2, key_id.clone(), None),
fake_signature_request_context_with_pre_sig(3, key_id.clone(), Some(pre_sig_id3)),
];

state_manager
.get_mut()
.expect_get_state_at()
.return_const(Ok(fake_state_with_ecdsa_contexts(
.return_const(Ok(fake_state_with_signature_requests(
Height::from(0),
contexts.clone(),
)
Expand Down
14 changes: 7 additions & 7 deletions rs/consensus/src/consensus/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1654,8 +1654,8 @@ impl Validator {
#[cfg(test)]
pub mod test {
use crate::ecdsa::test_utils::{
add_available_quadruple_to_payload, empty_ecdsa_payload, fake_ecdsa_key_id,
fake_sign_with_ecdsa_context_with_quadruple, fake_state_with_ecdsa_contexts,
add_available_quadruple_to_payload, empty_ecdsa_payload, fake_ecdsa_master_public_key_id,
fake_signature_request_context_with_pre_sig, fake_state_with_signature_requests,
};

use super::*;
Expand Down Expand Up @@ -1900,22 +1900,22 @@ pub mod test {
.expect_get_state_hash_at()
.return_const(Ok(state_hash.clone()));

let key_id = fake_ecdsa_key_id();
let key_id = fake_ecdsa_master_public_key_id();
// Create three quadruple Ids and contexts, quadruple "2" will remain unmatched.
let pre_sig_id1 = PreSigId(1);
let pre_sig_id2 = PreSigId(2);
let pre_sig_id3 = PreSigId(3);

let contexts = vec![
fake_sign_with_ecdsa_context_with_quadruple(1, key_id.clone(), Some(pre_sig_id1)),
fake_sign_with_ecdsa_context_with_quadruple(2, key_id.clone(), None),
fake_sign_with_ecdsa_context_with_quadruple(3, key_id.clone(), Some(pre_sig_id3)),
fake_signature_request_context_with_pre_sig(1, key_id.clone(), Some(pre_sig_id1)),
fake_signature_request_context_with_pre_sig(2, key_id.clone(), None),
fake_signature_request_context_with_pre_sig(3, key_id.clone(), Some(pre_sig_id3)),
];

state_manager
.get_mut()
.expect_get_state_at()
.return_const(Ok(fake_state_with_ecdsa_contexts(
.return_const(Ok(fake_state_with_signature_requests(
Height::from(0),
contexts.clone(),
)
Expand Down
23 changes: 10 additions & 13 deletions rs/consensus/src/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl EcdsaPriorityFnArgs {
.map_or(Default::default(), |snapshot| {
let request_contexts = snapshot
.get_state()
.sign_with_ecdsa_contexts()
.signature_request_contexts()
.values()
.flat_map(get_context_request_id)
.collect::<BTreeSet<_>>();
Expand Down Expand Up @@ -594,30 +594,30 @@ fn compute_priority(
#[cfg(test)]
mod tests {
use self::test_utils::{
fake_completed_sign_with_ecdsa_context, fake_sign_with_ecdsa_context_with_quadruple,
fake_state_with_ecdsa_contexts, TestEcdsaBlockReader,
fake_completed_signature_request_context, fake_signature_request_context_with_pre_sig,
fake_state_with_signature_requests, TestEcdsaBlockReader,
};

use super::test_utils::fake_ecdsa_key_id;
use super::*;
use ic_management_canister_types::MasterPublicKeyId;
use ic_test_utilities::state_manager::RefMockStateManager;
use ic_types::consensus::idkg::{EcdsaUIDGenerator, PreSigId};
use ic_types::crypto::canister_threshold_sig::idkg::IDkgTranscriptId;
use ic_types::{consensus::idkg::RequestId, PrincipalId, SubnetId};
use test_utils::fake_ecdsa_master_public_key_id;
use tests::test_utils::create_sig_inputs;

#[test]
fn test_ecdsa_priority_fn_args() {
let state_manager = Arc::new(RefMockStateManager::default());
let height = Height::from(100);
let key_id = fake_ecdsa_key_id();
let key_id = fake_ecdsa_master_public_key_id();
// Add two contexts to state, one with, and one without quadruple
let pre_sig_id = PreSigId(0);
let context_with_quadruple = fake_completed_sign_with_ecdsa_context(0, pre_sig_id);
let context_with_quadruple =
fake_completed_signature_request_context(0, key_id.clone(), pre_sig_id);
let context_without_quadruple =
fake_sign_with_ecdsa_context_with_quadruple(1, key_id.clone(), None);
let snapshot = fake_state_with_ecdsa_contexts(
fake_signature_request_context_with_pre_sig(1, key_id.clone(), None);
let snapshot = fake_state_with_signature_requests(
height,
[
context_with_quadruple.clone(),
Expand All @@ -635,10 +635,7 @@ mod tests {

let block_reader = TestEcdsaBlockReader::for_signer_test(
height,
vec![(
expected_request_id.clone(),
create_sig_inputs(0, &MasterPublicKeyId::Ecdsa(key_id.clone())),
)],
vec![(expected_request_id.clone(), create_sig_inputs(0, &key_id))],
);

// Only the context with matched quadruple should be in "requested"
Expand Down
Loading
Loading