Skip to content

Commit bbfc4b0

Browse files
authored
Merge branch 'develop' into chore/signer-3.1.0.0.8.1_conflicts
2 parents d8cf1e6 + d16bd3a commit bbfc4b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3327
-428
lines changed

.github/workflows/clarity-js-sdk-pr.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Added new `ValidateRejectCode` values to the `/v3/block_proposal` endpoint
13+
14+
### Changed
15+
16+
- Reduce the default `block_rejection_timeout_steps` configuration so that miners will retry faster when blocks fail to reach 70% approved or 30% rejected.
17+
- Added index for `next_ready_nakamoto_block()` which improves block processing performance.
18+
- Added a new field, `parent_burn_block_hash`, to the payload that is included in the `/new_burn_block` event observer payload.
19+
820
## [3.1.0.0.8]
921

1022
### Added
@@ -19,7 +31,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1931

2032
- When a miner times out waiting for signatures, it will re-propose the same block instead of building a new block ([#5877](https://github.com/stacks-network/stacks-core/pull/5877))
2133
- Improve tenure downloader trace verbosity applying proper logging level depending on the tenure state ("debug" if unconfirmed, "info" otherwise) ([#5871](https://github.com/stacks-network/stacks-core/issues/5871))
22-
- Remove warning log about missing UTXOs when a node is configured as `miner` with `mock_mining` mode enabled ([#5841](https://github.com/stacks-network/stacks-core/issues/5841))
34+
- Remove warning log about missing UTXOs when a node is configured as `miner` with `mock_mining` mode enabled ([#5841](https://github.com/stacks-network/stacks-core/issues/5841))
2335
- Deprecated the `wait_on_interim_blocks` option in the miner config file. This option is no longer needed, as the miner will always wait for interim blocks to be processed before mining a new block. To wait extra time in between blocks, use the `min_time_between_blocks_ms` option instead. ([#5979](https://github.com/stacks-network/stacks-core/pull/5979))
2436
- Added `empty_mempool_sleep_ms` to the miner config file to control the time to wait in between mining attempts when the mempool is empty. If not set, the default sleep time is 2.5s. ([#5997](https://github.com/stacks-network/stacks-core/pull/5997))
2537

Cargo.lock

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/event-dispatcher.md

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ These events are sent to the configured endpoint at two URLs:
2727
This payload includes data related to a newly processed block,
2828
and any events emitted from Stacks transactions during the block.
2929

30-
If the transaction originally comes from the parent microblock stream
30+
If the transaction originally comes from the parent microblock stream
3131
preceding this block, the microblock related fields will be filled in.
3232

3333
If the `raw_tx` field for a particular transaction is "0x00", that indicates
34-
that it is a burnchain operation. A burnchain operation is a transaction that
34+
that it is a burnchain operation. A burnchain operation is a transaction that
3535
is executed on the Stacks network, but was sent through the Bitcoin network.
36-
The Stacks network supports a few specific burnchain operations. You can read
36+
The Stacks network supports a few specific burnchain operations. You can read
3737
more about them [here](https://github.com/stacksgov/sips/blob/main/sips/sip-007/sip-007-stacking-consensus.md#stx-operations-on-bitcoin).
3838
The section below has example json encodings for each of the burnchain operations.
3939

@@ -152,8 +152,8 @@ Example:
152152
}
153153
```
154154

155-
#### Example json values for burnchain operations
156-
- TransferStx
155+
#### Example json values for burnchain operations
156+
- TransferStx
157157
```json
158158
{
159159
"transfer_stx": {
@@ -233,6 +233,8 @@ Example:
233233
```json
234234
{
235235
"burn_block_hash": "0x4eaabcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
236+
"consensus_hash": "0x53c166a709a9abd64a92a57f928a8b26aad08992",
237+
"parent_burn_block_hash": "0x6eaebcd105865e471f697eff5dd5bd85d47ecb5a26a3379d74fae0ae87c40904",
236238
"burn_block_height": 331,
237239
"reward_recipients": [
238240
{
@@ -258,8 +260,8 @@ Example:
258260

259261
### `POST /new_microblocks`
260262

261-
This payload includes data related to one or more microblocks that are either emmitted by the
262-
node itself, or received through the network.
263+
This payload includes data related to one or more microblocks that are either emmitted by the
264+
node itself, or received through the network.
263265

264266
Example:
265267

@@ -311,9 +313,9 @@ Example:
311313
}
312314
```
313315

314-
* `burn_block_{}` are the stats related to the burn block that is associated with the stacks
316+
* `burn_block_{}` are the stats related to the burn block that is associated with the stacks
315317
block that precedes this microblock stream.
316-
* Each transaction json object includes information about the microblock the transaction was packaged into.
318+
* Each transaction json object includes information about the microblock the transaction was packaged into.
317319

318320
### `POST /new_mempool_tx`
319321

@@ -384,23 +386,23 @@ Example:
384386
"tx_events": [
385387
{
386388
"Success": {
387-
"txid": "3e04ada5426332bfef446ba0a06d124aace4ade5c11840f541bf88e2e919faf6",
388-
"fee": 0,
389-
"execution_cost": {
390-
"write_length": 0,
391-
"write_count": 0,
392-
"read_length": 0,
393-
"read_count": 0,
389+
"txid": "3e04ada5426332bfef446ba0a06d124aace4ade5c11840f541bf88e2e919faf6",
390+
"fee": 0,
391+
"execution_cost": {
392+
"write_length": 0,
393+
"write_count": 0,
394+
"read_length": 0,
395+
"read_count": 0,
394396
"runtime": 0
395-
},
397+
},
396398
"result": {
397-
"ResponseData":
399+
"ResponseData":
398400
{
399401
"committed": true,
400402
"data": true
401403
}
402404
}
403-
}},
405+
}},
404406
{
405407
"ProcessingError": {
406408
"txid": "eef9f46b20fb637bd07ec92ad3ec175a5a4bdf3e8799259fc5b16a272090d4de",
@@ -432,23 +434,23 @@ Example:
432434
"tx_events": [
433435
{
434436
"Success": {
435-
"txid": "3e04ada5426332bfef446ba0a06d124aace4ade5c11840f541bf88e2e919faf6",
436-
"fee": 0,
437-
"execution_cost": {
438-
"write_length": 10,
439-
"write_count": 10,
440-
"read_length": 20,
441-
"read_count": 10,
437+
"txid": "3e04ada5426332bfef446ba0a06d124aace4ade5c11840f541bf88e2e919faf6",
438+
"fee": 0,
439+
"execution_cost": {
440+
"write_length": 10,
441+
"write_count": 10,
442+
"read_length": 20,
443+
"read_count": 10,
442444
"runtime": 1290
443-
},
445+
},
444446
"result": {
445-
"ResponseData":
447+
"ResponseData":
446448
{
447449
"committed": true,
448450
"data": true
449451
}
450452
}
451-
}},
453+
}},
452454
{
453455
"Skipped": {
454456
"txid": "eef9f46b20fb637bd07ec92ad3ec175a5a4bdf3e8799259fc5b16a272090d4de",

libsigner/src/events.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,14 @@ pub enum SignerEvent<T: SignerEventTrait> {
192192
/// The `Vec<T>` will contain any signer messages made by the miner.
193193
MinerMessages(Vec<T>),
194194
/// The signer messages for other signers and miners to observe
195-
/// The u32 is the signer set to which the message belongs (either 0 or 1)
196-
SignerMessages(u32, Vec<T>),
195+
SignerMessages {
196+
/// The signer set to which the message belongs (either 0 or 1)
197+
signer_set: u32,
198+
/// Each message of type `T` is paired with the `StacksPublicKey` of the slot from which it was retreived
199+
messages: Vec<(StacksPublicKey, T)>,
200+
/// the time at which this event was received by the signer's event processor
201+
received_time: SystemTime,
202+
},
197203
/// A new block proposal validation response from the node
198204
BlockValidationResponse(BlockValidateResponse),
199205
/// Status endpoint request
@@ -518,6 +524,7 @@ impl<T: SignerEventTrait> TryFrom<StackerDBChunksEvent> for SignerEvent<T> {
518524
type Error = EventError;
519525

520526
fn try_from(event: StackerDBChunksEvent) -> Result<Self, Self::Error> {
527+
let received_time = SystemTime::now();
521528
let signer_event = if event.contract_id.name.as_str() == MINERS_NAME
522529
&& event.contract_id.is_boot()
523530
{
@@ -536,12 +543,21 @@ impl<T: SignerEventTrait> TryFrom<StackerDBChunksEvent> for SignerEvent<T> {
536543
return Err(EventError::UnrecognizedStackerDBContract(event.contract_id));
537544
};
538545
// signer-XXX-YYY boot contract
539-
let signer_messages: Vec<T> = event
546+
let messages: Vec<(StacksPublicKey, T)> = event
540547
.modified_slots
541548
.iter()
542-
.filter_map(|chunk| read_next::<T, _>(&mut &chunk.data[..]).ok())
549+
.filter_map(|chunk| {
550+
Some((
551+
chunk.recover_pk().ok()?,
552+
read_next::<T, _>(&mut &chunk.data[..]).ok()?,
553+
))
554+
})
543555
.collect();
544-
SignerEvent::SignerMessages(signer_set, signer_messages)
556+
SignerEvent::SignerMessages {
557+
signer_set,
558+
messages,
559+
received_time,
560+
}
545561
} else {
546562
return Err(EventError::UnrecognizedStackerDBContract(event.contract_id));
547563
};

0 commit comments

Comments
 (0)