Skip to content

feat: added print events and improved returned values#7235

Open
brice-stacks wants to merge 6 commits into
stacks-network:pox-wf-integrationfrom
brice-stacks:feat/pox-5-print
Open

feat: added print events and improved returned values#7235
brice-stacks wants to merge 6 commits into
stacks-network:pox-wf-integrationfrom
brice-stacks:feat/pox-5-print

Conversation

@brice-stacks
Copy link
Copy Markdown
Contributor

Added print events for all interesting actions on the pox-5 contract and also improved the return values for some.

@brice-stacks
Copy link
Copy Markdown
Contributor Author

@rafa-stacks Let me know if this covers everything you'd like to see in the events.

@coveralls
Copy link
Copy Markdown

coveralls commented May 25, 2026

Coverage Report for CI Build 26574518384

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-38.3%) to 47.617%

Details

  • Coverage decreased (-38.3%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 88543 coverage regressions across 343 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

88543 previously-covered lines in 343 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/chainstate/stacks/db/transactions.rs 8105 7.51%
stackslib/src/chainstate/stacks/db/blocks.rs 4478 35.57%
stackslib/src/chainstate/stacks/transaction.rs 4313 9.87%
stackslib/src/chainstate/burn/db/sortdb.rs 4192 42.9%
stackslib/src/chainstate/stacks/boot/mod.rs 3564 13.75%
stackslib/src/net/chat.rs 3156 27.42%
stackslib/src/chainstate/burn/operations/leader_block_commit.rs 2580 18.78%
stackslib/src/net/db.rs 1962 28.92%
stacks-signer/src/signerdb.rs 1578 35.13%
stackslib/src/chainstate/stacks/index/test/node.rs 1317 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 220546
Covered Lines: 105018
Line Coverage: 47.62%
Coverage Strength: 12979949.35 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@rafa-stacks rafa-stacks left a comment

Choose a reason for hiding this comment

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

Thanks for this @brice-stacks ! Just a question about print formatting

)

(print {
bond-index: bond-index,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be possible to add topic: "setup-bond" here (and similar topics to other print functions)? It would be super helpful for parsing and classification

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, you're right. I was thinking that the print event already included which function it came from, but it seems that it does not. I can add that. One note, it looks like the event already uses the name topic to just show the event type, print. It's at a different level so it wouldn't conflict, but would it be more clear to use a different name or do you want to stick with topic?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added topics in 42bd1dc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would it be more clear to use a different name or do you want to stick with topic

good point... it wouldn't conflict per se but I'm down to tweak the property name to make it easier. What about action, type, kind or something like that? Any name you pick would be fine by me 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@brice-stacks I think you maybe forgot to push that commit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ pushed now. I just left it as topic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@hstove-stacks related question... from this setup-bond print event, how can I determine when this bond will activate and/or unlock? (i.e. at which pox cycle, burn height, etc.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can add the starting reward cycle and burn block height to the print event if that would be convenient.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added in 0c79985

The print event does NOT include the function name, so we need an
explicit `topic` included in the printed value.
amount-ustx: (get amount-ustx current-membership),
amount-sats: amount-sats,
first-reward-cycle: first-reward-cycle,
num-cycles: num-cycles,
Copy link
Copy Markdown
Contributor

@rafa-stacks rafa-stacks May 29, 2026

Choose a reason for hiding this comment

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

@brice-stacks could you also provide the updated unlock-burn-height and unlock-cycle here? I assume modifying num-cycles would also modify the unlock height

EDIT: Now that I think of it, a bond's unlock schedule can never change, right? so these values will never really change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes that's correct!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's right. Let me know if you still need them any way, or if we can resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants