Skip to content

Commit 7d73c05

Browse files
Sneh1999ImJeremyHe
andauthored
Persistent storage for sovereign builder (#180)
* Persistence storage for sovereign builder * add unit test * add unit test to ci and add mutex * Optional header in jst * initialize pending transactions if not present * remove unwanted test * resolve bugs * remove nil pointer panic * cleanup * revert to strings.contains * fix isErrNotFound --------- Co-authored-by: ImJeremyHe <[email protected]>
1 parent c2a4f6b commit 7d73c05

File tree

11 files changed

+246
-63
lines changed

11 files changed

+246
-63
lines changed

.github/workflows/espresso-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
if: steps.cache-cbrotli.outputs.cache-hit != 'true'
124124
run: ./scripts/build-brotli.sh -w -d
125125

126+
126127
- name: Build
127128
run: make build build-replay-env -j
128129

arbnode/batch_poster.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,8 @@ func (b *BatchPoster) addEspressoBlockMerkleProof(
502502
return err
503503
}
504504

505-
if jst.Header.Height == 0 {
506-
// This means the header in the jst is still the dummy header.
507-
return fmt.Errorf("this msg has not been included in hotshot %v", jst.Header.Height)
505+
if jst.Header == nil {
506+
return fmt.Errorf("this msg has not been included in hotshot")
508507
}
509508

510509
snapshot, err := b.lightClientReader.FetchMerkleRoot(jst.Header.Height, nil)

arbnode/schema.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ var (
1212
sequencerBatchMetaPrefix []byte = []byte("s") // maps a batch sequence number to BatchMetadata
1313
delayedSequencedPrefix []byte = []byte("a") // maps a delayed message count to the first sequencer batch sequence number with this delayed count
1414

15-
messageCountKey []byte = []byte("_messageCount") // contains the current message count
16-
delayedMessageCountKey []byte = []byte("_delayedMessageCount") // contains the current delayed message count
17-
sequencerBatchCountKey []byte = []byte("_sequencerBatchCount") // contains the current sequencer message count
18-
dbSchemaVersion []byte = []byte("_schemaVersion") // contains a uint64 representing the database schema version
15+
messageCountKey []byte = []byte("_messageCount") // contains the current message count
16+
delayedMessageCountKey []byte = []byte("_delayedMessageCount") // contains the current delayed message count
17+
sequencerBatchCountKey []byte = []byte("_sequencerBatchCount") // contains the current sequencer message count
18+
dbSchemaVersion []byte = []byte("_schemaVersion") // contains a uint64 representing the database schema version
19+
espressoSubmittedPos []byte = []byte("_espressoSubmittedPos") // contains the current message index of the last submitted txn
20+
espressoSubmittedHash []byte = []byte("_espressoSubmittedHash") // contains the hash of the last submitted txn
21+
espressoPendingTxnsPositions []byte = []byte("_espressoPendingTxnsPositions") // contains the index of the pending txns that need to be submitted to espresso
1922
)
2023

2124
const currentDbSchemaVersion uint64 = 1

0 commit comments

Comments
 (0)