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

[Config Change] Removes HardReorg config from InboxReader #2542

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

diegoximenes
Copy link
Contributor

Resolves NIT-1349

HardReorg config from InboxReader seems unused so this PR removes it.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label Jul 31, 2024
@diegoximenes diegoximenes marked this pull request as ready for review July 31, 2024 20:35
gligneul
gligneul previously approved these changes Aug 1, 2024
@diegoximenes diegoximenes changed the title Removes HardReorg config from InboxReader [Config Change] Removes HardReorg config from InboxReader Aug 2, 2024
ganeshvanahalli
ganeshvanahalli previously approved these changes Aug 5, 2024
Require(t, err)

// Reorg out the user delayed message
err = tracker.ReorgDelayedTo(1, true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of just removing this test, we should instead have this test insert an alternative delayed message at position 1 which would cause the same reorg. Instead of getting the delayed count below, we could then get the delayed message to ensure it changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I adjusted the test to trigger a reorg by adding an alternative delayed message through AddDelayedMessages as you mentioned, but the strategy that I implemented is a little bit different than the one you described.

@diegoximenes diegoximenes marked this pull request as draft October 4, 2024 18:01
@diegoximenes diegoximenes marked this pull request as ready for review October 4, 2024 19:25
@PlasmaPower
Copy link
Collaborator

I think there is an issue in the inbox tracker that your test exposed. I pushed up a commit to this branch to fix it. Let me know what you think

@PlasmaPower PlasmaPower requested a review from tsahee November 5, 2024 14:10
@CLAassistant
Copy link

CLAassistant commented Nov 26, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@eljobe eljobe left a comment

Choose a reason for hiding this comment

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

Minor nit about test readability. Otherwise, this LGTM.

@@ -49,7 +49,22 @@ func TestSequencerReorgFromDelayed(t *testing.T) {
},
},
}
err = tracker.AddDelayedMessages([]*DelayedInboxMessage{initMsgDelayed, userDelayed}, false)
delayedRequestId2 := common.BigToHash(common.Big2)
userDelayed2 := &DelayedInboxMessage{
Copy link
Member

Choose a reason for hiding this comment

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

I really think it would improve the readability of these tests if we made a little helper method that could return a DelayedInboxMessage built from just the important arguments from the test case. For example, I think the only thing that matters here is that the first message uses delayedRequestId and the second one uses dealyedRequestId2, but I have to actually scan all of the lines between 38-51 and between 53-66 to be sure that something else doesn't differ between the two messages.

Also, if it weren't for your comment on line 137, I wouldn't have noticed that the timestamp was different. But, that would have been really clear if we used a helper function to get a "normal" DelayedInboxMessage and then modified the fields on the struct we wanted to change for the test.

@PlasmaPower PlasmaPower dismissed their stale review December 10, 2024 17:04

Test added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants