Skip to content

Commit

Permalink
Merge branch 'master' into polkadot-native-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong authored Sep 10, 2024
2 parents 5870827 + 1f1f20a commit 7ca2baf
Show file tree
Hide file tree
Showing 6 changed files with 971 additions and 861 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.CMD_BOT_APP_ID }}
private_key: ${{ secrets.CMD_BOT_APP_KEY }}

- name: Create backport pull requests
uses: korthout/backport-action@v3
id: backport
with:
target_branches: stable2407 stable2409
merge_commits: skip
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ steps.generate_token.outputs.token }}
pull_description: |
Backport #${pull_number} into `${target_branch}` (cc @${pull_author}).
Backport #${pull_number} into `${target_branch}` from ${pull_author}.
See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot.
<!--
# To be used by other automation, do not modify:
Expand All @@ -47,6 +56,7 @@ jobs:
{
"conflict_resolution": "draft_commit_conflicts"
}
copy_assignees: true

- name: Label Backports
if: ${{ steps.backport.outputs.created_pull_numbers != '' }}
Expand All @@ -64,3 +74,21 @@ jobs:
});
console.log(`Added A3-backport label to PR #${pullNumber}`);
}
- name: Request Review
if: ${{ steps.backport.outputs.created_pull_numbers != '' }}
uses: actions/github-script@v7
with:
script: |
const pullNumbers = '${{ steps.backport.outputs.created_pull_numbers }}'.split(' ');
const reviewer = '${{ github.event.pull_request.user.login }}';
for (const pullNumber of pullNumbers) {
await github.pulls.createReviewRequest({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: parseInt(pullNumber),
reviewers: [ reviewer ]
});
console.log(`Requested review from ${reviewer} for PR #${pullNumber}`);
}
11 changes: 11 additions & 0 deletions prdoc/pr_5469.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: Syncing strategy refactoring

doc:
- audience: Node Dev
description: |
Mostly internal changes to syncing strategies that is a step towards making them configurable/extensible in the
future. It is unlikely that external developers will need to change their code.

crates:
- name: sc-network-sync
bump: major
9 changes: 5 additions & 4 deletions substrate/client/network/sync/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::{
},
strategy::{
warp::{EncodedProof, WarpProofRequest, WarpSyncConfig},
StrategyKey, SyncingAction, SyncingConfig, SyncingStrategy,
PolkadotSyncingStrategy, StrategyKey, SyncingAction, SyncingConfig, SyncingStrategy,
},
types::{
BadPeer, ExtendedPeerInfo, OpaqueStateRequest, OpaqueStateResponse, PeerRequest, SyncEvent,
Expand Down Expand Up @@ -189,7 +189,7 @@ pub struct Peer<B: BlockT> {

pub struct SyncingEngine<B: BlockT, Client> {
/// Syncing strategy.
strategy: SyncingStrategy<B, Client>,
strategy: PolkadotSyncingStrategy<B, Client>,

/// Blockchain client.
client: Arc<Client>,
Expand Down Expand Up @@ -389,7 +389,8 @@ where
);

// Initialize syncing strategy.
let strategy = SyncingStrategy::new(syncing_config, client.clone(), warp_sync_config)?;
let strategy =
PolkadotSyncingStrategy::new(syncing_config, client.clone(), warp_sync_config)?;

let block_announce_protocol_name = block_announce_config.protocol_name().clone();
let (tx, service_rx) = tracing_unbounded("mpsc_chain_sync", 100_000);
Expand Down Expand Up @@ -697,7 +698,7 @@ where
number,
)
},
// Nothing to do, this is handled internally by `SyncingStrategy`.
// Nothing to do, this is handled internally by `PolkadotSyncingStrategy`.
SyncingAction::Finished => {},
}
}
Expand Down
Loading

0 comments on commit 7ca2baf

Please sign in to comment.