Skip to content
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

Async test #20

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3235d0b
add RELEASE.md
Nov 26, 2024
71640f3
Disable default com interfaces for embedded target
Jan 10, 2025
6e8e011
Refactor and cleanup com interface logic
Jan 10, 2025
8b15031
Fix missing self ref
jonasstrehle Jan 10, 2025
a191cb1
Move interfaces of com_hub to set instead of list
jonasstrehle Jan 10, 2025
f0624d1
Move interfaces of com_hub to set instead of list
jonasstrehle Jan 10, 2025
d0fe4cf
work on com interfaces
Jan 11, 2025
808ad78
cargo fmt
jonasstrehle Jan 11, 2025
6fd0b93
add BlockCollector, refactoring of header parser
Jan 12, 2025
53edde9
work on comhub
Jan 15, 2025
aa54037
Make send_queue pub
Jan 15, 2025
42a38f7
add ComHub diagram
Jan 15, 2025
2ac14fc
work on block passing in ComHub
Feb 1, 2025
6cc9976
refactor protocol structures
Feb 2, 2025
e946a03
Add block header and encrypted header
jonasstrehle Feb 3, 2025
42478e5
Add tests for headers
jonasstrehle Feb 3, 2025
1f23724
Reproducable bug in rust :D
jonasstrehle Feb 3, 2025
86b8b84
Fix block length
jonasstrehle Feb 3, 2025
890616a
Fix block length
jonasstrehle Feb 3, 2025
8d7ee1b
Cleanup
jonasstrehle Feb 3, 2025
d7148ae
add common websocket client interface
Feb 13, 2025
219c6e8
Work on com hub and websocket interface and sockets
jonasstrehle Feb 17, 2025
ef872e6
Work on logging for debugging
jonasstrehle Feb 27, 2025
87bf73e
Update
jonasstrehle Mar 3, 2025
cbd7f5c
Remove old dependency
jonasstrehle Mar 3, 2025
f8b20f8
fmt
jonasstrehle Mar 3, 2025
a0e8f4b
add async test (WIP)
jonasstrehle Mar 4, 2025
168bdbc
add async test (WIP)
jonasstrehle Mar 5, 2025
302c635
add async test (WIP)
jonasstrehle Mar 5, 2025
7015997
add async test
jonasstrehle Mar 5, 2025
4ab74bd
Fix interface properties, add channel secure/unsecure hint
jonasstrehle Mar 5, 2025
46c75a7
Fix interface properties, add channel secure/unsecure hint
jonasstrehle Mar 5, 2025
26e1fb2
Fix interface properties, add channel secure/unsecure hint
jonasstrehle Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@ mopa = "0.2.2"
num-bigint = "0.4"
num-integer = "0.1"
default-args = "1.0.0"
wasm-bindgen = "0.2.81"
itertools = "0.10.5"
pest = "2.6"
pest_derive = "2.6"
pad = "0.1"
binrw = "0.14.1"
modular-bitfield = "0.11.2"
anyhow = "1.0.95"
thiserror = "2.0.11"
url = "2.5.4"
num-traits = "0.2.19"
async-trait = "0.1.87"
tokio = { version = "1.43.0", features = ["sync"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

[target.'cfg(not(any(target_arch = "wasm32", target_arch = "xtensa")))'.dependencies]
websocket = "0.24.0"

[profile.release]
Expand Down
15 changes: 15 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Release Guide

This document describes the process of releasing a new version of the Datex Core library. The process creates a Github release, updates the version number in the Cargo.toml file, and publishes the new version to crates.io.

1. Run the ["Create release"](https://github.com/unyt-org/datex-core/actions/workflows/create-release.yml) workflow in Github.
* Specify whether you want to create a new major, minor, or patch release.
* The workflow will create a new release branch based on the current main branch, named `release/MAJOR.MINOR.PATCH` and also opens a Pull Request to merge the release branch into the main branch. The version number in the Cargo.toml file is also automatically updated to the new version.

2. Create feat, fix, chore, refactor, docs or test branches from the release branch to work on new features, bug fixes, etc.
* Command to create a new branch:
```sh
git fetch && git checkout -b feat/feature-name release/MAJOR.MINOR.PATCH
```
3. Create a Pull Request to merge the branch into the release branch when ready
4. When all features are merged into the release branch, close the Pull Request to merge the release branch into the main branch.
3 changes: 3 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ComHub

![ComHub diagram](./diagrams/com-hub.svg)
126 changes: 126 additions & 0 deletions docs/diagrams/com-hub.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<mxfile host="65bd71144e" scale="1" border="50">
<diagram id="OP293KcVoEOjrz7fZg2r" name="Page-1">
<mxGraphModel dx="1578" dy="884" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="900" pageHeight="1600" background="#ffffff" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="3" value="ComHub" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="310" y="260" width="230" height="210" as="geometry">
<mxRectangle x="250" y="110" width="90" height="30" as="alternateBounds"/>
</mxGeometry>
</mxCell>
<mxCell id="5" value="+ send_block(block: DXBBlock)" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="30" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="+ update()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="60" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="17" value="&lt;span style=&quot;white-space: pre;&quot;&gt;&#9;&lt;/span&gt;- receive_incoming_blocks()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="90" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="19" value="&lt;span style=&quot;&quot;&gt;&#9;&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&#9;&lt;/span&gt;-&amp;nbsp;update_sockets()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="120" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="18" value="&lt;span style=&quot;white-space: pre;&quot;&gt;&#9;&lt;/span&gt;- flush_outgoing_blocks()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="150" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="42" value="incoming_blocks: VecDeque&amp;lt;DXBBlock&amp;gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="3" vertex="1">
<mxGeometry y="180" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="ComInterfaceSocket" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="810" y="290" width="230" height="150" as="geometry"/>
</mxCell>
<mxCell id="8" value="queue_block(dxb: [u8])" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="7" vertex="1">
<mxGeometry y="30" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="9" value="get_incoming_block_queue()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="7" vertex="1">
<mxGeometry y="60" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="20" value="collect_incoming_data()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="7" vertex="1">
<mxGeometry y="90" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="35" value="send_queue: VecDeque&amp;lt;[u8]&amp;gt;" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="7" vertex="1">
<mxGeometry y="120" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="routing algorithm" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="5" target="8" edge="1">
<mxGeometry x="-0.2" relative="1" as="geometry">
<Array as="points">
<mxPoint x="770" y="335"/>
</Array>
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="12" value="*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fillOpacity=0;labelBackgroundColor=none;" parent="10" vertex="1" connectable="0">
<mxGeometry x="0.845" relative="1" as="geometry">
<mxPoint x="3" y="-5" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="19" target="20" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="22" value="*&lt;br&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;" parent="21" vertex="1" connectable="0">
<mxGeometry x="0.8604" y="2" relative="1" as="geometry">
<mxPoint x="-1" y="2" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="23" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;startArrow=classic;startFill=1;endArrow=none;endFill=0;dashed=1;" parent="1" source="17" target="9" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="26" value="incoming blocks queue" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="23" vertex="1" connectable="0">
<mxGeometry x="-0.2988" y="1" relative="1" as="geometry">
<mxPoint x="36" y="1" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="27" value="*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;" parent="23" vertex="1" connectable="0">
<mxGeometry x="0.7629" y="-3" relative="1" as="geometry">
<mxPoint x="12" y="-5" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="ComInterface" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="810" y="100" width="230" height="120" as="geometry"/>
</mxCell>
<mxCell id="29" value="flush_outgoing_blocks()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="28" vertex="1">
<mxGeometry y="30" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="30" value="get_incoming_block_queue()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="28" vertex="1">
<mxGeometry y="60" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="collect_incoming_data()" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="28" vertex="1">
<mxGeometry y="90" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="33" style="edgeStyle=orthogonalEdgeStyle;html=1;startArrow=none;startFill=0;endArrow=classic;endFill=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="18" target="29" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="760" y="140" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="34" value="*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;" parent="33" vertex="1" connectable="0">
<mxGeometry x="0.8611" y="1" relative="1" as="geometry">
<mxPoint x="18" y="-3" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="37" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;startArrow=none;startFill=0;endArrow=classic;endFill=1;dashed=1;" parent="1" source="35" target="29" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1090" y="425"/>
<mxPoint x="1090" y="145"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="38" value="*" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;" parent="37" vertex="1" connectable="0">
<mxGeometry x="-0.9291" relative="1" as="geometry">
<mxPoint x="-1" y="-3" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="41" style="edgeStyle=orthogonalEdgeStyle;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;startArrow=none;startFill=0;endArrow=classic;endFill=1;" parent="1" source="40" target="5" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="40" value="Runtime" style="whiteSpace=wrap;html=1;aspect=fixed;labelBackgroundColor=none;" parent="1" vertex="1">
<mxGeometry x="60" y="265" width="80" height="80" as="geometry"/>
</mxCell>
<mxCell id="43" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;startArrow=none;startFill=0;endArrow=classic;endFill=1;dashed=1;" parent="1" source="42" target="40" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
2 changes: 2 additions & 0 deletions docs/diagrams/com-hub.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading