Skip to content

Adopt/prepared packet v0 - #535

Open
BartolomeyKant wants to merge 17 commits into
mainfrom
adopt/prepared-packet-v0
Open

Adopt/prepared packet v0#535
BartolomeyKant wants to merge 17 commits into
mainfrom
adopt/prepared-packet-v0

Conversation

@BartolomeyKant

@BartolomeyKant BartolomeyKant commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

THis is continuation of work from branch #531
Code was rebased on last main and conflict was fixed.

@BartolomeyKant
BartolomeyKant force-pushed the adopt/prepared-packet-v0 branch from eea4e01 to b6f2516 Compare August 24, 2026 11:36
Comment thread aether/prepared_packet/prepared_send_message.h Outdated
Comment thread aether/stream_api/api_call_adapter.h Outdated
Comment thread aether/stream_api/api_call_adapter.h Outdated
prepared, std::move(api_context_), *byte_stream_);

if (!result) {
std::cerr << "FastTx EncodePacket failed: "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It also should be #ifdef'ed with user_config.h and counted in the prepared block variable with probably counting data processed and packets count so telemetry then sends it to the cloud

std::array<uint8_t, sizeof(base_station.target_bssid)> debug_bssid;
memcpy(debug_bssid.data(), base_station.target_bssid,
sizeof(base_station.target_bssid));
AE_TELED_DEBUG("Restored from cash BSSID:{} CHN:{}", debug_bssid,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The information also should be passed into the prepared block or other "stats" block so when a normal ae client patch is used it is inserted into tele allowing to check how often wifi opts were used

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Didn't make prepared block for wifi yet.

Again I don't think we should store telemetry for prepared blocks.
Either we use as small and fast implementation as possible or use full aether client implementation.

@NikolayChirkov NikolayChirkov Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We still need a separate minimal RTC-resident statistics block, independent of the prepared message block. The full Aether client should import these numeric counters into normal telemetry on the next full-path run and then clear them. Keep only Aether-related data: successful channel-cache/BSSID/static-IP uses (we want to count devices where each optimization works) and the total number of prepared sends, which we can compare with the number received by the server to estimate loss. Do not collect socket/sendto success, failures, retries, or would-block events: that code is external to Aether. nonce_exhausted is also unnecessary because the reserved block size is already known.

add endpoint() property for channel
add method to get cached cloud
@BartolomeyKant

Copy link
Copy Markdown
Collaborator Author

@NikolayChirkov you've reviewed old version. I completely rebuild it.

@BartolomeyKant
BartolomeyKant marked this pull request as ready for review August 24, 2026 15:18

@NikolayChirkov NikolayChirkov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two additional issues in the current head.

Comment on lines +206 to +209
if ((cached != cloud_cache_.end()) && cached->second.cloud.is_valid()) {
return {};
}
return cached->second.cloud;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This condition is inverted. A valid cached cloud currently returns an empty pointer, while a missing entry falls through and dereferences end(). Return empty when cached == cloud_cache_.end() or the cached cloud is invalid; otherwise return cached->second.cloud.

Protocol protocol;
};

struct PreparedSendMessageBlock : BlockBase {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sender_uid is not read by EncodePacket() or by prepared-path selection. Please remove it from the RTC-resident block unless there is a concrete consumer; the block should contain only data required after wake-up.

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.

3 participants