-
Notifications
You must be signed in to change notification settings - Fork 2
L2ps simplified #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tcsenpai
wants to merge
65
commits into
testnet
Choose a base branch
from
l2ps_simplified
base: testnet
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
L2ps simplified #495
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
5366aad
Plan of action
tcsenpai b228b2e
added database structure for offline messages
8ff4f1d
just an addition to the ignore
d1ca864
Updated action plan for better l2ps imp
fcfa880
started new l2ps structure
e9ef066
dubious integration of ucrypto transaction type into this branch
30ffc92
l2ps implementation status tracking
c83be55
version bumps
1cb1e95
refactoring of parallelNetworks l2ps wrapper using the new l2ps logic…
4b8eaa8
dependant files update following the upgrade to the new l2ps
029625a
ignoring sensitive files
7c14d9e
documented the class
2209e06
Merge branch 'testnet' into imp_persistent
55851d2
better approach to transaction class
b2c10df
claude.md ignored
3c66730
using the generic transaction validation
8fd6941
Merge branch 'testnet' into imp_persistent
tcsenpai 0f55d6b
ignored sensitive files
8153c52
dtr first test
ec4d2bf
Merge branch 'testnet' into dtr
6e76832
updated docs
30adaaf
entrypoint for background tx relaying
486dd01
added deletion method
c5dfa3d
hardened DTR logic
da25b2a
relayRetryService implementation for background relay of txs
665171e
Merge branch 'testnet' into l2ps_simplified
81c39af
fixed import with the new tx type
5f4bf76
Merge branch 'dtr' into l2ps_simplified
12b05b5
Improved l2ps loading when handling a L2PSTransaction
c2ffb2b
simplified action plan for l2ps based on DTR
70d8beb
created l2ps mempool object and entity
73b9f1e
corrected some implementation details
1b0c155
Merge branch 'testnet' into l2ps_simplified
tcsenpai 3650f9e
added L2PS Hash service to periodically create hashes of l2ps tables
b1bc29e
added new tx type for distributing the L2PS hashes to the DTR
c7d1ee6
updated plan
5c5fe27
ignored files
262620a
improved hash service and sdk version bump
tcsenpai 333f108
Merge branch 'testnet' into l2ps_simplified
tcsenpai 51b93f1
Implement Phase 3b: Validator Hash Storage for L2PS
42d42ee
Implement Phase 3c-1: Complete L2PS NodeCall Endpoints
a54044d
Implement Phase 3c-2: Create L2PS Concurrent Sync Service
80bc0d6
Implement Phase 3c-3: Integrate L2PS Sync with Blockchain Sync
36b03f2
docs: Complete L2PS implementation documentation and testing guide
ff9b927
added memories
09b871c
configured serena
7862b05
ignores
0c8895d
lints
93a74e0
added onboarding for l2ps
00022c6
saved session for l2ps
f11afe5
Fix L2PS return type and pre-existing issues
d6e95fd
Fix DTR validator shuffle algorithm (fix dtr behavior)
b9c63cc
ignores
940b9f8
committed pr fixes
48d344f
Fix 9 critical and high-priority issues from PR review
2362537
Fix 16 critical and high-priority issues from CodeRabbit PR review
750eb91
fixed some files due to reviews
3793c6a
Fix 3 issues from CodeRabbit validation review
e114000
Fix 8 critical and high-priority issues from CodeRabbit PR review
24c7a19
Fix CodeRabbit Issue #1: Make blockchain storage mandatory for both p…
62b5978
ignores
27fef3a
Merge branch 'testnet' into l2ps_simplified
tcsenpai 53d71e6
Merge branch 'testnet' into l2ps_simplified
tcsenpai f0ae38f
updated with beads
330ae8a
ignored
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SQLite databases | ||
| *.db | ||
| *.db?* | ||
| *.db-journal | ||
| *.db-wal | ||
| *.db-shm | ||
|
|
||
| # Daemon runtime files | ||
| daemon.lock | ||
| daemon.log | ||
| daemon.pid | ||
| bd.sock | ||
|
|
||
| # Legacy database files | ||
| db.sqlite | ||
| bd.db | ||
|
|
||
| # Merge artifacts (temporary files from 3-way merge) | ||
| beads.base.jsonl | ||
| beads.base.meta.json | ||
| beads.left.jsonl | ||
| beads.left.meta.json | ||
| beads.right.jsonl | ||
| beads.right.meta.json | ||
|
|
||
| # Keep JSONL exports and config (source of truth for git) | ||
| !issues.jsonl | ||
| !metadata.json | ||
| !config.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.29.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sync-branch: beads-sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "database": "beads.db", | ||
| "jsonl_export": "beads.left.jsonl" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| # Development Guidelines | ||
|
|
||
| ## Core Principles | ||
|
|
||
| ### 1. Maintainability First | ||
| - Prioritize clean, readable, well-documented code | ||
| - Use descriptive names for variables, functions, and types | ||
| - Follow established project patterns and conventions | ||
| - Document significant architectural decisions | ||
|
|
||
| ### 2. Planning and Workflow | ||
| - **Plan before coding**: Create implementation plans for complex features | ||
| - **Phases workflow**: Use *_PHASES.md files for actionable, short but useful steps | ||
| - **Incremental development**: Make focused, reviewable changes | ||
| - **Seek confirmation**: Ask for clarification on ambiguous requirements | ||
| - **Wait for confirmations**: When following phases, complete one phase at a time | ||
| - **Context awareness**: This is Demos Network node/RPC software | ||
|
|
||
| ### 3. Code Quality Standards | ||
| - **Error handling**: Comprehensive error handling and validation required | ||
| - **Type safety**: Full TypeScript type coverage mandatory | ||
| - **Testing**: Follow existing test patterns and maintain coverage | ||
| - **Linting**: Run `bun run lint:fix` after changes (MANDATORY) | ||
|
|
||
| ## Architecture Principles | ||
|
|
||
| ### Follow Existing Patterns | ||
| - Look at similar implementations in the codebase | ||
| - Use established utility functions and helpers | ||
| - Integrate with existing SDK methods and APIs | ||
| - Maintain consistency with current patterns | ||
|
|
||
| ### Integration Guidelines | ||
| - **SDK Integration**: Use @kynesyslabs/demosdk correctly | ||
| - **Database**: Follow TypeORM patterns for entities and queries | ||
| - **Features**: Place new features in appropriate src/features/ subdirectory | ||
| - **Types**: Define types in src/types/ for shared interfaces | ||
|
|
||
| ## Best Practices | ||
|
|
||
| ### 1. Clean Imports | ||
| **CRITICAL**: Use `@/` path aliases instead of relative imports | ||
| ```typescript | ||
| // ✓ Correct | ||
| import { helper } from "@/libs/utils/helper" | ||
| import { Feature } from "@/features/incentive/types" | ||
|
|
||
| // ✗ Wrong | ||
| import { helper } from "../../../libs/utils/helper" | ||
| ``` | ||
|
|
||
| ### 2. Code Review Markers | ||
| Add `// REVIEW:` before newly added features or significant code blocks | ||
| ```typescript | ||
| // REVIEW: New authentication flow implementation | ||
| async function authenticateUser(credentials: UserCredentials) { | ||
| // Implementation | ||
| } | ||
| ``` | ||
|
|
||
| ### 3. Documentation Standards | ||
| - **JSDoc**: Required for all new methods and functions | ||
| - **Inline comments**: Required for complex logic or business rules | ||
| - **Decision documentation**: Document non-obvious implementation choices | ||
|
|
||
| ### 4. Error Messages | ||
| - Provide clear, actionable error messages | ||
| - Include context for debugging | ||
| - Use professional language for user-facing errors | ||
|
|
||
| ### 5. Naming Conventions | ||
| - Variables/functions: camelCase | ||
| - Classes/types/interfaces: PascalCase | ||
| - No "I" prefix for interfaces | ||
| - Descriptive names that express intent | ||
|
|
||
| ### 6. Code Comments for Cross-Language Understanding | ||
| When coding in non-TypeScript/JavaScript languages (e.g., Rust for Solana): | ||
| - Always comment with analogies to Solidity/TypeScript/JavaScript | ||
| - Help developers from TS/JS/Solidity background grasp code quickly | ||
| - Example: "// Similar to TypeScript's async/await pattern" | ||
|
|
||
| ### 7. Diagrams for Complex Features | ||
| When following phases workflow and feature is complex: | ||
| - Create markdown file with ASCII/Unicode diagram | ||
| - Label with function names | ||
| - Number with phase numbers | ||
| - Use blocks and lines to show flow | ||
| - Place alongside implementation | ||
|
|
||
| ## Repository-Specific Notes | ||
|
|
||
| ### Version References | ||
| - **GCR**: Always refers to GCRv2 methods unless specified | ||
| - **Consensus**: Always refers to PoRBFTv2 if present | ||
| - **SDK**: @kynesyslabs/demosdk from npm, sources at ../sdks/ | ||
|
|
||
| ### Branch-Specific Notes | ||
| - **native_bridges branch**: Reference ./bridges_docs/ for status and phases | ||
| - **native_bridges imports**: When importing from ../sdks/build, add: | ||
| ```typescript | ||
| // FIXME Once we have a proper SDK build, use the correct import path | ||
| ``` | ||
|
|
||
| ## Testing Guidelines | ||
|
|
||
| ### CRITICAL: Never Start Node During Development | ||
| - **NEVER** run `./run` or `bun run start` during development | ||
| - **Use** `bun run lint:fix` to check for errors | ||
| - **Node startup** only in production or controlled environments | ||
| - **ESLint validation** is the primary method for code correctness | ||
|
|
||
| ### Testing Workflow | ||
| ```bash | ||
| # 1. Make changes | ||
| # 2. Validate syntax and quality | ||
| bun run lint:fix | ||
|
|
||
| # 3. Run tests if applicable | ||
| bun run test:chains | ||
|
|
||
| # 4. Only in production/controlled environment | ||
| ./run | ||
| ``` | ||
|
|
||
| ## Tools and Agents | ||
|
|
||
| ### MCP Servers Available | ||
| - Use MCP servers when needed (e.g., aptos-docs-mcp for Aptos documentation) | ||
| - Reference demosdk-references for SDK-specific lookups | ||
| - Use demosdk-gitbook for snippets and examples | ||
|
|
||
| ### Specialized Agents | ||
| - Use specialized agents when beneficial (e.g., rust-pro for Rust code) | ||
| - Only invoke when they add value to the task | ||
|
|
||
| ## Communication and Collaboration | ||
|
|
||
| ### When to Ask Questions | ||
| - Requirements are unclear | ||
| - Multiple valid approaches exist | ||
| - Complex implementation decisions needed | ||
| - Non-obvious code choices being made | ||
|
|
||
| ### Documentation Requirements | ||
| - Explain complex implementation decisions | ||
| - Provide context for non-obvious code choices | ||
| - Document deviations from standard patterns | ||
| - Note any technical debt or future improvements | ||
|
|
||
| ## Development Workflow Summary | ||
|
|
||
| 1. **Understand the task and context** | ||
| 2. **Plan the implementation** (create *_PHASES.md if complex) | ||
| 3. **Follow established patterns** from existing code | ||
| 4. **Implement with proper documentation** (JSDoc, comments, REVIEW markers) | ||
| 5. **Use @/ import aliases** (never relative paths) | ||
| 6. **Validate with linting** (`bun run lint:fix`) | ||
| 7. **Test if applicable** (`bun run test:chains`) | ||
| 8. **Report completion** with summary of changes | ||
| 9. **Wait for confirmation** before next phase | ||
|
|
||
| ## Code Organization | ||
|
|
||
| ### File Placement | ||
| - Tests: Place in `src/tests/` directory | ||
| - Scripts: Place in `src/utilities/` directory | ||
| - Documentation: Place in `claudedocs/` for Claude-generated reports | ||
| - Features: Place in appropriate `src/features/` subdirectory | ||
|
|
||
| ### Structure Consistency | ||
| - Check for existing directories before creating new ones | ||
| - Follow the established directory patterns | ||
| - Maintain separation of concerns | ||
| - Keep related code together |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate ignore entries.
Several entries are duplicated, creating redundancy and suggesting the file wasn't carefully reviewed before commit:
CLAUDE.md) duplicates line 122data/l2ps/example/*) duplicate lines 117–118architecture) duplicates line 127data/l2ps/*) already covers theexample/subdirectory entries, making lines 115–118 partially redundantClean up the duplicates and consolidate patterns where feasible to keep the file maintainable.
Suggested cleanup:
Or, if the broader pattern
data/l2ps/*is preferred, remove the more specificexample/entries entirely.🤖 Prompt for AI Agents