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

Prod Release 17/01/24 #513

Merged
merged 37 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3317b21
fix: upgrade eslint-config-next from 13.1.6 to 13.5.3
snyk-bot Oct 21, 2023
d83396c
feat: Make log/state Hasura tables `backend_only` (#462)
morgsmccauley Dec 20, 2023
e63024a
fix: Prune Unnecessary Logs (#465)
darunrs Dec 20, 2023
38ea895
feat: Runner gRPC endpoint (#446)
darunrs Dec 21, 2023
a6c43d0
feat: Create function to validate types and format from SQL schema
Jan 3, 2024
fb96993
refactor: Reduce the error states and remove unnecessary Alerts
Jan 3, 2024
12bdb26
refactor: Debounce the schema validation
Jan 3, 2024
7f6d07c
chore: Create __tests__ folder for improved folder structure
Jan 3, 2024
dfcd365
Merge pull request #312 from near/snyk-upgrade-3314477209d6a8eada3c91…
jl-santana Jan 3, 2024
a829917
Merge branch 'main' into feat/editor-error-logging
Jan 3, 2024
314dc2c
Merge pull request #480 from near/feat/editor-error-logging
jl-santana Jan 3, 2024
ed72374
feat: Add created/updated at block heights to registry (#458)
morgsmccauley Jan 4, 2024
313ccbe
remove side effects from reformatAll function
Jan 4, 2024
d333b84
refactor: make codeValidation reusable and separate concerns in refor…
Jan 4, 2024
efb5bde
refactor: separate concern con useEffect, and react separately to cha…
Jan 4, 2024
e43d57e
fix: remove dead code
Jan 4, 2024
fabed5c
refactor: Replace requestLatestBlockHeight with direct getLatestBlock…
Jan 4, 2024
ae8315e
refactor: Replace requestLatestBlockHeight with direct getLatestBlock…
Jan 4, 2024
c342947
Merge branch 'fix/load-schema-from-registry' of github.com:near/query…
Jan 4, 2024
1dcdb3b
refactor: only validate schemas different from the default
Jan 5, 2024
f844da0
refactor: remove log
Jan 5, 2024
3715782
fix: fix issue when generating types, based on response type from ast…
Jan 5, 2024
ed08165
refactor: decouple ResizableLayourEditor from Editor
Jan 5, 2024
55cbb72
chore: Add description to function
Jan 5, 2024
83c861d
fix: change reference to variable
Jan 5, 2024
8634c39
refactor: Make error messages constants
Jan 5, 2024
b1e0a5f
fix: Solve an issue on the reformatAll function, also added real-time…
Jan 5, 2024
538cd39
fix: Reset errors if code/schemar are ok when reloading
Jan 6, 2024
b486ced
Merge pull request #489 from near/fix/load-schema-from-registry
jl-santana Jan 8, 2024
7655aef
feat: Create rust GRPC client for Runner (#491)
morgsmccauley Jan 8, 2024
b76fac0
feat: Create initial Coordinator V2 service (#444)
morgsmccauley Jan 11, 2024
81edb7e
Improve code/schema validation before registering (#495)
jl-santana Jan 11, 2024
c4f47bf
refactor: Remove hard-coded shard count (#502)
morgsmccauley Jan 16, 2024
13f7094
fix: Ensure array is returned to `Promise.all` (#504)
morgsmccauley Jan 16, 2024
a4d8c34
refactor: Configure `coordinator`/`block-streamer` via environment (#…
morgsmccauley Jan 16, 2024
d403006
feat: Toggle Runner Version (#488)
darunrs Jan 17, 2024
420405b
fix: Resolve Proto File Not Found Build Error (#514)
darunrs Jan 17, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/block-streamer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
working-directory: ./block-streamer
run: cargo check
Expand All @@ -29,6 +31,8 @@ jobs:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
working-directory: ./block-streamer
run: cargo test
Expand All @@ -41,6 +45,8 @@ jobs:
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -60,6 +66,8 @@ jobs:
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/coordinator-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Coordinator

on:
push:
branches: [ main ]
paths:
- "coordinator/**"
pull_request:
paths:
- "coordinator/**"

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
working-directory: ./coordinator
run: cargo check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
working-directory: ./coordinator
run: cargo test


format:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
profile: minimal
components: rustfmt
- name: Check formatting
working-directory: ./coordinator
run: |
cargo fmt -- --check
clippy:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.70.0
override: true
profile: minimal
components: clippy
- name: Clippy check
working-directory: ./coordinator
run: |
cargo clippy
16 changes: 6 additions & 10 deletions block-server/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,16 @@ const normalizeBlockHeight = function(block_height) {
}

const fetchStreamerMessage = async function(block_height, options) {
const blockPromise = fetchBlockPromise(block_height, options);
// hardcoding 4 shards to test performance
const shardsPromises = await fetchShardsPromises(block_height, 4, options); // block.chunks.length)
const block = await fetchBlockPromise(block_height, options);
const shards = await Promise.all(fetchShardsPromises(block_height, block.chunks.length, options))

const results = await Promise.all([blockPromise, ...shardsPromises]);
const block = results.shift();
const shards = results;
return {
block: block,
shards: shards,
block,
shards,
};
}

const fetchShardsPromises = async function(block_height, number_of_shards, options) {
const fetchShardsPromises = function(block_height, number_of_shards, options) {
return ([...Array(number_of_shards).keys()].map((shard_id) =>
fetchShardPromise(block_height, shard_id, options)));
}
Expand Down Expand Up @@ -101,4 +97,4 @@ const renameUnderscoreFieldsToCamelCase = function(value) {
return newValue;
}
return value;
}
}
4 changes: 2 additions & 2 deletions block-streamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ tokio-stream = "0.1.14"
tonic = "0.10.2"
wildmatch = "2.1.1"

registry-types = { path = "../registry/types" }
registry-types = { path = "../registry/types", features = ["near-primitives"] }

near-lake-framework = "0.7.4"
near-lake-framework = "=0.7.4"

[build-dependencies]
tonic-build = "0.10"
Expand Down
2 changes: 2 additions & 0 deletions block-streamer/examples/start_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
start_block_height: 106700000,
account_id: "morgs.near".to_string(),
function_name: "test".to_string(),
version: 0,
redis_stream: "morgs.near/test:block_stream".to_string(),
rule: Some(Rule::ActionAnyRule(ActionAnyRule {
affected_account_id: "social.near".to_string(),
status: Status::Success.into(),
Expand Down
69 changes: 38 additions & 31 deletions block-streamer/proto/block_streamer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,52 @@ syntax = "proto3";

package blockstreamer;

// The BlockStreamer service provides RPCs to manage BlockStream instances.
// The BlockStreamer service provides RPCs to manage BlockStream instances
service BlockStreamer {
// Starts a new BlockStream process.
// Starts a new BlockStream process
rpc StartStream (StartStreamRequest) returns (StartStreamResponse);

// Stops an existing BlockStream process.
// Stops an existing BlockStream process
rpc StopStream (StopStreamRequest) returns (StopStreamResponse);

// Lists all current BlockStream processes.
// Lists all current BlockStream processes
rpc ListStreams (ListStreamsRequest) returns (ListStreamsResponse);
}

// Request message for starting a BlockStream.
// Request message for starting a BlockStream
message StartStreamRequest {
// Which block height to start from.
// Which block height to start from
uint64 start_block_height = 1;
// The account ID which the indexer is defined under
// Account ID which the indexer is defined under
string account_id = 2;
// The name of the indexer
// Name of the indexer
string function_name = 3;
// The filter rule to apply to incoming blocks
// Block height corresponding to the created/updated height of the indexer
uint64 version = 4;
// Key of Redis Stream to publish blocks to
string redis_stream = 5;
// Filter rule to apply to incoming blocks
oneof rule {
ActionAnyRule action_any_rule = 4;
ActionFunctionCallRule action_function_call_rule = 5;
ActionAnyRule action_any_rule = 6;
ActionFunctionCallRule action_function_call_rule = 7;
}
}

// Match any action against the specified account
message ActionAnyRule {
// The account ID pattern to match against
// Account ID pattern to match against
string affected_account_id = 1;
// The status of the action to match against
// Status of the action to match against
Status status = 2;
}

// Match a specific function call against the specified account
message ActionFunctionCallRule {
// The account ID pattern to match against
// Account ID pattern to match against
string affected_account_id = 1;
// The function name to match against
// Function name to match against
string function_name = 2;
// The status of the action to match against
// Status of the action to match against
Status status = 3;
}

Expand All @@ -54,40 +58,43 @@ enum Status {
STATUS_ANY = 3;
}

// Response message for starting a BlockStream.
// Response message for starting a BlockStream
message StartStreamResponse {
// ID or handle of the started BlockStream.
// ID or handle of the started BlockStream
string stream_id = 1;
}

// Request message for stopping a BlockStream.
// Request message for stopping a BlockStream
message StopStreamRequest {
// ID or handle of the BlockStream to stop.
// ID or handle of the BlockStream to stop
string stream_id = 1;
}

// Response message for stopping a BlockStream.
// Response message for stopping a BlockStream
message StopStreamResponse {
// Confirmation message or status.
// Confirmation message or status
string status = 1;
}

// Request message for listing BlockStreams.
// Request message for listing BlockStreams
message ListStreamsRequest {
// Optional filters or parameters for listing streams.
// Optional filters or parameters for listing streams
}

// Response message for listing BlockStreams.
// Response message for listing BlockStreams
message ListStreamsResponse {
// List of active BlockStreams.
// List of active BlockStreams
repeated StreamInfo streams = 1;
}

// Information about a single BlockStream instance.
// Information about a single BlockStream instance
message StreamInfo {
// ID or handle of the BlockStream
string stream_id = 1;
int64 start_block_height = 2;
string indexer_name = 3;
string chain_id = 4;
string status = 5;
// Account ID of the indexer
string account_id = 3;
// Function name of the indexer
string function_name = 4;
// Block height corresponding to the created/updated height of the indexer
uint64 version = 5;
}
Loading
Loading