Disputes which are unknown for the Runtime are sent with priority by the Provisioner when preparing inherent data (#5336)

* Implement MallocSizeOf for DisputeState

* Implementation of `Disputes` Runtime API message

* Modify on-chain dispute import

* Add feature flag for the new functionality

* Update node/core/provisioner/src/onchain_disputes.rs

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>

* Add target to log messages

* Update node/core/provisioner/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Use `staging-client` feature to enable the client code using the staging runtime api

* Remove TODO comment

* Don't filter out DisputeState

* Fix disputes selection logic

* spelling

* Tests

* Rename `Disputes` message to `StagingDisputes`

* Update node/core/provisioner/src/lib.rs

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Code review feedback

- Logging
- Separate error module
- Add additional fields for GetOnchainDisputesErr
- logging and impl MallocSizeOf
- fix impl MallocSizeOf for DisputeState
- fix tests

* Update node/core/provisioner/src/error.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/core/provisioner/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/core/provisioner/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Apply suggestions from code review

dummy metrics instance

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>

* Revert "Apply suggestions from code review"

This reverts commit 6dc518cbf77e037ff4760d315938a68c806e662e.

* Code review feedback: #[cfg(test)] for new_dummy() in metrics

* Code review feedback: break the disputes generation logic in separate functions

* Code review feedback - align_eight

Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
Co-authored-by: Andronik <write@reusable.software>
Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
This commit is contained in:
Tsvetomir Dimitrov
2022-05-06 15:58:04 +03:00
committed by GitHub
parent 673a32d968
commit 20e56a453c
14 changed files with 753 additions and 94 deletions
@@ -169,6 +169,8 @@ where
.cache_validation_code_hash((relay_parent, para_id, assumption), hash),
Version(relay_parent, version) =>
self.requests_cache.cache_version(relay_parent, version),
StagingDisputes(relay_parent, disputes) =>
self.requests_cache.cache_disputes(relay_parent, disputes),
}
}
@@ -270,6 +272,8 @@ where
Request::ValidationCodeHash(para, assumption, sender) =>
query!(validation_code_hash(para, assumption), sender)
.map(|sender| Request::ValidationCodeHash(para, assumption, sender)),
Request::StagingDisputes(sender) =>
query!(disputes(), sender).map(|sender| Request::StagingDisputes(sender)),
}
}
@@ -526,5 +530,7 @@ where
},
Request::ValidationCodeHash(para, assumption, sender) =>
query!(ValidationCodeHash, validation_code_hash(para, assumption), ver = 2, sender),
Request::StagingDisputes(sender) =>
query!(StagingDisputes, staging_get_disputes(), ver = 2, sender),
}
}