Skip to content

ci: merge staging to master #27

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

Merged
merged 38 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
3747725
0.0.2-alpha.0
tegefaulkes May 23, 2023
a28bb9c
feat: updating `cargo.toml` and `package.json` before version commit …
tegefaulkes May 23, 2023
ff4c225
0.0.3-alpha.0
tegefaulkes May 23, 2023
a814c89
fix: `cargo.lock` is now updated as well
tegefaulkes May 23, 2023
7e08698
0.0.4-alpha.0
tegefaulkes May 23, 2023
dd13f2c
Merge pull request #29 from MatrixAI/feature-version_fix
tegefaulkes May 24, 2023
e853e94
0.0.5-alpha.0
tegefaulkes May 24, 2023
adc2417
fix: fix script failing due to non-existing directory
tegefaulkes May 24, 2023
7dfcfbd
0.0.6-alpha.0
tegefaulkes May 24, 2023
06b5609
fix: ignoring the `prebuild` and `prepublishOnly` directory when publ…
tegefaulkes May 24, 2023
9079f97
0.0.7-alpha.0
tegefaulkes May 24, 2023
286a006
chore: updated `console.error` in `scripts/version.js`
CMCDragonkai May 24, 2023
e019bcd
ci: updated mac runner jobs
tegefaulkes Jun 26, 2023
5693ef8
dep: updated `systeminformation` to `5.18.5`
tegefaulkes Jun 27, 2023
2ffa5ec
feat: initial refactor work
CMCDragonkai May 19, 2023
498f7aa
feat: applying monitor locking to serialize async events
tegefaulkes Jun 20, 2023
bacfc4d
tests: expanded native TLS tests to demonstrate custom connection fai…
tegefaulkes Jun 21, 2023
9b58b85
fix: general fixes and clean up
tegefaulkes Jun 21, 2023
442814e
tests: fixing up client tests
tegefaulkes Jun 23, 2023
b45cc22
fix: removing fixtures
tegefaulkes Jun 23, 2023
a2058cc
tests: fixing up tests
tegefaulkes Jun 23, 2023
1d55f12
dep: bump `@matrixai/async-init` to `1.8.4`
tegefaulkes Jun 23, 2023
9f6ae63
feat: added in secure establishment event
tegefaulkes Jun 23, 2023
225babf
feat: added `verifyCallback` and `verifyAllowFail`
tegefaulkes Jun 23, 2023
9cc653d
tests: fixing up client tests
tegefaulkes Jun 23, 2023
110034d
tests: creating native stream tests
tegefaulkes Jun 27, 2023
b1ea509
fix: small fixes
tegefaulkes Jun 27, 2023
6009eb2
feat: `QUICConnection` and `QUICClient` handles `ctx` and timeouts
tegefaulkes Jun 28, 2023
cea873b
tests: adding custom TLS verification tests
tegefaulkes Jun 28, 2023
968ae89
feat: applying `maxIdleTimeout` constraints for keep-alive and start …
tegefaulkes Jun 29, 2023
85b0375
tests: fixing up tests to match changes
tegefaulkes Jun 29, 2023
798014b
lint: fixing up linting errors
tegefaulkes Jun 29, 2023
30daec8
tests: expanding native stream tests
tegefaulkes Jun 29, 2023
242859c
fix: refactored and cleaned up
tegefaulkes Jul 3, 2023
ed6f3a3
fix: general logic fixes and clean up
tegefaulkes Jul 3, 2023
cbedc26
fix: cleaning up `Monitor` resources
tegefaulkes Jul 6, 2023
06bb0d9
Merge pull request #26 from MatrixAI/feature-key-gen
tegefaulkes Jul 6, 2023
3157537
bench: fixed benchmark
tegefaulkes Jul 6, 2023
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
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ build:macos:
stage: build
needs: []
tags:
- shared-macos-amd64
image: macos-11-xcode-12
- saas-macos-medium-m1
image: macos-12-xcode-14
variables:
# Produce universal binary
RUST_BACKTRACE: "1"
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
/benches
/build
/builds
/prebuild
/prepublishOnly
/dist/tsbuildinfo
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quic"
version = "0.0.1"
version = "0.0.7-alpha.0"
authors = ["Roger Qiu <[email protected]>"]
license-file = "LICENSE"
edition = "2021"
Expand Down
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,58 @@ npm publish --access public
git push
git push --tags
```

---

I need to be locked together.

These need to be atomic operations.

The only issue is that the "atomicity" is controlled outside of `QUICConnection` atm.

Whereas it seems to make sense to do this directly?

```
recieve
[IF IS DRAINING IS TRUE SKIP SEND]
send
[CLOSE] - we may be "closed here"
set-timeout
```

This would be triggered by:
* QUICStream
* keepAliveTimer
* after onTimeout

```
send
[CLOSE] - we may be "closed here"
set-timeout
```

Remember you may also "receive" and end up closing too. But you will always check if you need to send first before checking the close. At worst it will tell you it's done.

Now of course we enable calling recv and send.

But `send` actually ends up calling multiple things here.

But if `recv` is synchronous, you can always call it infront of `send`.

This technically means `send` should be encapsulating the logic of setting the timeout.

If you want to make sure it's re-entrant, you can just "lock" on the send call.

The setTimeout is then protected.

The `recv` call is made synchronously.



Receive Send Timer, Send Timer (all of this requires locking the conn lock)

Closing too, it should require the conn lock
Receive Send [Close] Timer, Send [Close] Timer
It's all optional
It's the send that has to do Send, Close, Timer... that's what needs to check it all
Forget about events for now
4 changes: 2 additions & 2 deletions benches/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import fs from 'fs';
import path from 'path';
import si from 'systeminformation';
import Stream1KB from './stream_1KB';
// import Dummy from './dummy';
// Import Dummy from './dummy';

async function main(): Promise<void> {
await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true });
// Running benches
await Stream1KB();
// await Dummy();
// Await Dummy();
const resultFilenames = await fs.promises.readdir(
path.join(__dirname, 'results'),
);
Expand Down
24 changes: 3 additions & 21 deletions benches/results/metrics.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
# TYPE dummy_ops gauge
dummy_ops{name="add 1 + 1"} 11776647
dummy_ops{name="subtract 1 - 1"} 11685857
dummy_ops{name="multiply 1 * 1"} 12000931
dummy_ops{name="divide 1 / 1"} 11857267

# TYPE dummy_margin gauge
dummy_margin{name="add 1 + 1"} 0.55
dummy_margin{name="subtract 1 - 1"} 0.95
dummy_margin{name="multiply 1 * 1"} 0.48
dummy_margin{name="divide 1 / 1"} 0.58

# TYPE dummy_samples counter
dummy_samples{name="add 1 + 1"} 84
dummy_samples{name="subtract 1 - 1"} 84
dummy_samples{name="multiply 1 * 1"} 85
dummy_samples{name="divide 1 / 1"} 83

# TYPE stream_1KB_ops gauge
stream_1KB_ops{name="send 1Kib of data"} 176
stream_1KB_ops{name="send 1Kib of data"} 214

# TYPE stream_1KB_margin gauge
stream_1KB_margin{name="send 1Kib of data"} 2.68
stream_1KB_margin{name="send 1Kib of data"} 0.95

# TYPE stream_1KB_samples counter
stream_1KB_samples{name="send 1Kib of data"} 76
stream_1KB_samples{name="send 1Kib of data"} 84
48 changes: 24 additions & 24 deletions benches/results/system.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"cpu": {
"manufacturer": "Intel",
"brand": "Xeon® E3-1241 v3",
"vendor": "Intel",
"family": "6",
"model": "60",
"stepping": "3",
"manufacturer": "AMD",
"brand": "Ryzen 7 5800X 8-Core Processor",
"vendor": "AMD",
"family": "25",
"model": "33",
"stepping": "0",
"revision": "",
"voltage": "",
"speed": 3.5,
"speedMin": 0.8,
"speedMax": 3.9,
"governor": "performance",
"cores": 8,
"physicalCores": 4,
"performanceCores": 4,
"speed": 3.8,
"speedMin": null,
"speedMax": null,
"governor": "",
"cores": 16,
"physicalCores": 8,
"performanceCores": 8,
"efficiencyCores": 0,
"processors": 1,
"socket": "",
"flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt dtherm ida arat pln pts md_clear flush_l1d",
"virtualization": true,
"flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves xsaveerptr arat vaes vpclmulqdq rdpid",
"virtualization": false,
"cache": {
"l1d": 131072,
"l1i": 131072,
"l2": 1048576,
"l3": 8388608
"l1d": 262144,
"l1i": 262144,
"l2": 4194304,
"l3": 33554432
}
},
"osInfo": {
"platform": "linux",
"distro": "nixos",
"release": "22.11",
"kernel": "5.10.177",
"distro": "Faulkes-Work",
"release": "unknown",
"kernel": "4.19.190",
"arch": "x64"
},
"system": {
"model": "P7 Pro SE",
"manufacturer": "EUROCOM"
"model": "Virtual Machine",
"manufacturer": "Microsoft Corporation"
}
}
43 changes: 18 additions & 25 deletions benches/stream_1KB.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type * as events from '../src/events';
import type { Host } from '../src/types';
import path from 'path';
import fs from 'fs';
import b from 'benny';
import Logger, { formatting, LogLevel, StreamHandler } from '@matrixai/logger';
import { suiteCommon } from './utils';
Expand All @@ -16,42 +15,32 @@ async function main() {
),
]);
// Setting up initial state
const crypto = {
key: await testsUtils.generateKey(),
ops: {
sign: testsUtils.sign,
verify: testsUtils.verify,
randomBytes: testsUtils.randomBytes,
},
};

const data1KiB = Buffer.alloc(1024, 0xf0);
const host = '127.0.0.1' as Host;
const certChainPem = await fs.promises.readFile(
path.resolve(path.join(__dirname), '../tests/fixtures/certs/rsa1.crt'),
);
const privKeyPem = await fs.promises.readFile(
path.resolve(path.join(__dirname), '../tests/fixtures/certs/rsa1.key'),
);
const tlsConfig = await testsUtils.generateConfig('RSA');

const quicServer = new QUICServer({
config: {
tlsConfig: {
privKeyPem: privKeyPem.toString(),
certChainPem: certChainPem.toString(),
},
key: tlsConfig.key,
cert: tlsConfig.cert,
verifyPeer: false,
keepAliveIntervalTime: 1000,
},
crypto: {
key: await testsUtils.generateKeyHMAC(),
ops: {
sign: testsUtils.signHMAC,
verify: testsUtils.verifyHMAC,
},
},
keepaliveIntervalTime: 1000,
crypto,
logger,
});
quicServer.addEventListener(
'connection',
'serverConnection',
async (e: events.QUICServerConnectionEvent) => {
const conn = e.detail;
conn.addEventListener(
'stream',
'connectionStream',
(streamEvent: events.QUICConnectionStreamEvent) => {
const stream = streamEvent.detail;
void Promise.allSettled([
Expand Down Expand Up @@ -80,7 +69,11 @@ async function main() {
host,
port: quicServer.port,
localHost: host,
crypto,
crypto: {
ops: {
randomBytes: testsUtils.randomBytes,
},
},
logger,
});

Expand Down
17 changes: 15 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,21 @@ module.exports = {
roots: ['<rootDir>/tests'],
testMatch: ['**/?(*.)+(spec|test|unit.test).+(ts|tsx|js|jsx)'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
"^.+\\.(t|j)sx?$": [
"@swc/jest",
{
jsc: {
parser: {
syntax: "typescript",
tsx: true,
decorators: compilerOptions.experimentalDecorators,
dynamicImport: true,
},
target: compilerOptions.target.toLowerCase(),
keepClassNames: true,
},
}
],
},
reporters: [
'default',
Expand Down
Loading