Skip to content

Commit

Permalink
Merge branch 'test/large-messages' into 'dev'
Browse files Browse the repository at this point in the history
Add large message sending test package

See merge request ergo/rosen-bridge/rosenet!29
  • Loading branch information
vorujack committed Jun 27, 2024
2 parents 0f22714 + 17d847a commit 2aa4234
Show file tree
Hide file tree
Showing 18 changed files with 775 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/brave-cows-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
5 changes: 5 additions & 0 deletions .changeset/pink-cherries-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rosen-bridge/rosenet-utils': patch
---

Fix issue of trying to format non-string values in `convertToPrintfFormat`
3 changes: 2 additions & 1 deletion .github/workflows/scaling-test-docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
paths:
- packages/**
- tests/scaling**
- .github/workflows/scaling-test-docker-release.yml

jobs:
build:
strategy:
matrix:
role: [node, relay]
test-name: ['', peer-discovery, pubsub]
test-name: ['', peer-discovery, pubsub, large-messages]

name: Build and Push Scaling Test Docker Image
permissions: write-all
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions packages/utils/lib/logger/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { format as utilFormat } from 'node:util';

import { ComponentLogger, Logger } from '@libp2p/interface';
import { AbstractLogger, DummyLogger } from '@rosen-bridge/logger-interface';

Expand All @@ -11,9 +13,13 @@ import format from './format';
*/
const convertToPrintfFormat =
(name: string, logger: AbstractLogger, level: 'info' | 'error' | 'debug') =>
(formatter: string, ...rest: unknown[]) => {
const formatted = format(formatter, ...rest);
logger[level](`[${name}] ${formatted}`);
(formatter: unknown, ...rest: unknown[]) => {
if (typeof formatter === 'string') {
const formatted = format(formatter, ...rest);
logger[level](`[${name}] ${formatted}`);
} else {
logger[level](`[${name}] ${utilFormat(formatter, ...rest)}`);
}
};

/**
Expand Down
1 change: 1 addition & 0 deletions specs/system-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Implementation status:
| 🏁 | Monitoring & Analytics | Tracks connected nodes, relays, messaging rates, etc. |
| 🏁 | Message Routing | [To be determined] |
| 🚧 | Burst Messaging | [To be determined] |
|| Sending Large Messages | Delivery of messages up to 100kB guaranteed |
| 🏁 | Idle Network State | [To be determined] |

### Unsupported Features:
Expand Down
1 change: 1 addition & 0 deletions tests/scaling-large-messages/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
24 changes: 24 additions & 0 deletions tests/scaling-large-messages/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tests/scaling-large-messages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# RoseNet scaling large messages test

## Table of contents

- [Introduction](#introduction)
- [Usage](#usage)

## Introduction

RoseNet scaling large messages test

## Usage

You need to have [OpenTofu](https://opentofu.org/) installed. Then, after
[passing required variables](https://opentofu.org/docs/language/values/variables/#assigning-values-to-root-module-variables) (defined in [`variables.tf`](./variables.tf)),
run the following commands. It should complete with no errors.

```bash
tofu init
tofu apply
```

Finally run `tofu destroy` to destroy the infrastructure.
Loading

0 comments on commit 2aa4234

Please sign in to comment.