Skip to content

Commit

Permalink
not save log bloom filter
Browse files Browse the repository at this point in the history
Signed-off-by: Karim TAAM <[email protected]>
  • Loading branch information
matkt committed May 5, 2023
1 parent da10b4b commit f4101ff
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ public void writeToForReceiptTrie(
rlpOutput.writeLongScalar(status);
}
rlpOutput.writeLongScalar(cumulativeGasUsed);
rlpOutput.writeBytes(bloomFilter);
if (!isCompressed) {
rlpOutput.writeBytes(bloomFilter);
}
rlpOutput.writeList(logs, (log, out) -> log.writeTo(out, isCompressed));
if (withRevertReason && revertReason.isPresent()) {
rlpOutput.writeBytes(revertReason.get());
Expand Down Expand Up @@ -261,8 +263,16 @@ public static TransactionReceipt readFrom(
final long cumulativeGas = input.readLongScalar();
// The logs below will populate the bloom filter upon construction.
// TODO consider validating that the logs and bloom filter match.
final LogsBloomFilter bloomFilter = LogsBloomFilter.readFrom(input);
LogsBloomFilter bloomFilter = null;
if (!isCompressed) {
bloomFilter = LogsBloomFilter.readFrom(input);
}
final List<Log> logs = input.readList(in -> Log.readFrom(in, isCompressed));

if (bloomFilter == null) {
bloomFilter = LogsBloomFilter.builder().insertLogs(logs).build();
}

final Optional<Bytes> revertReason;
if (input.isEndOfCurrentList()) {
revertReason = Optional.empty();
Expand Down

0 comments on commit f4101ff

Please sign in to comment.