-
Notifications
You must be signed in to change notification settings - Fork 715
Add lockup events #2189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lockup events #2189
Conversation
# Conflicts: # src/chainstate/stacks/db/mod.rs
| value: Value::Tuple(lookup_event), | ||
| }, | ||
| ); | ||
| lockup_events.push(lookup_event); |
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.
So, these are all "synthetic" events -- they don't correspond to a real transaction on the blockchain. This could confuse users and block explorers -- they'll see a txid, but be unable to query it from the chainstate (we've had this problem before in Stacks 1.0 with "synthetic transactions" that achieved the same end).
Would it make sense to add a field in the StacksTransactionEvent struct to indicate whether or not the event came from a synthetic transaction, so people don't mistakenly believe that these genesis events correspond to on-chain transactions?
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.
No need to address it in this PR if you're pressed for time, but please do open an issue for it if you're not going to address it here.
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.
Also, any insight into how big this list will be in RAM?
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.
I share the concern about these transactions and events being odd one-offs, however, the event broadcaster attaches these to the initial block in a way that does not require any special handling by the sidecar/explorer. We've already been doing this for a while in order to get the boot contracts exposed in a normalized way.
I can imagine how an is_synthetic field could be useful, but I don't think it's worth the effort at the moment.
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.
Also, any insight into how big this list will be in RAM?
It's a couple of megabytes on disk, not sure about the representation in RAM.
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.
I'm doing some benchmarks on memory usage
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 PR appears to increase max memory usage from ~580MB to ~700MB. Measured a few times with
time -l stacks-node mocknet and looking at the reported maximum resident set size.
Tests performed without an event observer configured.
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.
That doesn't sound too bad.
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.
Also of note: with an event observer attached, memory usage is ~2.6GB. The content-size of the first block event payload is ~100MB.
jcnelson
left a comment
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.
LGTM!
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Per @zone117x request, we're generating a receipt with the lockup events inserted at genesis time.