Skip to content

Conversation

@lgalabru
Copy link
Contributor

Per @zone117x request, we're generating a receipt with the lockup events inserted at genesis time.

@lgalabru lgalabru self-assigned this Dec 17, 2020
@lgalabru lgalabru changed the base branch from master to next December 30, 2020 07:14
@lgalabru lgalabru marked this pull request as ready for review December 30, 2020 16:34
# Conflicts:
#	src/chainstate/stacks/db/mod.rs
@lgalabru lgalabru changed the base branch from next to feat/atlas-followup December 30, 2020 17:03
value: Value::Tuple(lookup_event),
},
);
lockup_events.push(lookup_event);
Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

@zone117x zone117x Dec 30, 2020

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.

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Base automatically changed from feat/atlas-followup to next December 30, 2020 17:44
@lgalabru lgalabru merged commit dcd6ce3 into next Dec 30, 2020
@lgalabru lgalabru deleted the feat/lockup-events branch December 30, 2020 18:10
@blockstack-devops
Copy link
Contributor

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.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants