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

Protocol based on serde #2161

Open
wants to merge 60 commits into
base: master
Choose a base branch
from

Conversation

DmitryAstafyev
Copy link
Collaborator

Implementation of protocol for communication between rust and nodejs based on serde + bincode.

@DmitryAstafyev DmitryAstafyev marked this pull request as draft November 28, 2024 07:39
@DmitryAstafyev DmitryAstafyev force-pushed the binary_protocol branch 2 times, most recently from f8aa677 to e005959 Compare December 6, 2024 23:54
@DmitryAstafyev DmitryAstafyev marked this pull request as ready for review December 23, 2024 11:32
Copy link
Member

@AmmarAbouZor AmmarAbouZor left a comment

Choose a reason for hiding this comment

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

This looks great 👏

I've found minor issues and added some suggestions.

I'll provide the needed changes on the build CLI tool once the other PR is merged and master is merged here.

There is another point about Macros Hygiene that can be adjusted (optionally since the macro are for internal use only). But if we want to make the macro hygiene we may need to use full paths on every type inside the macros up to $crate:: for crate types or ::std:: for rust standard library types

application/apps/indexer/stypes/Cargo.toml Show resolved Hide resolved
application/apps/indexer/stypes/Cargo.toml Outdated Show resolved Hide resolved
application/apps/indexer/stypes/src/progress/extending.rs Outdated Show resolved Hide resolved
application/apps/protocol/src/err.rs Show resolved Hide resolved
cd ../../rustcore/ts-bindings
rm -rf ./node_modules
rm -rf ./spec/build
rake bindings:test:protocol
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to replace this rake call with a function on the build CLI tool before merging or directly after that, to avoid the dependency on Ruby tooling

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, sure... will do it as soon as build cli will be updated

Copy link
Member

@AmmarAbouZor AmmarAbouZor left a comment

Choose a reason for hiding this comment

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

This looks amazing, great job! 💯

I'll provide the needed implementation on the build CLI tool and add them to this PR ASAP

* Adjust dependencies resolving to include protocol build on test jobs.
* Add unit test to ensure involved targets are built on bindings tests.
* Adjust integration tests accordingly.
@AmmarAbouZor
Copy link
Member

  • Changes on the Build CLI to include building protocol on test commands are implemented
  • Unit tests are extended to ensure needed build jobs are included on test commands
  • Integration tests are adjusted to ensure that protocol is built and cleaned properly
  • Temp fix in CI check is removed
  • Generated ts files are included as well since they will be rewritten on every build run and the automatic formatting and comments will be rewritten

CI is failing now because it still using the previous Tool version and not using the latest one. link
@itsmesamster Could you please have a look on it?

Remove temp fix from GitHub action after fixing the main issue in
build CLI tool
* Generate typescript files only on running tests with feature
  `test_and_gen` activated.
The same feature `test_and_gen` is used for both generating types and
running prop tests. By marking prop tests as ignored we are able to
generate the files without running the extensive prop tests
@AmmarAbouZor
Copy link
Member

@DmitryAstafyev I've fixed generating typescript files on each test call by adding the feature test_and_gen to the conditional attributes, changing cfg_attr(test,...) to cfg_attr( all(test, feature = "test_and_gen"), on each type

Then I ran into an issue that the prop tests will be triggered each time we want to generate new types, so I marked them is ignored to be ran explicitly with the --ignored flag on cargo test. Alternatively, we can introduce another feature prop_tests and run the tests on it.

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.

2 participants