-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77e2439
commit ab1396d
Showing
9 changed files
with
94 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Agave Implementations | ||
|
||
``` | ||
runtime | ||
|-- svm | ||
|-- program-cache | ||
|-- sysvar-cache | ||
validator | ||
|-- runtime | ||
|-- svm | ||
|-- program-cache | ||
|-- sysvar-cache | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use { | ||
solana_runtime::specification::TransactionBatch, | ||
solana_sdk::transaction::{self, SanitizedTransaction}, | ||
std::borrow::Cow, | ||
}; | ||
|
||
/// A transaction batch, as defined by the Agave Validator Runtime. | ||
pub struct AgaveTransactionBatch<'a> { | ||
pub lock_results: Vec<transaction::Result<()>>, | ||
pub sanitized_txs: Cow<'a, [SanitizedTransaction]>, | ||
pub needs_unlock: bool, | ||
} | ||
|
||
impl TransactionBatch for AgaveTransactionBatch<'_> { | ||
fn sanitized_txs(&self) -> &[SanitizedTransaction] { | ||
&self.sanitized_txs | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[package] | ||
name = "agave-validator" | ||
description = "Agave Validator" | ||
version = { workspace = true } | ||
authors = { workspace = true } | ||
repository = { workspace = true } | ||
homepage = { workspace = true } | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
|
||
[dependencies] | ||
agave-program-cache = { path = "../program-cache" } | ||
agave-runtime = { path = "../runtime" } | ||
agave-svm = { path = "../svm" } | ||
solana-svm = { path = "../../solana/svm" } | ||
solana-sdk = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Agave Validator. | ||
|
||
mod callbacks; | ||
|
||
use { | ||
crate::callbacks::AgaveValidatorRuntimeTransactionProcessingCallback, | ||
agave_program_cache::ForkGraph, agave_runtime::AgaveValidatorRuntime, | ||
agave_svm::AgaveTransactionBatchProcessor, | ||
}; | ||
|
||
// This is a grossly over-simplified demonstration of an adapter, bridging the | ||
// SVM-agnostic Agave runtime implementation with the Agave SVM implementation. | ||
// Ideally, this would instead manifest as some module that could be easily | ||
// replaced if another SVM implementation were to be used. | ||
type Svm<FG> = | ||
AgaveTransactionBatchProcessor<AgaveValidatorRuntimeTransactionProcessingCallback, FG>; | ||
|
||
/// A mock Agave Validator. | ||
pub struct AgaveValidator<FG: ForkGraph> { | ||
pub runtime: AgaveValidatorRuntime<Svm<FG>>, | ||
} |