Skip to content

Commit

Permalink
[Relayminer, Bug] fix: sessiontree logger never initialized (#993)
Browse files Browse the repository at this point in the history
## Summary

Fixes a nil pointer panic in the relayminer; the logger member is never
initialized.

## Issue

- N/A

## Type of change

Select one or more from the following:

- [ ] New feature, functionality or library
- [ ] Consensus breaking; add the `consensus-breaking` label if so. See
#791 for details
- [x] Bug fix
- [ ] Code health or cleanup
- [ ] Documentation
- [ ] Other (specify)

## Testing

- [ ] **Documentation**: `make docusaurus_start`; only needed if you
make doc changes
- [ ] **Unit Tests**: `make go_develop_and_test`
- [ ] **LocalNet E2E Tests**: `make test_e2e`
- [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR.

## Sanity Checklist

- [x] I have tested my changes using the available tooling
- [ ] I have commented my code
- [x] I have performed a self-review of my own code; both comments &
source code
- [ ] I create and reference any new tickets, if applicable
- [ ] I have left TODOs throughout the codebase, if applicable
bryanchriswhite authored Dec 13, 2024
1 parent 8ea6c15 commit 91250b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/relayer/session/sessiontree.go
Original file line number Diff line number Diff line change
@@ -96,14 +96,20 @@ func NewSessionTree(
// contain a non-hashed Relay that could be used to validate the proof on-chain.
trie := smt.NewSparseMerkleSumTrie(treeStore, protocol.NewTrieHasher(), smt.WithValueHasher(nil))

logger = logger.With(
"store_path", storePath,
"session_id", sessionHeader.SessionId,
"supplier_operator_address", supplierOperatorAddress,
)

sessionTree := &sessionTree{
logger: logger,
sessionHeader: sessionHeader,
storePath: storePath,
treeStore: treeStore,
sessionSMT: trie,
sessionMu: &sync.Mutex{},
supplierOperatorAddress: supplierOperatorAddress,
logger: logger,
}

return sessionTree, nil
@@ -270,7 +276,6 @@ func (st *sessionTree) Delete() error {
} else {
st.logger.With(
"claim_root", fmt.Sprintf("%x", st.GetClaimRoot()),
"session_id", st.GetSessionHeader().SessionId,
).Info().Msg("KVStore is already stopped")
}

0 comments on commit 91250b3

Please sign in to comment.