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

feat: Sepolia support #169

Merged
merged 2 commits into from
Sep 11, 2023
Merged

feat: Sepolia support #169

merged 2 commits into from
Sep 11, 2023

Conversation

borispovod
Copy link
Contributor

@borispovod borispovod commented Sep 11, 2023

Hey team,

We've introduced support for the Sepolia network along with the necessary configurations. Additionally, we've implemented several fixes and updates as outlined in Issue #166.

Specifically, we've removed the state.is_full check. Now, we update the state once the attributes are processed. Without this change, the system was entering an infinite loop, producing blocks with identical timestamps and data. These were subsequently rejected by op-eth. Referring to the following section for context:

let batch = if derived_batch.is_none() {
let state = self.state.read().unwrap();
let current_l1_block = state.current_epoch_num;
let safe_head = state.safe_head;
let epoch = state.safe_epoch;
let next_epoch = state.epoch_by_number(epoch.number + 1);
let seq_window_size = self.config.chain.seq_window_size;
if let Some(next_epoch) = next_epoch {
if current_l1_block > epoch.number + seq_window_size {
let next_timestamp = safe_head.timestamp + self.config.chain.blocktime;
let epoch = if next_timestamp < next_epoch.timestamp {
epoch
} else {
next_epoch
};
Some(Batch {
epoch_num: epoch.number,
epoch_hash: epoch.hash,
parent_hash: safe_head.parent_hash,
timestamp: next_timestamp,
transactions: Vec::new(),
l1_inclusion_block: current_l1_block,
})
} else {
None
}
} else {
None
}
} else {
derived_batch
};

@ncitron
Copy link
Contributor

ncitron commented Sep 11, 2023

This all looks good.

I think we won't have any problems with the memory size of state growing to big even without the is_full checks since we have the purge function which is called internally to remove stale data.

I think that is_full is no longer used now though. Can we remove it?

@borispovod
Copy link
Contributor Author

This all looks good.

I think we won't have any problems with the memory size of state growing to big even without the is_full checks since we have the purge function which is called internally to remove stale data.

I think that is_full is no longer used now though. Can we remove it?

Hey @ncitron ,

It's removed in a3f46b9

Copy link
Contributor

@ncitron ncitron left a comment

Choose a reason for hiding this comment

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

Oops missed that.

LGTM!

@ncitron ncitron merged commit 27f812d into a16z:master Sep 11, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants