Skip to content

Commit 3020f3a

Browse files
committed
merge: resolve merge conflict, #5918
2 parents c7e7f34 + 7d7e414 commit 3020f3a

Some content is hidden

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

66 files changed

+4630
-796
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ 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 field `vm_error` to EventObserver transaction outputs
13+
- Added new `ValidateRejectCode` values to the `/v3/block_proposal` endpoint
14+
- Added `StateMachineUpdateContent::V1` to support a vector of `StacksTransaction` expected to be replayed in subsequent Stacks blocks
15+
16+
### Changed
17+
18+
- Reduce the default `block_rejection_timeout_steps` configuration so that miners will retry faster when blocks fail to reach 70% approved or 30% rejected.
19+
- Added index for `next_ready_nakamoto_block()` which improves block processing performance.
20+
- Added a new field, `parent_burn_block_hash`, to the payload that is included in the `/new_burn_block` event observer payload.
21+
22+
### Fixed
23+
24+
- Fix regression in mock-mining, allowing the mock miner to continue mining blocks throughout a tenure instead of failing after mining the tenure change block.
25+
826
## [3.1.0.0.8]
927

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

2038
- 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))
2139
- 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))
40+
- 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))
2341
- 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))
2442
- 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))
2543

CONTRIBUTING.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,31 @@ A non-exhaustive list of examples of consensus-critical changes include:
361361

362362
- Every consensus-critical change needs an integration test to verify that the feature activates only when the hard fork activates.
363363

364-
PRs must include test coverage. However, if your PR includes large tests or tests which cannot run in parallel
364+
- PRs must include test coverage. However, if your PR includes large tests or tests which cannot run in parallel
365365
(which is the default operation of the `cargo test` command), these tests should be decorated with `#[ignore]`.
366-
367366
A test should be marked `#[ignore]` if:
368367

369-
1. It does not _always_ pass `cargo test` in a vanilla environment
368+
1. It does not _always_ pass `cargo test` in a vanilla environment
370369
(i.e., it does not need to run with `--test-threads 1`).
371370

372-
2. Or, it runs for over a minute via a normal `cargo test` execution
371+
2. Or, it runs for over a minute via a normal `cargo test` execution
373372
(the `cargo test` command will warn if this is not the case).
374373

374+
- **Integration tests need to be properly tagged** using [pinny-rs](https://github.com/BitcoinL2-Labs/pinny-rs/) crate. Tagging requires two fundamental steps:
375+
1. Define allowed tags in the package `Cargo.toml` file (if needed).
376+
2. Apply relevant tags to the tests, picking from the allowed set.
377+
378+
Then it will be possible to run tests with filtering based on the tags using `cargo test` and `cargo nextest` runner.
379+
> For more information and examples on how tagging works, refer to the [pinny-rs](https://github.com/BitcoinL2-Labs/pinny-rs/) readme.
380+
381+
Below the tag set currently defined with related purpose:
382+
383+
| Tag | Description |
384+
|-----------------|----------------------------------------------|
385+
| `slow` | tests running over a minute |
386+
| `bitcoind` | tests requiring bitcoin daemon |
387+
| `flaky` | tests that exhibit flaky behavior |
388+
375389
## Formatting
376390

377391
PRs will be checked against `rustfmt` and will _fail_ if not properly formatted.

Cargo.lock

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

clarity/src/vm/database/sqlite.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,16 +254,13 @@ impl SqliteConnection {
254254

255255
Ok(())
256256
}
257+
257258
pub fn memory() -> Result<Connection> {
258259
let contract_db = SqliteConnection::inner_open(":memory:")?;
259260
SqliteConnection::initialize_conn(&contract_db)?;
260261
Ok(contract_db)
261262
}
262-
pub fn open(filename: &str) -> Result<Connection> {
263-
let contract_db = SqliteConnection::inner_open(filename)?;
264-
SqliteConnection::check_schema(&contract_db)?;
265-
Ok(contract_db)
266-
}
263+
267264
pub fn check_schema(conn: &Connection) -> Result<()> {
268265
let sql = "SELECT sql FROM sqlite_master WHERE name=?";
269266
let _: String = conn
@@ -272,10 +269,13 @@ impl SqliteConnection {
272269
let _: String = conn
273270
.query_row(sql, params!["metadata_table"], |row| row.get(0))
274271
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;
272+
let _: String = conn
273+
.query_row(sql, params!["md_blockhashes"], |row| row.get(0))
274+
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;
275275
Ok(())
276276
}
277277

278-
pub fn inner_open(filename: &str) -> Result<Connection> {
278+
fn inner_open(filename: &str) -> Result<Connection> {
279279
let conn = Connection::open(filename)
280280
.map_err(|x| InterpreterError::SqliteError(IncomparableError { err: x }))?;
281281

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ struct BlockEvent {
605605
#[serde(with = "prefix_hex")]
606606
index_block_hash: StacksBlockId,
607607
#[serde(with = "prefix_opt_hex")]
608+
#[serde(default)]
608609
signer_signature_hash: Option<Sha512Trunc256Sum>,
609610
#[serde(with = "prefix_hex")]
610611
consensus_hash: ConsensusHash,

0 commit comments

Comments
 (0)