Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions magicblock-committor-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ IntentExecutor - responsible for execution of Intent. Calls **TransactionPrepar
TransactionPreparator - is an entity that handles all of the above "Transaction preparation" calling **TaskBuilderV1**, **TaskStrategist**, **DeliveryPreparator** and then assempling it all and passing to **MessageExecutor**

## DeliveryPreparator
After our **BaseTask**s are ready we need to prepare eveything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
After our **Task**s are ready we need to prepare eveything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix spelling error.

"eveything" should be "everything".

Apply this diff:

-After our **Task**s are ready we need to prepare eveything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
+After our **Task**s are ready we need to prepare everything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
After our **Task**s are ready we need to prepare eveything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
After our **Task**s are ready we need to prepare everything for their successful execution. **DeliveryPreparator** - handles ALTs and commit buffers
🧰 Tools
🪛 LanguageTool

[grammar] ~26-~26: Ensure spelling is correct
Context: ... Tasks are ready we need to prepare eveything for their successful execution. **Deliv...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
In magicblock-committor-service/README.md around line 26, fix the spelling
mistake "eveything" to "everything" in the sentence so it reads: "After our
**Task**s are ready we need to prepare everything for their successful
execution. **DeliveryPreparator** - handles ALTs and commit buffers".


## TaskBuilder
First, lets build atomic tasks from scheduled message/intent.

High level: TaskBuilder responsible for creating BaseTasks(to be renamed...) from ScheduledBaseIntent(to be renamed...).
High level: TaskBuilder responsible for creating Tasks(to be renamed...) from ScheduledBaseIntent(to be renamed...).
Details: To do that is requires additional information from DelegationMetadata, it is provided **CommitIdFetcher**

### BaseTask
High level: BaseTask - is an atomic operation that is to be performed on the Base layer, like: Commit, Undelegate, Finalize, Action.
### Task
High level: Task - is an atomic operation that is to be performed on the Base layer, like: Commit, Undelegate, Finalize, Action.

Details: There's to implementation of BaseTask: ArgsTask, BufferTask. ArgsTask - gives instruction using args. BufferTask - gives instruction using buffer. BufferTask at the moment supports only commits
Details: There's to implementation of Task: ArgsTask, BufferTask. ArgsTask - gives instruction using args. BufferTask - gives instruction using buffer. BufferTask at the moment supports only commits

### TaskInfoFetcher
High level: for account to be accepted by `dlp` it needs to have incremental commit ids. TaskInfoFetcher provides a user with the correct ids/nonces for set of committees
Expand Down
6 changes: 3 additions & 3 deletions magicblock-committor-service/src/intent_executor/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use solana_sdk::{
use crate::{
tasks::{
task_builder::TaskBuilderError, task_strategist::TaskStrategistError,
BaseTask, TaskType,
Task, TaskType,
},
transaction_preparator::error::TransactionPreparatorError,
};
Expand Down Expand Up @@ -138,7 +138,7 @@ impl TransactionStrategyExecutionError {
pub fn try_from_transaction_error(
err: TransactionError,
signature: Option<Signature>,
tasks: &[Box<dyn BaseTask>],
tasks: &[Task],
) -> Result<Self, TransactionError> {
// There's always 2 budget instructions in front
const OFFSET: u8 = 2;
Expand Down Expand Up @@ -196,7 +196,7 @@ impl TransactionStrategyExecutionError {
}

pub(crate) struct IntentTransactionErrorMapper<'a> {
pub tasks: &'a [Box<dyn BaseTask>],
pub tasks: &'a [Task],
}
impl TransactionErrorMapper for IntentTransactionErrorMapper<'_> {
type ExecutionError = TransactionStrategyExecutionError;
Expand Down
12 changes: 6 additions & 6 deletions magicblock-committor-service/src/intent_executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use crate::{
TaskStrategist, TaskStrategistError, TransactionStrategy,
},
task_visitors::utility_visitor::TaskVisitorUtils,
BaseTask, TaskType,
Task, TaskType,
},
transaction_preparator::{
error::TransactionPreparatorError, TransactionPreparator,
Expand Down Expand Up @@ -127,8 +127,8 @@ where
/// Checks if it is possible to unite Commit & Finalize stages in 1 transaction
/// Returns corresponding `TransactionStrategy` if possible, otherwise `None`
fn try_unite_tasks<P: IntentPersister>(
commit_tasks: &[Box<dyn BaseTask>],
finalize_task: &[Box<dyn BaseTask>],
commit_tasks: &[Task],
finalize_task: &[Task],
authority: &Pubkey,
persister: &Option<P>,
) -> Result<Option<TransactionStrategy>, SignerError> {
Expand Down Expand Up @@ -179,7 +179,7 @@ where
}

// Build tasks for commit stage
let commit_tasks = TaskBuilderImpl::commit_tasks(
let commit_tasks = TaskBuilderImpl::create_commit_tasks(
&self.task_info_fetcher,
&base_intent,
persister,
Expand Down Expand Up @@ -626,7 +626,7 @@ where
async fn execute_message_with_retries(
&self,
prepared_message: VersionedMessage,
tasks: &[Box<dyn BaseTask>],
tasks: &[Task],
) -> IntentExecutorResult<Signature, TransactionStrategyExecutionError>
{
struct IntentErrorMapper<TxMap> {
Expand Down Expand Up @@ -837,7 +837,7 @@ mod tests {
let intent = create_test_intent(0, &pubkey);

let info_fetcher = Arc::new(MockInfoFetcher);
let commit_task = TaskBuilderImpl::commit_tasks(
let commit_task = TaskBuilderImpl::create_commit_tasks(
&info_fetcher,
&intent,
&None::<IntentPersisterImpl>,
Expand Down
154 changes: 0 additions & 154 deletions magicblock-committor-service/src/tasks/args_task.rs

This file was deleted.

Loading