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

fixed updater sync after reinit bug #375

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
26 changes: 20 additions & 6 deletions updater/src/syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,28 @@ impl Syncer {
.await?
.ok_or_else(|| eyre!("missing expected txn {:?}", txn_hash))?;
debug!("{:?}", txn);
let call = match FinalizerTaskManagerCalls::decode(txn.input)?{
let call = match FinalizerTaskManagerCalls::decode(txn.input)? {
FinalizerTaskManagerCalls::RespondToOpTask(c) => c,
FinalizerTaskManagerCalls::ForceRespondToOpTask(_) => {
return Err(eyre!("The call that resulted in the OpTaskCompleted event was a ForceRespondToOpTask call. This cannot be synced without a admin reinit"))
}
_ => {
return Err(eyre!("wrong call decoded"))
FinalizerTaskManagerCalls::ForceRespondToOpTask(call) => {
// If we have come across the completion event of the exact task that we are syncing from
// ie the last task that was completed on the alt-l1, then we can skip thise task here
// This happens following a reinit on eth which is followed by a reinit on the alt-l1
if call.task.clone().task_created_block
== *latest_completed_op_task_created_block
{
// if here the task num doesn't match there is a problem
if call.task.clone().task_num != *latest_completed_op_task_number {
return Err(eyre!(
"task_num mismatch {:?} {:?}",
call.task.clone().task_num,
*latest_completed_op_task_number
));
}
return Ok(());
}
return Err(eyre!("The call that resulted in the OpTaskCompleted event was a ForceRespondToOpTask call. This cannot be synced without a admin reinit"));
}
_ => return Err(eyre!("wrong call decoded")),
};
debug!("{:?}", call);
debug!("{:?}", call.task.clone());
Expand Down
Loading