Skip to content

Commit

Permalink
Post proofs on every slot
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Aug 8, 2024
1 parent 5c81f6e commit e726582
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: spectre_testnet
on:
push:
branches:
- main
- test

env:
ENVIRONMENT: 'TESTNET'
Expand Down
31 changes: 17 additions & 14 deletions chains/evm/listener/handlers/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,25 @@ func (h *StepEventHandler) destinationDomains(slot uint64) ([]uint8, uint64, err
}

endBlock := block.Data.Deneb.Message.Body.ExecutionPayload.BlockNumber
if h.latestBlock == 0 {
return h.allDomains, endBlock, nil
}
return h.allDomains, endBlock, nil

deposits, err := h.fetchDeposits(big.NewInt(int64(h.latestBlock)), big.NewInt(int64(endBlock)))
if err != nil {
return domains.ToSlice(), endBlock, err
}
if len(deposits) == 0 {
return domains.ToSlice(), endBlock, nil
}
for _, deposit := range deposits {
domains.Add(deposit.DestinationDomainID)
}
/*
if h.latestBlock == 0 {
}
return domains.ToSlice(), endBlock, nil
deposits, err := h.fetchDeposits(big.NewInt(int64(h.latestBlock)), big.NewInt(int64(endBlock)))
if err != nil {
return domains.ToSlice(), endBlock, err
}
if len(deposits) == 0 {
return domains.ToSlice(), endBlock, nil
}
for _, deposit := range deposits {
domains.Add(deposit.DestinationDomainID)
}
return domains.ToSlice(), endBlock, nil
*/
}

func (h *StepEventHandler) fetchDeposits(startBlock *big.Int, endBlock *big.Int) ([]*events.Deposit, error) {
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/sygmaprotocol/spectre-node

go 1.19
go 1.21

toolchain go1.22.5

require (
github.com/attestantio/go-eth2-client v0.19.4
Expand Down
Loading

0 comments on commit e726582

Please sign in to comment.