Skip to content

Conversation

@jcnelson
Copy link
Contributor

This SIP details a rider to SIP-033, including a new variant of the tenure change control transaction. This variant allows the tenure change to specify a specific dimension of the block budget to reset.

The purpose of this SIP is to make it so that cost-heavy transactions which otherwise execute quickly can be mined, regardless of how pessimistic the current cost model is.

This PR supersedes #234 since I can't push to #234's remote.

Comment on lines 77 to 81
0x02 indicates Extend read-count budget is reset.
0x03 indicates Extend runtime budget is reset.
0x04 indicates Extend read-length budget is reset.
0x05 indicates Extend write-count budget is reset.
0x06 indicates Extend write-length budget is reset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this order? Could we swap runtime and read-count or was there a specific reason for this order?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason. I can swap them.

Copy link
Contributor

Choose a reason for hiding this comment

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

The database fields on a stacks api node are ordered in this way (alphabetic):

execution_cost_read_count
execution_cost_read_length
execution_cost_runtime
execution_cost_write_count
execution_cost_write_length

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, that's fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 97719e1

Copy link
Contributor

Choose a reason for hiding this comment

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

Could there be a scenario where it may be preferable to reset the count on more than 1 field?
i.e. reset on both of write-count and read-count?

from this table, it's apparent only that either all fields are reset, or one is reset only.

Comment on lines 77 to 81
0x02 indicates Extend read-count budget is reset.
0x03 indicates Extend runtime budget is reset.
0x04 indicates Extend read-length budget is reset.
0x05 indicates Extend write-count budget is reset.
0x06 indicates Extend write-length budget is reset.
Copy link
Contributor

Choose a reason for hiding this comment

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

The database fields on a stacks api node are ordered in this way (alphabetic):

execution_cost_read_count
execution_cost_read_length
execution_cost_runtime
execution_cost_write_count
execution_cost_write_length

The Stacks network controls total runtime and I/O expenditure during Nakamoto tenures
via a total tenure budget. Costs are tracked using worst-case estimates of the actual
runtime or I/O expended to evaluate a given Clarity operation. In Nakamoto rules,
signers and miners may coordinate to include a `TenureChange` transaction in the miner's
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this SIP affect the effectiveness of the coordination between signers and miners? Before there were only two options which are less likely to be disputed.

The SIP should address what happens if coordination fails, or why it is likely to improve the situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add this to the SIP. The coordination would basically be the same as it is now -- right now, the signers signal to miners (and to each other) when they will accept a TenureExtend via the BlockResponseMetadata::tenure_extend_timestamp included within a BlockAcceptance message. Once enough signers have posted a timestamp that is in the past, the miner will create a TenureExtend transaction in their next block.

Signers internally decide what this timestamp will be based on how much "idle time" they have observed (i.e. time not processing block proposals). This ensures that the rate of block appends is low enough that a crashed signer (or new follower) can quickly catch up to the chain tip.

After this SIP is ratified, signers would similarly track notions of "idle time" for each of these cost dimensions, and share them amongst themselves and the miners. For example, they may require that the average rate of read I/O operations be beneath a certain threshold before they'll allow a miner to issue a read-count extension. This computation and sharing does not need to ship with the hard-fork since it is not consensus-breaking, but would be added shortly afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 97719e1

@jcnelson
Copy link
Contributor Author

The reference implementation is being developed in this PR.

Copy link
Contributor

@314159265359879 314159265359879 left a comment

Choose a reason for hiding this comment

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

I would say this is nearly ready for sign-off from the editors.

  • Correct some minor spelling/grammer issues
  • Add the "Reference implementation" section and References section
  • I think the Activation section could explain a bit better what it means to be a rider to the 033 (clarity 4) SIP.

measurement of how much of each resource each Clarity operation consumes. The
current model is pessimistic, and assumes a worst-case resource consumption. It
also does not consider the size of the _value_ of the data being processed; it
instead consideres the _worst-case size_ allowed by the data's _type_.
Copy link
Contributor

Choose a reason for hiding this comment

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

considers instead of consideres

Copy link
Contributor

Choose a reason for hiding this comment

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

spanish : )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768


This SIP details a rider to SIP-033, including a new variant of the tenure change
control transaction. This variant allows the tenure change to specify a specific
dimension of the block budget to reset.
Copy link
Contributor

Choose a reason for hiding this comment

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

Clearer: ...which dimension of the block budget is reset.

instead of "...a specific dimension of the block budget to reset.".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768


# Introduction

The Stacks network controls total runtime and I/O expenditure during Nakamoto tenures
Copy link
Contributor

Choose a reason for hiding this comment

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

...Nakamoto tenures, I think it makes sense to reference SIP021 here [1]: https://github.com/stacksgov/sips/blob/main/sips/sip-021/sip-021-nakamoto.md#nakamoto-terminology

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768

# Activation

This is intended as a rider SIP to SIP-033. If SIP-033 is ratified, then this
SIP will also be ratified.
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add these two sections and references.

Reference implementation

stacks-network/stacks-core#6609

References

[1] SIP021 Nakamoto, Tenure definition: https://github.com/stacksgov/sips/blob/main/sips/sip-021/sip-021-nakamoto.md#block-structure
[2] SIP021 Nakamoto, Block header wire format: https://github.com/stacksgov/sips/blob/main/sips/sip-021/sip-021-nakamoto.md#block-structure
[3] SIP033 Clarity 4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768

has been added are new values to represent the kind of tenure extension
requested.

# Activation
Copy link
Contributor

Choose a reason for hiding this comment

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

If activation criteria are redundant because this is a rider to SIP-033, that should be explicitly stated with some criteria or process for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768

## Wire Formats

The serialization of the `TenureChangePayload` will be a backwards-compatible extension of
the existing SIP-021 serialization:
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 8821768

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.

8 participants