-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
It looks like @apopiak signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
ok
…On Tue, 28 Apr 2020 at 11:15, Shawn Tabrizi ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In frame/timestamp/src/lib.rs
<#5775 (comment)>:
> @@ -151,15 +151,22 @@ decl_module! {
///
/// # <weight>
/// - `O(T)` where `T` complexity of `on_timestamp_set`
- /// - 2 storage mutations (codec `O(1)`).
+ /// - 2 storage mutations (codec `O(1)`). (effectively 1, because of `DidUpdate::take` in `on_finalize`)
I agree that the total db operations of set should be:
- 1 read: DidUpdate::exists()
- 1 write: Now::put(now)
We should ignore DidUpdate::put(true) because it is always removed at the
end of the block, and thus never written to the underlying database.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5775 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVBKYUDOVHRP4IBMGZHNKLRO2NCXANCNFSM4MQFQMVA>
.
--
Wichtige Mitteilung
Diese Mitteilung wurde von Parity Technologies
Deutschland GmbH kommuniziert, eine im Handelsregister des Amtsgerichtes
Charlottenburg unter HRB 190583 B registrierte Gesellschaft mit
beschränkter Haftung (GmbH). Die Geschäftsführerin der GmbH ist Frau Dr.
Jutta Steiner. Der registrierte Geschäftssitz ist Glogauer Straße 6 in
10999 Berlin, Deutschland.
Diese Mitteilung enthält Informationen welche
vertraulich sind und welche eventuell die Vertraulichkeit der
Rechtsberatung ("Anwaltsgeheimnis") berühren. Sie ist ausschließlich für
den/die vorgesehenen Empfänger bestimmt. Wenn Sie nicht der/die
beabsichtigte(n) Empfänger sind, benachrichtigen Sie bitte [email protected]
<mailto:[email protected]> und löschen Sie diese Nachricht sofort.
Unsere
Datenschutzrichtlinie, einschließlich die Art und den Umfang von
personenbezogenen Daten, die wir erfassen, wie wir diese Daten erfassen und
verarbeiten, an wen wir sie in Bezug auf die von uns angebotenen Dienste
weitergeben dürfen, sowie bestimmte Rechte und Optionen, die Sie in dieser
Hinsicht haben, finden Sie unter: https://www.parity.io/privacy/
<https://www.parity.io/privacy/>
|
@apopiak test needs updating. |
…-timestamp-weights
@gnunicorn Any idea how this could have been caused by my changes? |
@apopiak check the logs. Seems like the weight has changed between the found and expected results:
At least that's the difference I can spot. |
Yeah, I found that diff as well. I just have no idea how it could be caused by my changes. I'm reluctant to just change the number without knowing why it would change, that's all. |
bot merge |
/// dummy `on_initialize` to return the weight used in `on_finalize`. | ||
fn on_initialize() -> Weight { | ||
// weight of `on_finalize` | ||
6_000_000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is not T::DbWeight::write(1)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This takes DidUpdate
, which is empty at the initialization of the block, populated as the first extrinsic in the block, and then removed again at the finalization of the block.
No value actually gets written to the DB layer. Everything happens within one block in-memory.
Add weight calculation to
TimeStamp::set
and return weight from dummyon_initialize
.Note that it is assumed that
DidUpdate
does not incur any database costs because it is cleared before the end of the block.fix one out-standing change in
Identity
(see here) as well as its weights.related to #5596