Skip to content

Commit b7e0a0d

Browse files
committed
Merge branch 'oreoslabs:developer' into developer
2 parents 6a9342c + 36e97b6 commit b7e0a0d

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ FROM debian:bookworm-slim
2323

2424
RUN apt-get update && apt-get install -y \
2525
libssl3 \
26+
openssl \
2627
&& rm -rf /var/lib/apt/lists/*
2728

2829
# Set the working directory
2930
WORKDIR /app
3031

3132
# Copy the built binaries from the builder stage
3233
COPY --from=builder /app/build/target/release/server /app/server
33-
COPY --from=builder /app/build/target/release/chain_loader /app/chain_loader
34-
COPY --from=builder /app/build/target/release/dservice /app/dservice
34+
COPY --from=builder /app/build/target/release/scanner /app/scanner
3535
COPY --from=builder /app/build/target/release/dworker /app/dworker
3636
COPY --from=builder /app/build/target/release/prover /app/prover
3737

crates/networking/src/rpc_abi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ pub struct RpcAddTxResponse {
264264
pub struct RpcGetTransactionsRequest {
265265
pub account: String,
266266
pub limit: Option<u32>,
267+
pub offset: Option<u32>,
267268
pub reverse: Option<bool>,
268269
}
269270

crates/server/src/handlers.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,7 @@ async fn update_scan_status(
264264
message.account = account.name.clone();
265265
let mut blocks = message.blocks.clone();
266266
blocks.sort_by(|a, b| b.sequence.cmp(&a.sequence));
267-
let mut start_hash = String::new();
268-
let mut end_hash;
267+
let mut start_hash = message.start.clone();
269268
loop {
270269
let mut message = message.clone();
271270
let mut limited_blocks = Vec::with_capacity(batch_size);
@@ -278,21 +277,18 @@ async fn update_scan_status(
278277
if !first_request && limited_blocks.is_empty() {
279278
break;
280279
}
281-
if !first_request {
282-
message.start = start_hash;
283-
}
280+
message.start = start_hash.clone();
284281
if !limited_blocks.is_empty() && !blocks.is_empty() {
285-
end_hash = limited_blocks.last().unwrap().hash.clone();
286-
} else {
287-
end_hash = message.end.clone();
282+
let last_block = limited_blocks.last().unwrap();
283+
message.end = last_block.hash.clone();
284+
let q = shared.rpc_handler.get_blocks(last_block.sequence as u64, last_block.sequence as u64 + 1)?;
285+
start_hash = q.data.blocks[q.data.blocks.len() - 1].block.hash.clone();
288286
}
289287

290-
message.end = end_hash.clone();
291288
message.blocks = limited_blocks;
292289
shared.rpc_handler.set_account_head(message)?;
293290
{
294291
first_request = false;
295-
start_hash = end_hash;
296292
}
297293
}
298294
if scan_complete {
@@ -430,6 +426,7 @@ pub async fn get_transactions_handler(
430426
.get_transactions(RpcGetTransactionsRequest {
431427
account: db_account.unwrap().name,
432428
limit: Some(get_transactions.limit.unwrap_or(6)),
429+
offset: Some(get_transactions.offset.unwrap_or(0)),
433430
reverse: Some(true),
434431
})
435432
.into_response()
@@ -469,7 +466,7 @@ pub async fn create_transaction_handler(
469466
.create_transaction(RpcCreateTxRequest {
470467
account: db_account.unwrap().name,
471468
outputs: Some(outputs),
472-
fee: Some(create_transaction.fee.unwrap_or("1".into())),
469+
fee: create_transaction.fee,
473470
expiration_delta: Some(create_transaction.expiration_delta.unwrap_or(30)),
474471
mints: Some(mints),
475472
burns: Some(burns),

crates/server/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub async fn run_server<N: Network>(
157157
let no_auth_router = Router::new()
158158
.route("/import", post(import_account_handler))
159159
.route("/healthCheck", get(health_check_handler))
160+
.route("/latestBlock", get(latest_block_handler))
160161
.route("/updateScan", post(update_scan_status_handler))
161162
.with_state(shared_resource.clone());
162163

@@ -169,7 +170,6 @@ pub async fn run_server<N: Network>(
169170
.route("/broadcastTx", post(add_transaction_handler))
170171
.route("/addTx", post(add_transaction_handler))
171172
.route("/accountStatus", post(account_status_handler))
172-
.route("/latestBlock", get(latest_block_handler))
173173
.route("/ores", post(get_ores_handler))
174174
.route("/rescan", post(rescan_account_handler))
175175
.with_state(shared_resource.clone());

0 commit comments

Comments
 (0)