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

fix: broken replay files #1308

Merged
merged 1 commit into from
Sep 26, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public class Issue1124Tests {

@Test
void issue_1124_range_4323962_4324012() {
replay(LINEA_MAINNET, "4323962-4324012.json.gz", false);
replay(LINEA_MAINNET, "4323962-4324012.json.gz");
}

@Test
void issue_1124_range_4343434_4343473() {
replay(LINEA_MAINNET, "4343434-4343473.json.gz", false);
replay(LINEA_MAINNET, "4343434-4343473.json.gz");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void test_3175608_3175636() {

@Test
void test_3432730_3432768() {
replay(LINEA_MAINNET, "3432730-3432768.json.gz", false);
replay(LINEA_MAINNET, "3432730-3432768.json.gz");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void issue_4065360_4065364() {
// the only test that fails for me ... and only if I set resultChecking to true
@Test
void issue_4065365_4065369() {
replay(LINEA_MAINNET, "4065365-4065369.json.gz", false);
replay(LINEA_MAINNET, "4065365-4065369.json.gz");
}

@Test
Expand Down
Binary file modified arithmetization/src/test/resources/replays/4323985.json.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,18 @@ private static MutableWorldState initWorld(final ConflationSnapshot conflation)
}
// Initialise storage
for (StorageSnapshot s : conflation.storage()) {
updater
.getAccount(Words.toAddress(Bytes.fromHexString(s.address())))
.setStorageValue(UInt256.fromHexString(s.key()), UInt256.fromHexString(s.value()));
UInt256 key = UInt256.fromHexString(s.key());
UInt256 value = UInt256.fromHexString(s.value());
// The following check is only necessary because of older replay files which captured storage
// for accounts created in the conflation itself (see #1289). Such assignments are always
// zero values, but this confuses BESU into thinking their storage is not empty (leading to a
// creation failure). This fix simply prevents zero values from being assigned at all.
// If/when all older replay files are recaptured, then this check should be redundant.
if (!value.isZero()) {
updater
.getAccount(Words.toAddress(Bytes.fromHexString(s.address())))
.setStorageValue(key, value);
}
}
// Commit changes
updater.commit();
Expand Down Expand Up @@ -269,8 +278,7 @@ private static OperationTracer buildOperationTracer(
}

// Write the captured replay for a given conflation snapshot to a file. This is used to debug the
// BlockCapturer by
// making sure, for example, that captured replays still execute correctly.
// BlockCapturer by making sure, for example, that captured replays still execute correctly.
private static void writeCaptureToFile(ConflationSnapshot conflation, BlockCapturer capturer) {
// Extract capture name
String json = capturer.toJson();
Expand Down
Loading