Skip to content

Commit 215228c

Browse files
refactor: batch ops (#1838)
* bump photon hash * refactor forester v2 processing * remove debug prints * cleanup * Set test environment variables for v1 and v2 test modes * add docs for process_stream function * fail-fast proof generation with recovery * spawn forester executing test transactions in e2e test * Add tmate debugging session to forester tests workflow * use new keypair for TestMode::Local in forester e2e tests * reduce rpc calls for v2 processing * add tmate to forester ci * remove tmate from forester tests ci * format * add get_registration_phase_start_slot utility function and update e2e test to use it * remove unused imports * update photon git commit reference in constants and install script * update photon commit hash * update photon commit hash * refactor: optimize batch processing and instruction streaming
1 parent a3d85fc commit 215228c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4703
-1816
lines changed

.github/workflows/forester-tests.yml

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ concurrency:
3030
env:
3131
RUST_BACKTRACE: "1"
3232
RUSTFLAGS: "--cfg tokio_unstable -D warnings"
33+
TEST_MODE: "local"
34+
TEST_V1_STATE: "true"
35+
TEST_V2_STATE: "true"
36+
TEST_V1_ADDRESS: "true"
37+
TEST_V2_ADDRESS: "true"
3338

3439
jobs:
3540
test:
@@ -38,41 +43,17 @@ jobs:
3843
test-name:
3944
[
4045
{
41-
name: "e2e",
42-
command: "test_state_indexer_async_batched",
46+
name: "e2e (legacy)",
47+
command: "test_e2e_v1",
4348
timeout: 60,
4449
needs-test-program: false,
4550
},
4651
{
47-
name: "address-batched",
48-
command: "test_address_batched",
52+
name: "e2e",
53+
command: "test_e2e_v2",
4954
timeout: 60,
5055
needs-test-program: true,
5156
},
52-
{
53-
name: "state-batched",
54-
command: "test_state_batched",
55-
timeout: 60,
56-
needs-test-program: false,
57-
},
58-
{
59-
name: "state-photon-batched",
60-
command: "test_state_indexer_batched",
61-
timeout: 60,
62-
needs-test-program: false,
63-
},
64-
{
65-
name: "2-foresters",
66-
command: "test_epoch_monitor_with_2_foresters",
67-
timeout: 60,
68-
needs-test-program: false,
69-
},
70-
{
71-
name: "double-registration",
72-
command: "test_epoch_double_registration",
73-
timeout: 60,
74-
needs-test-program: false,
75-
},
7657
]
7758
name: test-${{ matrix.test-name.name }}
7859
runs-on: warp-ubuntu-latest-x64-4x
@@ -117,6 +98,7 @@ jobs:
11798
run: |
11899
source ./scripts/devenv.sh
119100
cargo test-sbf -p create-address-test-program
101+
120102
- name: Run ${{ matrix.test-name.name }} tests
121103
run: |
122104
source ./scripts/devenv.sh

Cargo.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/utils/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const PHOTON_VERSION = "0.51.0";
2424
// Set these to override Photon requirements with a specific git commit:
2525
export const USE_PHOTON_FROM_GIT = true; // If true, will show git install command instead of crates.io.
2626
export const PHOTON_GIT_REPO = "https://github.com/lightprotocol/photon.git";
27-
export const PHOTON_GIT_COMMIT = "6ee3c027226ab9c90dc9d16691cdf76dd2f29dbf"; // If empty, will use main branch.
27+
export const PHOTON_GIT_COMMIT = "c938ee83ad1b34abc389943334627a899da72953"; // If empty, will use main branch.
2828

2929
export const LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
3030
export const BASE_PATH = "../../bin/";

forester-utils/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ account-compression = { workspace = true, features = ["cpi"] }
3434

3535
tokio = { workspace = true }
3636
futures = { workspace = true }
37+
async-stream = "0.3"
3738

3839
anchor-lang = { workspace = true }
3940

forester-utils/src/error.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
use light_batched_merkle_tree::errors::BatchedMerkleTreeError;
2+
use light_hasher::HasherError;
13
use thiserror::Error;
24

5+
use crate::rpc_pool::PoolError;
6+
37
#[derive(Error, Debug)]
48
pub enum ForesterUtilsError {
59
#[error("parse error: {0:?}")]
@@ -12,4 +16,18 @@ pub enum ForesterUtilsError {
1216
Indexer(String),
1317
#[error("invalid slot number")]
1418
InvalidSlotNumber,
19+
#[error("Hasher error: {0}")]
20+
Hasher(#[from] HasherError),
21+
22+
#[error("Account zero-copy error: {0}")]
23+
AccountZeroCopy(String),
24+
25+
#[error("light client error: {0}")]
26+
LightClient(#[from] light_client::rpc::RpcError),
27+
28+
#[error("batched merkle tree error: {0}")]
29+
BatchedMerkleTree(#[from] BatchedMerkleTreeError),
30+
31+
#[error("pool error: {0}")]
32+
Pool(#[from] PoolError),
1533
}

0 commit comments

Comments
 (0)