Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
02a1ecf3
Verified
Commit
02a1ecf3
authored
Sep 29, 2021
by
Andronik Ordian
Browse files
Revert "minor chore changes (#3944)"
This reverts commit
1d05f779
.
parent
c741b2b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
node/core/dispute-coordinator/src/real/mod.rs
View file @
02a1ecf3
...
...
@@ -522,7 +522,7 @@ async fn handle_incoming(
statements
,
pending_confirmation
,
}
=>
{
let
outcome
=
handle_import_statements
(
handle_import_statements
(
ctx
,
overlay_db
,
state
,
...
...
@@ -531,10 +531,10 @@ async fn handle_incoming(
session
,
statements
,
now
,
pending_confirmation
,
metrics
,
)
.await
?
;
pending_confirmation
.send
(
outcome
)
.map_err
(|
_
|
Error
::
OneshotSend
)
?
;
},
DisputeCoordinatorMessage
::
RecentDisputes
(
rx
)
=>
{
let
recent_disputes
=
overlay_db
.load_recent_disputes
()
?
.unwrap_or_default
();
...
...
@@ -633,10 +633,14 @@ async fn handle_import_statements(
now
:
Timestamp
,
pending_confirmation
:
oneshot
::
Sender
<
ImportStatementsResult
>
,
metrics
:
&
Metrics
,
)
->
Result
<
ImportStatementsResult
,
Error
>
{
)
->
Result
<
()
,
Error
>
{
if
state
.highest_session
.map_or
(
true
,
|
h
|
session
+
DISPUTE_WINDOW
<
h
)
{
// It is not valid to participate in an ancient dispute (spam?).
return
Ok
(
ImportStatementsResult
::
InvalidImport
)
pending_confirmation
.send
(
ImportStatementsResult
::
InvalidImport
)
.map_err
(|
_
|
Error
::
OneshotSend
)
?
;
return
Ok
(())
}
let
validators
=
match
state
.rolling_session_window
.session_info
(
session
)
{
...
...
@@ -647,7 +651,11 @@ async fn handle_import_statements(
"Missing info for session which has an active dispute"
,
);
return
Ok
(
ImportStatementsResult
::
InvalidImport
)
pending_confirmation
.send
(
ImportStatementsResult
::
InvalidImport
)
.map_err
(|
_
|
Error
::
OneshotSend
)
?
;
return
Ok
(())
},
Some
(
info
)
=>
info
.validators
.clone
(),
};
...
...
@@ -772,12 +780,15 @@ async fn handle_import_statements(
//
// We expect that if the candidate is truly disputed that the higher-level network
// code will retry.
pending_confirmation
.send
(
ImportStatementsResult
::
InvalidImport
)
.map_err
(|
_
|
Error
::
OneshotSend
)
?
;
tracing
::
debug!
(
target
:
LOG_TARGET
,
"Recovering availability failed - invalid import."
);
return
Ok
(
ImportStatementsResult
::
InvalidImport
)
return
Ok
(
()
)
}
metrics
.on_open
();
...
...
@@ -795,7 +806,11 @@ async fn handle_import_statements(
overlay_db
.write_candidate_votes
(
session
,
candidate_hash
,
votes
.into
());
Ok
(
ImportStatementsResult
::
ValidImport
)
pending_confirmation
.send
(
ImportStatementsResult
::
ValidImport
)
.map_err
(|
_
|
Error
::
OneshotSend
)
?
;
Ok
(())
}
fn
find_controlled_validator_indices
(
...
...
@@ -902,7 +917,8 @@ async fn issue_local_statement(
// Do import
if
!
statements
.is_empty
()
{
match
handle_import_statements
(
let
(
pending_confirmation
,
rx
)
=
oneshot
::
channel
();
handle_import_statements
(
ctx
,
overlay_db
,
state
,
...
...
@@ -911,10 +927,11 @@ async fn issue_local_statement(
session
,
statements
,
now
,
pending_confirmation
,
metrics
,
)
.await
?
{
.await
?
;
match
rx
.await
{
Err
(
_
)
=>
{
tracing
::
error!
(
target
:
LOG_TARGET
,
...
...
parachain/test-parachains/adder/collator/README.md
View file @
02a1ecf3
# How to run this collator
First start two validators that will run for the relay chain:
```
sh
cargo run
--release
--
-d
alice
--chain
rococo-local
--validator
--alice
--port
50551
cargo run
--release
--
-d
bob
--chain
rococo-local
--validator
--bob
--port
50552
```
Next start the collator that will collate for the adder parachain:
```
sh
cargo run
--release
-p
test-parachain-adder-collator
--
--tmp
--chain
rococo-local
--port
50553
```
...
...
Andronik Ordian
@ordian
mentioned in commit
edf995b7
·
Sep 29, 2021
mentioned in commit
edf995b7
mentioned in commit edf995b7445de483007401edf606b4a7cbd81b71
Toggle commit list
Andronik Ordian
@ordian
mentioned in commit
dcaa880c
·
Sep 29, 2021
mentioned in commit
dcaa880c
mentioned in commit dcaa880cd0bbe50c2c2d58c6fc363db0a19acbb9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment