Skip to content

Commit f21a009

Browse files
authored
Merge branch 'master' into fix-hashrate-spike-2
2 parents a2da2e4 + 4bfdccd commit f21a009

24 files changed

+288
-53
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- name: Checkout repo
8-
uses: actions/checkout@v4
8+
uses: actions/checkout@v6
99
with:
1010
submodules: 'recursive'
1111
- name: Setup Node.js
12-
uses: actions/setup-node@v4
12+
uses: actions/setup-node@v6
1313
with:
14-
node-version: '22.15.0'
14+
node-version: '24.14.0'
1515
- name: Build web dist
1616
working-directory: ./main/http_server/axe-os
1717
run: |
@@ -20,11 +20,11 @@ jobs:
2020
- name: esp-idf build
2121
uses: espressif/esp-idf-ci-action@v1
2222
with:
23-
esp_idf_version: v5.5.2
23+
esp_idf_version: v5.5.3
2424
target: esp32s3
2525
command: GITHUB_ACTIONS="true" idf.py build
2626
path: '.'
27-
- uses: actions/setup-python@v5
27+
- uses: actions/setup-python@v6
2828
with:
2929
python-version: '3.10'
3030
cache: 'pip'

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
base_labels: ${{ steps.meta.outputs.labels }}
2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

2424
- name: Log in to GitHub Container Registry
2525
uses: docker/login-action@v3
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
steps:
5454
- name: Checkout repository
55-
uses: actions/checkout@v4
55+
uses: actions/checkout@v6
5656

5757
- name: Log in to GitHub Container Registry
5858
uses: docker/login-action@v3

.github/workflows/release-beta.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1818
with:
1919
submodules: 'recursive'
2020
- name: Setup Node.js
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
2222
with:
23-
node-version: '22.15.0'
23+
node-version: '24.14.0'
2424
- name: Build web dist
2525
working-directory: ./main/http_server/axe-os
2626
run: |
@@ -29,11 +29,11 @@ jobs:
2929
- name: esp-idf build
3030
uses: espressif/esp-idf-ci-action@v1
3131
with:
32-
esp_idf_version: v5.5.2
32+
esp_idf_version: v5.5.3
3333
target: esp32s3
3434
command: GITHUB_ACTIONS="true" idf.py build
3535
path: '.'
36-
- uses: actions/setup-python@v5
36+
- uses: actions/setup-python@v6
3737
with:
3838
python-version: '3.10'
3939
cache: 'pip'

.github/workflows/release-factory-beta.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
build_type: ["102", "201", "202", "203", "204", "205", "207", "302", "303", "400", "401", "402", "403", "601", "602", "650", "701", "702", "801"]
2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
with:
2424
submodules: 'recursive'
2525
- name: Setup Node.js
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
28-
node-version: '22.15.0'
28+
node-version: '24.14.0'
2929
- name: Build web dist
3030
working-directory: ./main/http_server/axe-os
3131
run: |
@@ -34,18 +34,18 @@ jobs:
3434
- name: esp-idf build
3535
uses: espressif/esp-idf-ci-action@v1
3636
with:
37-
esp_idf_version: v5.5.2
37+
esp_idf_version: v5.5.3
3838
target: esp32s3
3939
command: GITHUB_ACTIONS="true" idf.py build
4040
path: '.'
4141
- name: "esp-idf build factory config for ${{ matrix.build_type }}"
4242
uses: espressif/esp-idf-ci-action@v1
4343
with:
44-
esp_idf_version: v5.5.2
44+
esp_idf_version: v5.5.3
4545
target: esp32s3
4646
command: /opt/esp/idf/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py generate config-${{ matrix.build_type }}.cvs config.bin 0x6000
4747
path: '.'
48-
- uses: actions/setup-python@v5
48+
- uses: actions/setup-python@v6
4949
with:
5050
python-version: '3.10'
5151
cache: 'pip'

.github/workflows/release-factory.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
build_type: ["102", "201", "202", "203", "204", "205", "207", "302", "303", "400", "401", "402", "403", "601", "602", "650", "701", "702", "801"]
2020
steps:
2121
- name: Checkout repo
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
with:
2424
submodules: 'recursive'
2525
- name: Setup Node.js
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
28-
node-version: '22.15.0'
28+
node-version: '24.14.0'
2929
- name: Build web dist
3030
working-directory: ./main/http_server/axe-os
3131
run: |
@@ -34,18 +34,18 @@ jobs:
3434
- name: esp-idf build
3535
uses: espressif/esp-idf-ci-action@v1
3636
with:
37-
esp_idf_version: v5.5.2
37+
esp_idf_version: v5.5.3
3838
target: esp32s3
3939
command: GITHUB_ACTIONS="true" idf.py build
4040
path: '.'
4141
- name: "esp-idf build factory config for ${{ matrix.build_type }}"
4242
uses: espressif/esp-idf-ci-action@v1
4343
with:
44-
esp_idf_version: v5.5.2
44+
esp_idf_version: v5.5.3
4545
target: esp32s3
4646
command: /opt/esp/idf/components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py generate config-${{ matrix.build_type }}.cvs config.bin 0x6000
4747
path: '.'
48-
- uses: actions/setup-python@v5
48+
- uses: actions/setup-python@v6
4949
with:
5050
python-version: '3.10'
5151
cache: 'pip'

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repo
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1818
with:
1919
submodules: 'recursive'
2020
- name: Setup Node.js
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
2222
with:
23-
node-version: '22.15.0'
23+
node-version: '24.14.0'
2424
- name: Build web dist
2525
working-directory: ./main/http_server/axe-os
2626
run: |
@@ -29,11 +29,11 @@ jobs:
2929
- name: esp-idf build
3030
uses: espressif/esp-idf-ci-action@v1
3131
with:
32-
esp_idf_version: v5.5.2
32+
esp_idf_version: v5.5.3
3333
target: esp32s3
3434
command: GITHUB_ACTIONS="true" idf.py build
3535
path: '.'
36-
- uses: actions/setup-python@v5
36+
- uses: actions/setup-python@v6
3737
with:
3838
python-version: '3.10'
3939
cache: 'pip'

.github/workflows/unittest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout repo
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
1313
with:
1414
submodules: 'recursive'
1515

1616
- name: esp-idf build
1717
uses: espressif/esp-idf-ci-action@v1
1818
with:
19-
esp_idf_version: v5.5.2
19+
esp_idf_version: v5.5.3
2020
target: esp32s3
2121
command: GITHUB_ACTIONS="true" idf.py build
2222
path: 'test-ci'

components/stratum/coinbase_decoder.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include <ctype.h>
99
#include "mbedtls/sha256.h"
1010

11+
#define BIP110_SIGNAL_BIT 4
12+
#define BIP110_SIGNAL_EXPIRY_BLOCK 965664
13+
1114
// Wrapper for SHA256 to match libbase58's expected signature
1215
static bool my_sha256(void *digest, const void *data, size_t datasz) {
1316
mbedtls_sha256(data, datasz, digest, 0);
@@ -144,14 +147,14 @@ esp_err_t coinbase_process_notification(const mining_notify *notification,
144147
const char *extranonce1,
145148
int extranonce2_len,
146149
const char *user_address,
147-
bool decode_outputs,
150+
bool decode_coinbase_tx,
148151
mining_notification_result_t *result) {
149152
if (!notification || !extranonce1 || !result) return ESP_ERR_INVALID_ARG;
150153

151154
// Initialize result
152155
result->total_value_satoshis = 0;
153156
result->user_value_satoshis = 0;
154-
result->decoding_enabled = decode_outputs;
157+
result->decode_coinbase_tx = decode_coinbase_tx;
155158

156159
// 1. Calculate difficulty
157160
result->network_difficulty = networkDifficulty(notification->target);
@@ -178,6 +181,9 @@ esp_err_t coinbase_process_notification(const mining_notify *notification,
178181
hex2bin(notification->coinbase_1 + (coinbase_1_offset * 2), (uint8_t *)&result->block_height, block_height_len);
179182
coinbase_1_offset += block_height_len;
180183

184+
// Detect BIP-110 signaling: check if bit 4 (0x00000010) is set in version
185+
result->bip110_signaling = decode_coinbase_tx && result->block_height < BIP110_SIGNAL_EXPIRY_BLOCK && (notification->version & (1U << BIP110_SIGNAL_BIT)) != 0;
186+
181187
// Calculate remaining scriptsig length (excluding block height part)
182188
int scriptsig_length = scriptsig_len - 1 - block_height_len;
183189
size_t extranonce1_len = strlen(extranonce1) / 2;
@@ -281,7 +287,7 @@ esp_err_t coinbase_process_notification(const mining_notify *notification,
281287

282288
if (offset + script_len > coinbase_2_len) break;
283289

284-
if (decode_outputs) {
290+
if (decode_coinbase_tx) {
285291
if (value_satoshis > 0) {
286292
char output_address[MAX_ADDRESS_STRING_LEN];
287293
coinbase_decode_address_from_scriptpubkey(coinbase_2_bin + offset, script_len, output_address, MAX_ADDRESS_STRING_LEN);

components/stratum/include/coinbase_decoder.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ typedef struct {
8585
int output_count;
8686
uint64_t total_value_satoshis;
8787
uint64_t user_value_satoshis;
88-
bool decoding_enabled;
88+
bool decode_coinbase_tx;
89+
bool bip110_signaling; // BIP-110: signaling via version bit 4 (0x00000010)
8990
} mining_notification_result_t;
9091

9192
/**
@@ -95,15 +96,15 @@ typedef struct {
9596
* @param extranonce1 Hex string of extranonce1
9697
* @param extranonce2_len Length of extranonce2 in bytes
9798
* @param user_address Payout address of the user
98-
* @param decode_outputs Enable coinbase tx decoding
99+
* @param decode_coinbase_tx Enable coinbase tx decoding
99100
* @param result Pointer to store the results
100101
* @return esp_err_t
101102
*/
102103
esp_err_t coinbase_process_notification(const mining_notify *notification,
103104
const char *extranonce1,
104105
int extranonce2_len,
105106
const char *user_address,
106-
bool decode_outputs,
107+
bool decode_coinbase_tx,
107108
mining_notification_result_t *result);
108109

109110
#endif // COINBASE_DECODER_H

components/stratum/stratum_api.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,8 @@ void STRATUM_V1_parse(StratumApiV1Message * message, const char * stratum_json)
258258
message->error_str = strdup(cJSON_GetStringValue(error_msg));
259259
}
260260
}
261+
} else if (cJSON_IsString(error_json)) {
262+
message->error_str = strdup(cJSON_GetStringValue(error_json));
261263
}
262264

263265
// if the result is a boolean, then parse it
@@ -274,6 +276,8 @@ void STRATUM_V1_parse(StratumApiV1Message * message, const char * stratum_json)
274276
message->error_str = strdup("unknown");
275277
if (cJSON_IsString(reject_reason_json)) {
276278
message->error_str = strdup(cJSON_GetStringValue(reject_reason_json));
279+
} else if (cJSON_IsString(error_json)) {
280+
message->error_str = strdup(cJSON_GetStringValue(error_json));
277281
}
278282
}
279283

0 commit comments

Comments
 (0)