Skip to content

Commit 94727b6

Browse files
committed
Revert "intense logging for cis"
This reverts commit e187a5c.
1 parent e187a5c commit 94727b6

File tree

12 files changed

+108
-766
lines changed

12 files changed

+108
-766
lines changed

.github/actions/run-test-runner/action.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ inputs:
1717
description: "Force refresh of test accounts"
1818
required: false
1919
default: "false"
20-
capture-kora-logs:
21-
description: "Capture and display Kora RPC server logs during test execution"
22-
required: false
23-
default: "true"
24-
verbose-kora-logs:
25-
description: "Enable maximum verbosity for Kora logs (requires capture-kora-logs)"
26-
required: false
27-
default: "false"
2820

2921
runs:
3022
using: "composite"
@@ -45,12 +37,6 @@ runs:
4537
if [ "${{ inputs.rpc-url }}" != "http://127.0.0.1:8899" ]; then
4638
ARGS="$ARGS --rpc-url ${{ inputs.rpc-url }}"
4739
fi
48-
if [ "${{ inputs.capture-kora-logs }}" = "true" ]; then
49-
ARGS="$ARGS --capture-kora-logs"
50-
fi
51-
if [ "${{ inputs.verbose-kora-logs }}" = "true" ]; then
52-
ARGS="$ARGS --verbose-kora-logs"
53-
fi
5440
5541
# Add filters
5642
ARGS="$ARGS ${{ inputs.filters }}"

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
env:
2828
CARGO_TERM_COLOR: always
29-
RUST_LOG: error
29+
RUST_LOG: info
3030
CI: true
3131

3232
jobs:

crates/lib/src/rpc_server/method/estimate_transaction_fee.rs

Lines changed: 12 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -45,124 +45,40 @@ pub async fn estimate_transaction_fee(
4545
rpc_client: &Arc<RpcClient>,
4646
request: EstimateTransactionFeeRequest,
4747
) -> Result<EstimateTransactionFeeResponse, KoraError> {
48-
log::error!("RPC Method: estimateTransactionFee - Entry: transaction_len={}, fee_token={:?}, signer_key={:?}, sig_verify={}",
49-
request.transaction.len(), request.fee_token, request.signer_key, request.sig_verify);
50-
51-
let transaction = match TransactionUtil::decode_b64_transaction(&request.transaction) {
52-
Ok(tx) => {
53-
log::error!("Transaction decoded successfully: signatures={}", tx.signatures.len());
54-
tx
55-
}
56-
Err(e) => {
57-
log::error!("Transaction decode failed: {e}");
58-
return Err(e);
59-
}
60-
};
61-
62-
let signer = match get_request_signer_with_signer_key(request.signer_key.as_deref()) {
63-
Ok(s) => {
64-
log::error!("Signer obtained: pubkey={}", s.solana_pubkey());
65-
s
66-
}
67-
Err(e) => {
68-
log::error!("Failed to get signer: {e}");
69-
return Err(e);
70-
}
71-
};
48+
let transaction = TransactionUtil::decode_b64_transaction(&request.transaction)?;
7249

73-
let config = match get_config() {
74-
Ok(c) => {
75-
log::error!("Config loaded successfully");
76-
c
77-
}
78-
Err(e) => {
79-
log::error!("Failed to get config: {e}");
80-
return Err(e);
81-
}
82-
};
83-
84-
let fee_payer = signer.solana_pubkey();
85-
let payment_destination = match config.kora.get_payment_address(&fee_payer) {
86-
Ok(addr) => {
87-
log::error!("Payment destination: {addr}");
88-
addr
89-
}
90-
Err(e) => {
91-
log::error!("Failed to get payment destination: {e}");
92-
return Err(e);
93-
}
94-
};
50+
let signer = get_request_signer_with_signer_key(request.signer_key.as_deref())?;
51+
let config = get_config()?;
52+
let payment_destination = config.kora.get_payment_address(&signer.solana_pubkey())?;
9553

9654
let validation_config = &config.validation;
97-
log::error!(
98-
"Validation config: payment_required={}, price_source={:?}",
99-
validation_config.is_payment_required(),
100-
validation_config.price_source
101-
);
55+
let fee_payer = signer.solana_pubkey();
10256

103-
log::error!("Resolving transaction with lookup tables");
104-
let mut resolved_transaction = match VersionedTransactionResolved::from_transaction(
57+
let mut resolved_transaction = VersionedTransactionResolved::from_transaction(
10558
&transaction,
10659
rpc_client,
10760
request.sig_verify,
10861
)
109-
.await
110-
{
111-
Ok(resolved) => {
112-
log::error!(
113-
"Transaction resolved successfully: total_accounts={}, total_instructions={}",
114-
resolved.all_account_keys.len(),
115-
resolved.all_instructions.len()
116-
);
117-
resolved
118-
}
119-
Err(e) => {
120-
log::error!("Transaction resolution failed: {e}");
121-
return Err(e);
122-
}
123-
};
62+
.await?;
12463

125-
log::error!("Estimating Kora fee");
126-
let fee_calculation = match FeeConfigUtil::estimate_kora_fee(
64+
let fee_calculation = FeeConfigUtil::estimate_kora_fee(
12765
rpc_client,
12866
&mut resolved_transaction,
12967
&fee_payer,
13068
validation_config.is_payment_required(),
13169
Some(validation_config.price_source.clone()),
13270
)
133-
.await
134-
{
135-
Ok(calc) => {
136-
log::error!("Fee estimation complete: total_fee_lamports={}", calc.total_fee_lamports);
137-
calc
138-
}
139-
Err(e) => {
140-
log::error!("Fee estimation failed: {e}");
141-
return Err(e);
142-
}
143-
};
71+
.await?;
14472

14573
let fee_in_lamports = fee_calculation.total_fee_lamports;
14674

147-
log::error!("Calculating fee in token if requested");
148-
let fee_in_token = match FeeConfigUtil::calculate_fee_in_token(
75+
// Calculate fee in token if requested
76+
let fee_in_token = FeeConfigUtil::calculate_fee_in_token(
14977
rpc_client,
15078
fee_in_lamports,
15179
request.fee_token.as_deref(),
15280
)
153-
.await
154-
{
155-
Ok(token_fee) => {
156-
log::error!("Token fee calculation result: {token_fee:?}");
157-
token_fee
158-
}
159-
Err(e) => {
160-
log::error!("Token fee calculation failed: {e}");
161-
return Err(e);
162-
}
163-
};
164-
165-
log::error!("RPC Method: estimateTransactionFee - Success: fee_in_lamports={fee_in_lamports}, fee_in_token={fee_in_token:?}");
81+
.await?;
16682

16783
Ok(EstimateTransactionFeeResponse {
16884
fee_in_lamports,

crates/lib/src/rpc_server/method/get_blockhash.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,10 @@ pub struct GetBlockhashResponse {
1111
}
1212

1313
pub async fn get_blockhash(rpc_client: &RpcClient) -> Result<GetBlockhashResponse, KoraError> {
14-
log::error!("RPC Method: getBlockhash - Entry: commitment=confirmed");
15-
16-
let blockhash = match rpc_client
14+
let blockhash = rpc_client
1715
.get_latest_blockhash_with_commitment(CommitmentConfig::confirmed())
1816
.await
19-
{
20-
Ok(result) => {
21-
log::error!(
22-
"Blockhash retrieved successfully: {}, context_slot={}",
23-
result.0,
24-
result.1
25-
);
26-
result
27-
}
28-
Err(e) => {
29-
log::error!("Failed to get blockhash: {e}");
30-
return Err(KoraError::RpcError(e.to_string()));
31-
}
32-
};
33-
34-
log::error!("RPC Method: getBlockhash - Success: blockhash={}", blockhash.0);
17+
.map_err(|e| KoraError::RpcError(e.to_string()))?;
3518
Ok(GetBlockhashResponse { blockhash: blockhash.0.to_string() })
3619
}
3720

crates/lib/src/rpc_server/method/sign_and_send_transaction.rs

Lines changed: 8 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -33,78 +33,22 @@ pub async fn sign_and_send_transaction(
3333
rpc_client: &Arc<RpcClient>,
3434
request: SignAndSendTransactionRequest,
3535
) -> Result<SignAndSendTransactionResponse, KoraError> {
36-
log::error!("RPC Method: signAndSendTransaction - Entry: transaction_len={}, signer_key={:?}, sig_verify={}",
37-
request.transaction.len(), request.signer_key, request.sig_verify);
38-
39-
let transaction = match TransactionUtil::decode_b64_transaction(&request.transaction) {
40-
Ok(tx) => {
41-
log::error!("Transaction decoded successfully: signatures={}", tx.signatures.len());
42-
tx
43-
}
44-
Err(e) => {
45-
log::error!("Transaction decode failed: {e}");
46-
return Err(e);
47-
}
48-
};
36+
let transaction = TransactionUtil::decode_b64_transaction(&request.transaction)?;
4937

50-
log::error!("Checking usage limit for transaction sender");
51-
if let Err(e) = UsageTracker::check_transaction_usage_limit(&transaction).await {
52-
log::error!("Usage limit check failed: {e}");
53-
return Err(e);
54-
}
55-
log::error!("Usage limit check passed");
56-
57-
let signer = match get_request_signer_with_signer_key(request.signer_key.as_deref()) {
58-
Ok(s) => {
59-
log::error!("Signer obtained: pubkey={}", s.solana_pubkey());
60-
s
61-
}
62-
Err(e) => {
63-
log::error!("Failed to get signer: {e}");
64-
return Err(e);
65-
}
66-
};
38+
// Check usage limit for transaction sender
39+
UsageTracker::check_transaction_usage_limit(&transaction).await?;
40+
41+
let signer = get_request_signer_with_signer_key(request.signer_key.as_deref())?;
6742

68-
log::error!("Resolving transaction with lookup tables");
69-
let mut resolved_transaction = match VersionedTransactionResolved::from_transaction(
43+
let mut resolved_transaction = VersionedTransactionResolved::from_transaction(
7044
&transaction,
7145
rpc_client,
7246
request.sig_verify,
7347
)
74-
.await
75-
{
76-
Ok(resolved) => {
77-
log::error!(
78-
"Transaction resolved successfully: total_accounts={}, total_instructions={}",
79-
resolved.all_account_keys.len(),
80-
resolved.all_instructions.len()
81-
);
82-
resolved
83-
}
84-
Err(e) => {
85-
log::error!("Transaction resolution failed: {e}");
86-
return Err(e);
87-
}
88-
};
48+
.await?;
8949

90-
log::error!("Signing and sending transaction");
9150
let (signature, signed_transaction) =
92-
match resolved_transaction.sign_and_send_transaction(&signer, rpc_client).await {
93-
Ok((sig, tx)) => {
94-
log::error!("Transaction signed and sent successfully: signature={sig}");
95-
(sig, tx)
96-
}
97-
Err(e) => {
98-
log::error!("Sign and send transaction failed: {e}");
99-
return Err(e);
100-
}
101-
};
102-
103-
log::error!(
104-
"RPC Method: signAndSendTransaction - Success: signature={}, signer_pubkey={}",
105-
signature,
106-
signer.solana_pubkey()
107-
);
51+
resolved_transaction.sign_and_send_transaction(&signer, rpc_client).await?;
10852

10953
Ok(SignAndSendTransactionResponse {
11054
signature,

crates/lib/src/rpc_server/method/sign_transaction.rs

Lines changed: 10 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -33,88 +33,27 @@ pub async fn sign_transaction(
3333
rpc_client: &Arc<RpcClient>,
3434
request: SignTransactionRequest,
3535
) -> Result<SignTransactionResponse, KoraError> {
36-
log::error!(
37-
"RPC Method: signTransaction - Entry: transaction_len={}, signer_key={:?}, sig_verify={}",
38-
request.transaction.len(),
39-
request.signer_key,
40-
request.sig_verify
41-
);
42-
43-
let transaction = match TransactionUtil::decode_b64_transaction(&request.transaction) {
44-
Ok(tx) => {
45-
log::error!("Transaction decoded successfully: signatures={}", tx.signatures.len());
46-
tx
47-
}
48-
Err(e) => {
49-
log::error!("Transaction decode failed: {e}");
50-
return Err(e);
51-
}
52-
};
36+
let transaction = TransactionUtil::decode_b64_transaction(&request.transaction)?;
5337

54-
log::error!("Checking usage limit for transaction sender");
55-
if let Err(e) = UsageTracker::check_transaction_usage_limit(&transaction).await {
56-
log::error!("Usage limit check failed: {e}");
57-
return Err(e);
58-
}
59-
log::error!("Usage limit check passed");
60-
61-
let signer = match get_request_signer_with_signer_key(request.signer_key.as_deref()) {
62-
Ok(s) => {
63-
log::error!("Signer obtained: pubkey={}", s.solana_pubkey());
64-
s
65-
}
66-
Err(e) => {
67-
log::error!("Failed to get signer: {e}");
68-
return Err(e);
69-
}
70-
};
38+
// Check usage limit for transaction sender
39+
UsageTracker::check_transaction_usage_limit(&transaction).await?;
40+
41+
let signer = get_request_signer_with_signer_key(request.signer_key.as_deref())?;
7142

72-
log::error!("Resolving transaction with lookup tables");
73-
let mut resolved_transaction = match VersionedTransactionResolved::from_transaction(
43+
let mut resolved_transaction = VersionedTransactionResolved::from_transaction(
7444
&transaction,
7545
rpc_client,
7646
request.sig_verify,
7747
)
78-
.await
79-
{
80-
Ok(resolved) => {
81-
log::error!(
82-
"Transaction resolved successfully: total_accounts={}, total_instructions={}",
83-
resolved.all_account_keys.len(),
84-
resolved.all_instructions.len()
85-
);
86-
resolved
87-
}
88-
Err(e) => {
89-
log::error!("Transaction resolution failed: {e}");
90-
return Err(e);
91-
}
92-
};
48+
.await?;
9349

94-
log::error!("Signing transaction (without sending)");
95-
let (signed_transaction, signature_str) =
96-
match resolved_transaction.sign_transaction(&signer, rpc_client).await {
97-
Ok((tx, sig)) => {
98-
log::error!("Transaction signed successfully: signature={sig}");
99-
(tx, sig)
100-
}
101-
Err(e) => {
102-
log::error!("Transaction signing failed: {e}");
103-
return Err(e);
104-
}
105-
};
50+
let (signed_transaction, _) =
51+
resolved_transaction.sign_transaction(&signer, rpc_client).await?;
10652

107-
log::error!("Encoding signed transaction to base64");
10853
let encoded = TransactionUtil::encode_versioned_transaction(&signed_transaction);
10954

110-
log::error!(
111-
"RPC Method: signTransaction - Success: signature={}, signer_pubkey={}",
112-
signature_str,
113-
signer.solana_pubkey()
114-
);
115-
11655
Ok(SignTransactionResponse {
117-
signature: signature_str,
56+
signature: transaction.signatures[0].to_string(),
11857
signed_transaction: encoded,
11958
signer_pubkey: signer.solana_pubkey().to_string(),
12059
})

0 commit comments

Comments
 (0)