Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 36f936a

Browse files
committed
Merge branch 'master' into jg/13643-contracts-migrate-to-fungible-traits
2 parents cb9217d + d584815 commit 36f936a

File tree

76 files changed

+1674
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1674
-788
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ variables:
4848
CARGO_INCREMENTAL: 0
4949
DOCKER_OS: "debian:bullseye"
5050
ARCH: "x86_64"
51-
CI_IMAGE: "paritytech/ci-linux:production"
51+
CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
5252
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.29"
5353
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
5454
RELENG_SCRIPTS_BRANCH: "master"
@@ -301,8 +301,12 @@ include:
301301
# completion, because the publishing jobs depends on them AS INTENDED: crates should not be
302302
# published before their source code is checked.
303303
- project: parity/infrastructure/ci_cd/shared
304-
ref: v0.2
304+
ref: main
305305
file: /common/timestamp.yml
306+
- project: parity/infrastructure/ci_cd/shared
307+
ref: main
308+
file: /common/ci-unified.yml
309+
306310

307311
#### stage: notify
308312

Cargo.lock

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node-template/node/src/service.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ pub(crate) type FullClient =
3737
type FullBackend = sc_service::TFullBackend<Block>;
3838
type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
3939

40+
/// The minimum period of blocks on which justifications will be
41+
/// imported and generated.
42+
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
43+
4044
#[allow(clippy::type_complexity)]
4145
pub fn new_partial(
4246
config: &Configuration,
@@ -97,6 +101,7 @@ pub fn new_partial(
97101

98102
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
99103
client.clone(),
104+
GRANDPA_JUSTIFICATION_PERIOD,
100105
&client,
101106
select_chain.clone(),
102107
telemetry.as_ref().map(|x| x.handle()),
@@ -290,7 +295,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
290295
let grandpa_config = sc_consensus_grandpa::Config {
291296
// FIXME #1578 make this available through chainspec
292297
gossip_duration: Duration::from_millis(333),
293-
justification_period: 512,
298+
justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD,
294299
name: Some(name),
295300
observer_enabled: false,
296301
keystore,

bin/node-template/runtime/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ impl pallet_grandpa::Config for Runtime {
214214

215215
type WeightInfo = ();
216216
type MaxAuthorities = ConstU32<32>;
217+
type MaxNominators = ConstU32<0>;
217218
type MaxSetIdSessionEntries = ConstU64<0>;
218219

219220
type KeyOwnerProof = sp_core::Void;

bin/node/cli/src/service.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ type FullGrandpaBlockImport =
5454
/// The transaction pool type defintion.
5555
pub type TransactionPool = sc_transaction_pool::FullPool<Block, FullClient>;
5656

57+
/// The minimum period of blocks on which justifications will be
58+
/// imported and generated.
59+
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512;
60+
5761
/// Fetch the nonce of the given `account` from the chain state.
5862
///
5963
/// Note: Should only be used for tests.
@@ -193,6 +197,7 @@ pub fn new_partial(
193197

194198
let (grandpa_block_import, grandpa_link) = grandpa::block_import(
195199
client.clone(),
200+
GRANDPA_JUSTIFICATION_PERIOD,
196201
&(client.clone() as Arc<_>),
197202
select_chain.clone(),
198203
telemetry.as_ref().map(|x| x.handle()),
@@ -236,6 +241,7 @@ pub fn new_partial(
236241
&config.data_path,
237242
Default::default(),
238243
client.clone(),
244+
keystore_container.local_keystore(),
239245
config.prometheus_registry(),
240246
&task_manager.spawn_handle(),
241247
)
@@ -524,7 +530,7 @@ pub fn new_full_base(
524530
let grandpa_config = grandpa::Config {
525531
// FIXME #1578 make this available through chainspec
526532
gossip_duration: std::time::Duration::from_millis(333),
527-
justification_period: 512,
533+
justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD,
528534
name: Some(name),
529535
observer_enabled: false,
530536
keystore,

bin/node/runtime/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ impl pallet_babe::Config for Runtime {
417417
type DisabledValidators = Session;
418418
type WeightInfo = ();
419419
type MaxAuthorities = MaxAuthorities;
420+
type MaxNominators = MaxNominatorRewardedPerValidator;
420421
type KeyOwnerProof =
421422
<Historical as KeyOwnerProofSystem<(KeyTypeId, pallet_babe::AuthorityId)>>::Proof;
422423
type EquivocationReportSystem =
@@ -1357,6 +1358,7 @@ impl pallet_grandpa::Config for Runtime {
13571358
type RuntimeEvent = RuntimeEvent;
13581359
type WeightInfo = ();
13591360
type MaxAuthorities = MaxAuthorities;
1361+
type MaxNominators = MaxNominatorRewardedPerValidator;
13601362
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
13611363
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
13621364
type EquivocationReportSystem =

client/cli/src/commands/run_cmd.rs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,11 @@ impl CliConfiguration for RunCmd {
394394
/// Check whether a node name is considered as valid.
395395
pub fn is_node_name_valid(_name: &str) -> std::result::Result<(), &str> {
396396
let name = _name.to_string();
397+
398+
if name.is_empty() {
399+
return Err("Node name cannot be empty")
400+
}
401+
397402
if name.chars().count() >= crate::NODE_NAME_MAX_LENGTH {
398403
return Err("Node name too long")
399404
}
@@ -404,7 +409,7 @@ pub fn is_node_name_valid(_name: &str) -> std::result::Result<(), &str> {
404409
return Err("Node name should not contain invalid chars such as '.' and '@'")
405410
}
406411

407-
let invalid_patterns = r"^https?:\/\/";
412+
let invalid_patterns = r"^https?:";
408413
let re = Regex::new(invalid_patterns).unwrap();
409414
if re.is_match(&name) {
410415
return Err("Node name should not contain urls")
@@ -498,15 +503,23 @@ mod tests {
498503

499504
#[test]
500505
fn tests_node_name_bad() {
506+
assert!(is_node_name_valid("").is_err());
501507
assert!(is_node_name_valid(
502508
"very very long names are really not very cool for the ui at all, really they're not"
503509
)
504510
.is_err());
505511
assert!(is_node_name_valid("Dots.not.Ok").is_err());
506-
assert!(is_node_name_valid("http://visit.me").is_err());
507-
assert!(is_node_name_valid("https://visit.me").is_err());
512+
// NOTE: the urls below don't include a domain otherwise
513+
// they'd get filtered for including a `.`
514+
assert!(is_node_name_valid("http://visitme").is_err());
515+
assert!(is_node_name_valid("http:/visitme").is_err());
516+
assert!(is_node_name_valid("http:visitme").is_err());
517+
assert!(is_node_name_valid("https://visitme").is_err());
518+
assert!(is_node_name_valid("https:/visitme").is_err());
519+
assert!(is_node_name_valid("https:visitme").is_err());
508520
assert!(is_node_name_valid("www.visit.me").is_err());
509521
assert!(is_node_name_valid("www.visit").is_err());
522+
assert!(is_node_name_valid("hello\\world").is_err());
510523
assert!(is_node_name_valid("visit.www").is_err());
511524
assert!(is_node_name_valid("email@domain").is_err());
512525
}

client/cli/src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ mod tests {
400400
},
401401
);
402402

403-
let Some(output) = output else { return } ;
403+
let Some(output) = output else { return };
404404

405405
let stderr = dbg!(String::from_utf8(output.stderr).unwrap());
406406

client/consensus/grandpa/src/communication/gossip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ mod tests {
17001700
fn config() -> crate::Config {
17011701
crate::Config {
17021702
gossip_duration: Duration::from_millis(10),
1703-
justification_period: 256,
1703+
justification_generation_period: 256,
17041704
keystore: None,
17051705
name: None,
17061706
local_role: Role::Authority,

client/consensus/grandpa/src/communication/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl Tester {
244244
fn config() -> crate::Config {
245245
crate::Config {
246246
gossip_duration: std::time::Duration::from_millis(10),
247-
justification_period: 256,
247+
justification_generation_period: 256,
248248
keystore: None,
249249
name: None,
250250
local_role: Role::Authority,

0 commit comments

Comments
 (0)