Empty DACS_SCAN_FINALITY_DEPTH turns the finality hold-back off

Đang mở Phù hợp với người mới
#342 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@cX3po đang làm issue này rồi.

Từ ngày 20/11/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại nonNegativeInt trong reference-implementations/dacs-directory/src/catalog/scan.ts:36-38 và điểm gọi ở dòng 491, sau đó kiểm tra README.md:193 để biết giá trị mặc định được ghi trong tài liệu là 2. Xác nhận rằng DACS_SCAN_FINALITY_DEPTH= và một giá trị chỉ gồm khoảng trắng đều đến parser dưới dạng chuỗi rỗng và hiện tại trở thành độ sâu 0. Thêm unit test song song với mẫu khôi phục biến môi trường trong test/scan-addresses.test.ts:46-67; hoàn thành nghĩa là cả hai trường hợp quay về 2 và bộ kiểm thử chạy qua.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

contributors-section

Where: reference-implementations/dacs-directory/src/catalog/scan.ts:491 (on phase0-completion at the linked commit)

What goes wrong: nonNegativeInt (scan.ts:36-38) uses Number(value), and Number('') and Number(' ') are 0. So DACS_SCAN_FINALITY_DEPTH= (set but empty), read at scan.ts:491, gives depth 0 instead of the documented default of 2 (README.md:193), and the newest transactions are indexed before they are held back.

Suggested fix: In nonNegativeInt, treat undefined, empty and whitespace-only strings as unset and return the fallback. Add a unit test for an empty and a whitespace-only value (restore the environment variable afterwards, as test/scan-addresses.test.ts:46-67 does).

Size: Small

This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.

Ngôn ngữ chính
TypeScript
Star
0
Fork
3
Merge trung bình
20 giờ 26 phút
Pull request đã merge (30 ngày)
119

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DACS-Agent-commerce/Community

Tất cả issue của DACS-Agent-commerce/Community

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.