Skip to content

Commit

Permalink
fix issues with packages
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco committed Jan 30, 2023
1 parent 425f62a commit 7bf7446
Show file tree
Hide file tree
Showing 48 changed files with 159 additions and 109 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/burnin-label-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Notify devops when burn-in label applied
on:
pull_request:
types: [labeled]

jobs:
notify-devops:
runs-on: ubuntu-latest
steps:
- name: Notify devops
if: github.event.label.name == 'A1-needsburnin'
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ROOM_ID }}
access_token: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ACCESS_TOKEN }}
message: "@room Burn-in request received for [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
server: "matrix.parity.io"
7 changes: 7 additions & 0 deletions .github/workflows/mlc_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^https://crates.io",
}
]
}
18 changes: 18 additions & 0 deletions .github/workflows/release-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Pushes release updates to a pre-defined Matrix room
on:
release:
types:
- edited
- prereleased
- published
jobs:
ping_matrix:
runs-on: ubuntu-latest
steps:
- name: send message
uses: s3krit/matrix-message-action@v0.0.3
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "**${{github.event.repository.full_name}}:** A release has been ${{github.event.action}}<br/>Release version [${{github.event.release.tag_name}}](${{github.event.release.html_url}})<br/><br/>***Description:***<br/>${{github.event.release.body}}<br/>"
server: "matrix.parity.io"
20 changes: 20 additions & 0 deletions .github/workflows/trigger-review-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Trigger pipeline for review

on:
pull_request:
types: [ready_for_review]

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger pipeline
run: |
curl -X POST \
-F token="$TOKEN" \
-F ref="$REF" \
https://gitlab.parity.io/api/v4/projects/145/trigger/pipeline
env:
REF: ${{ github.event.number }}
TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ use impls::{AllianceProposalProvider, Author, CreditToBlockAuthor};
pub mod constants;
use constants::{currency::*, time::*};
use sp_runtime::generic::Era;

/// Generated voter bag information.
mod voter_bags;

Expand Down Expand Up @@ -1773,7 +1774,7 @@ type Migrations = (
pallet_contracts::Migration<Runtime>,
);

/// MMR helper types
/// MMR helper types.
mod mmr {
use super::Runtime;
pub use pallet_mmr::primitives::*;
Expand Down
2 changes: 1 addition & 1 deletion client/basic-authorship-ver/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ where
/// ```
fn propose(
self,
mut inherent_data: InherentData,
inherent_data: InherentData,
inherent_digests: Digest,
max_duration: time::Duration,
block_size_limit: Option<usize>,
Expand Down
1 change: 0 additions & 1 deletion client/basic-authorship/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
aquamarine = "0.1.12"
codec = { package = "parity-scale-codec", version = "3.0.0" }
futures = "0.3.21"
futures-timer = "3.0.1"
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = "0.4"
parking_lot = "0.12.1"
thiserror = "1.0"
wasm-timer = "0.2.5"
sp-beefy = { version = "4.0.0-dev", path = "../../primitives/beefy" }
beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy", package = "sp-beefy" }
prometheus = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
sc-chain-spec = { version = "4.0.0-dev", path = "../../client/chain-spec" }
sc-client-api = { version = "4.0.0-dev", path = "../api" }
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ parking_lot = "0.12.1"
serde = { version = "1.0.136", features = ["derive"] }
thiserror = "1.0"
beefy-gadget = { version = "4.0.0-dev", path = "../." }
sp-beefy = { version = "4.0.0-dev", path = "../../../primitives/beefy"}
beefy-primitives = { version = "4.0.0-dev", path = "../../../primitives/beefy", package = "sp-beefy" }
sc-rpc = { version = "4.0.0-dev", path = "../../rpc" }
sc-utils = { version = "4.0.0-dev", path = "../../utils" }
sp-core = { version = "7.0.0", path = "../../../primitives/core" }
Expand Down
8 changes: 6 additions & 2 deletions client/beefy/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ mod tests {
communication::notification::BeefyVersionedFinalityProofSender,
justification::BeefyVersionedFinalityProof,
};
use beefy_primitives::{known_payloads, Payload, SignedCommitment};
use codec::{Decode, Encode};
use jsonrpsee::{types::EmptyServerParams as EmptyParams, RpcModule};
use sp_beefy::{known_payloads, Payload, SignedCommitment};
use sp_runtime::traits::{BlakeTwo256, Hash};
use substrate_test_runtime_client::runtime::Block;

Expand Down Expand Up @@ -269,7 +269,11 @@ mod tests {
let payload =
Payload::from_single_entry(known_payloads::MMR_ROOT_ID, "Hello World!".encode());
BeefyVersionedFinalityProof::<Block>::V1(SignedCommitment {
commitment: sp_beefy::Commitment { payload, block_number: 5, validator_set_id: 0 },
commitment: beefy_primitives::Commitment {
payload,
block_number: 5,
validator_set_id: 0,
},
signatures: vec![],
})
}
Expand Down
2 changes: 1 addition & 1 deletion client/beefy/rpc/src/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sp_runtime::traits::Block as BlockT;

/// An encoded finality proof proving that the given header has been finalized.
/// The given bytes should be the SCALE-encoded representation of a
/// `sp_beefy::VersionedFinalityProof`.
/// `beefy_primitives::VersionedFinalityProof`.
#[derive(Clone, Serialize, Deserialize)]
pub struct EncodedVersionedFinalityProof(sp_core::Bytes);

Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/communication/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use parking_lot::{Mutex, RwLock};
use wasm_timer::Instant;

use crate::{communication::peers::KnownPeers, keystore::BeefyKeystore};
use sp_beefy::{
use beefy_primitives::{
crypto::{Public, Signature},
VoteMessage,
};
Expand Down Expand Up @@ -240,7 +240,7 @@ mod tests {
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};

use crate::keystore::{tests::Keyring, BeefyKeystore};
use sp_beefy::{
use beefy_primitives::{
crypto::Signature, known_payloads, Commitment, MmrRootHash, Payload, VoteMessage, KEY_TYPE,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

//! Helper for handling (i.e. answering) BEEFY justifications requests from a remote peer.
use beefy_primitives::BEEFY_ENGINE_ID;
use codec::Decode;
use futures::{
channel::{mpsc, oneshot},
Expand All @@ -25,7 +26,6 @@ use log::{debug, trace};
use sc_client_api::BlockBackend;
use sc_network::{config as netconfig, config::RequestResponseConfig, PeerId, ReputationChange};
use sc_network_common::protocol::ProtocolName;
use sp_beefy::BEEFY_ENGINE_ID;
use sp_runtime::traits::Block;
use std::{marker::PhantomData, sync::Arc};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

//! Generating request logic for request/response protocol for syncing BEEFY justifications.
use beefy_primitives::{crypto::AuthorityId, ValidatorSet};
use codec::Encode;
use futures::channel::{oneshot, oneshot::Canceled};
use log::{debug, warn};
Expand All @@ -27,7 +28,6 @@ use sc_network_common::{
request_responses::{IfDisconnected, RequestFailure},
service::NetworkRequest,
};
use sp_beefy::{crypto::AuthorityId, ValidatorSet};
use sp_runtime::traits::{Block, NumberFor};
use std::{collections::VecDeque, result::Result, sync::Arc};

Expand Down
2 changes: 1 addition & 1 deletion client/beefy/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use beefy_primitives::{BeefyApi, BEEFY_ENGINE_ID};
use log::debug;
use sp_beefy::{BeefyApi, BEEFY_ENGINE_ID};
use std::{collections::HashMap, sync::Arc};

use sp_api::{ProvideRuntimeApi, TransactionFor};
Expand Down
10 changes: 6 additions & 4 deletions client/beefy/src/justification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use crate::keystore::BeefyKeystore;
use codec::{Decode, Encode};
use sp_beefy::{
use beefy_primitives::{
crypto::{AuthorityId, Signature},
ValidatorSet, VersionedFinalityProof,
};
use codec::{Decode, Encode};
use sp_consensus::Error as ConsensusError;
use sp_runtime::traits::{Block as BlockT, NumberFor};

/// A finality proof with matching BEEFY authorities' signatures.
pub type BeefyVersionedFinalityProof<Block> =
sp_beefy::VersionedFinalityProof<NumberFor<Block>, Signature>;
beefy_primitives::VersionedFinalityProof<NumberFor<Block>, Signature>;

/// Decode and verify a Beefy FinalityProof.
pub(crate) fn decode_and_verify_finality_proof<Block: BlockT>(
Expand Down Expand Up @@ -80,7 +80,9 @@ fn verify_with_validator_set<Block: BlockT>(

#[cfg(test)]
pub(crate) mod tests {
use sp_beefy::{known_payloads, Commitment, Payload, SignedCommitment, VersionedFinalityProof};
use beefy_primitives::{
known_payloads, Commitment, Payload, SignedCommitment, VersionedFinalityProof,
};
use substrate_test_runtime_client::runtime::Block;

use super::*;
Expand Down
4 changes: 2 additions & 2 deletions client/beefy/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use sp_runtime::traits::Keccak256;

use log::warn;

use sp_beefy::{
use beefy_primitives::{
crypto::{Public, Signature},
BeefyVerify, KEY_TYPE,
};
Expand Down Expand Up @@ -117,7 +117,7 @@ pub mod tests {
use sp_core::{ecdsa, keccak_256, Pair};
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};

use sp_beefy::{crypto, KEY_TYPE};
use beefy_primitives::{crypto, KEY_TYPE};

use super::BeefyKeystore;
use crate::error::Error;
Expand Down
8 changes: 4 additions & 4 deletions client/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ use crate::{
round::Rounds,
worker::PersistedState,
};
use beefy_primitives::{
crypto::AuthorityId, BeefyApi, MmrRootHash, PayloadProvider, ValidatorSet, BEEFY_ENGINE_ID,
GENESIS_AUTHORITY_SET_ID,
};
use futures::{stream::Fuse, StreamExt};
use log::{debug, error, info};
use parking_lot::Mutex;
Expand All @@ -41,10 +45,6 @@ use sc_network::ProtocolName;
use sc_network_common::service::NetworkRequest;
use sc_network_gossip::{GossipEngine, Network as GossipNetwork};
use sp_api::{HeaderT, NumberFor, ProvideRuntimeApi};
use sp_beefy::{
crypto::AuthorityId, BeefyApi, MmrRootHash, PayloadProvider, ValidatorSet, BEEFY_ENGINE_ID,
GENESIS_AUTHORITY_SET_ID,
};
use sp_blockchain::{
Backend as BlockchainBackend, Error as ClientError, HeaderBackend, Result as ClientResult,
};
Expand Down
8 changes: 4 additions & 4 deletions client/beefy/src/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use codec::{Decode, Encode};
use log::{debug, trace};
use sp_beefy::{
use beefy_primitives::{
crypto::{Public, Signature},
ValidatorSet, ValidatorSetId,
};
use codec::{Decode, Encode};
use log::{debug, trace};
use sp_runtime::traits::{Block, NumberFor};
use std::{collections::BTreeMap, hash::Hash};

Expand Down Expand Up @@ -174,7 +174,7 @@ mod tests {
use sc_network_test::Block;
use sp_core::H256;

use sp_beefy::{crypto::Public, ValidatorSet};
use beefy_primitives::{crypto::Public, ValidatorSet};

use super::{threshold, Block as BlockT, Hash, RoundTracker, Rounds};
use crate::keystore::tests::Keyring;
Expand Down
16 changes: 8 additions & 8 deletions client/beefy/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ use crate::{
load_or_init_voter_state, wait_for_runtime_pallet, BeefyRPCLinks, BeefyVoterLinks, KnownPeers,
PersistedState,
};
use beefy_primitives::{
crypto::{AuthorityId, Signature},
known_payloads,
mmr::MmrRootProvider,
BeefyApi, Commitment, ConsensusLog, MmrRootHash, Payload, SignedCommitment, ValidatorSet,
VersionedFinalityProof, BEEFY_ENGINE_ID, KEY_TYPE as BeefyKeyType,
};
use futures::{future, stream::FuturesUnordered, Future, StreamExt};
use parking_lot::Mutex;
use sc_client_api::{Backend as BackendT, BlockchainEvents, FinalityNotifications, HeaderBackend};
Expand All @@ -45,13 +52,6 @@ use sc_network_test::{
use sc_utils::notification::NotificationReceiver;
use serde::{Deserialize, Serialize};
use sp_api::{ApiRef, ProvideRuntimeApi};
use sp_beefy::{
crypto::{AuthorityId, Signature},
known_payloads,
mmr::MmrRootProvider,
BeefyApi, Commitment, ConsensusLog, MmrRootHash, Payload, SignedCommitment, ValidatorSet,
VersionedFinalityProof, BEEFY_ENGINE_ID, KEY_TYPE as BeefyKeyType,
};
use sp_consensus::BlockOrigin;
use sp_core::H256;
use sp_keystore::{testing::KeyStore as TestKeystore, SyncCryptoStore, SyncCryptoStorePtr};
Expand Down Expand Up @@ -475,7 +475,7 @@ fn wait_for_beefy_signed_commitments(
let expected = expected.next();
async move {
let signed_commitment = match versioned_finality_proof {
sp_beefy::VersionedFinalityProof::V1(sc) => sc,
beefy_primitives::VersionedFinalityProof::V1(sc) => sc,
};
let commitment_block_num = signed_commitment.commitment.block_number;
assert_eq!(expected, Some(commitment_block_num).as_ref());
Expand Down
12 changes: 6 additions & 6 deletions client/beefy/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ use crate::{
round::Rounds,
BeefyVoterLinks,
};
use beefy_primitives::{
crypto::{AuthorityId, Signature},
Commitment, ConsensusLog, Payload, PayloadProvider, SignedCommitment, ValidatorSet,
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
};
use codec::{Codec, Decode, Encode};
use futures::{stream::Fuse, FutureExt, StreamExt};
use log::{debug, error, info, log_enabled, trace, warn};
Expand All @@ -38,11 +43,6 @@ use sc_network_gossip::GossipEngine;
use sc_utils::notification::NotificationReceiver;
use sp_api::BlockId;
use sp_arithmetic::traits::{AtLeast32Bit, Saturating};
use sp_beefy::{
crypto::{AuthorityId, Signature},
Commitment, ConsensusLog, Payload, PayloadProvider, SignedCommitment, ValidatorSet,
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
};
use sp_consensus::SyncOracle;
use sp_runtime::{
generic::OpaqueDigestItemId,
Expand Down Expand Up @@ -970,13 +970,13 @@ pub(crate) mod tests {
},
BeefyRPCLinks, KnownPeers,
};
use beefy_primitives::{known_payloads, mmr::MmrRootProvider};
use futures::{future::poll_fn, task::Poll};
use parking_lot::Mutex;
use sc_client_api::{Backend as BackendT, HeaderBackend};
use sc_network::NetworkService;
use sc_network_test::TestNetFactory;
use sp_api::HeaderT;
use sp_beefy::{known_payloads, mmr::MmrRootProvider};
use sp_blockchain::Backend as BlockchainBackendT;
use sp_runtime::traits::{One, Zero};
use substrate_test_runtime_client::{
Expand Down
Loading

0 comments on commit 7bf7446

Please sign in to comment.