Skip to content

Commit

Permalink
Merge branch 'develop' into develop-tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
uprendis committed Aug 17, 2023
2 parents 03210e9 + 85695db commit 7a6c9bb
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Check build

on: [push]
on:
push:
pull_request:
branches:
- develop
- master

jobs:
check-build:
Expand Down
8 changes: 2 additions & 6 deletions cmd/opera/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,9 @@ func makeNode(ctx *cli.Context, cfg *config, genesisStore *genesisstore.Store) (
if err != nil {
utils.Fatalf("Failed to create the service: %v", err)
}
err = engine.Bootstrap(svc.GetConsensusCallbacks())
err = engine.StartFrom(svc.GetConsensusCallbacks(), gdb.GetEpoch(), gdb.GetValidators())
if err != nil {
utils.Fatalf("Failed to bootstrap the engine: %v", err)
}
err = engine.Reset(gdb.GetEpoch(), gdb.GetValidators())
if err != nil {
utils.Fatalf("Failed to reset the engine: %v", err)
utils.Fatalf("Failed to start the engine: %v", err)
}
svc.ReprocessEpochEvents()
if cfg.Emitter.Validator.ID != 0 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Fantom-foundation/go-opera
go 1.17

require (
github.com/Fantom-foundation/lachesis-base v0.0.0-20230629034932-42bae8eeb426
github.com/Fantom-foundation/lachesis-base v0.0.0-20230817040848-1326ba9aa59b
github.com/allegro/bigcache v1.2.1 // indirect
github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40 // indirect
github.com/cespare/cp v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Fantom-foundation/go-ethereum v1.10.8-ftm-rc12 h1:SyXrKgZNRBIQN1XZXOH1WZZoPft2qm0jC7pZC9nRCw4=
github.com/Fantom-foundation/go-ethereum v1.10.8-ftm-rc12/go.mod h1:IeQDjWCNBj/QiWIPosfF6/kRC6pHPNs7W7LfBzjj+P4=
github.com/Fantom-foundation/lachesis-base v0.0.0-20230629034932-42bae8eeb426 h1:TCsCxpzd2ETqHJMdkw09Ck1mmnNgx/Z4h6i6kDOexYI=
github.com/Fantom-foundation/lachesis-base v0.0.0-20230629034932-42bae8eeb426/go.mod h1:Ogv5etzSmM2rQ4eN3OfmyitwWaaPjd4EIDiW/NAbYGk=
github.com/Fantom-foundation/lachesis-base v0.0.0-20230817040848-1326ba9aa59b h1:/9+Cau3cWaKy9fQk/NWq3RJKrwEjgrhME6ACy4RjLns=
github.com/Fantom-foundation/lachesis-base v0.0.0-20230817040848-1326ba9aa59b/go.mod h1:Ogv5etzSmM2rQ4eN3OfmyitwWaaPjd4EIDiW/NAbYGk=
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
github.com/JekaMas/go-mutesting v1.1.2/go.mod h1:dmuQcwN24lbeoiakrWYmmPQ/YcLYSRADixUrGdcCkxI=
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
Expand Down
8 changes: 8 additions & 0 deletions gossip/emitter/emitter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package emitter

import (
"errors"
"fmt"
"math/rand"
"os"
Expand All @@ -19,6 +20,7 @@ import (
"github.com/Fantom-foundation/go-opera/inter"
"github.com/Fantom-foundation/go-opera/logger"
"github.com/Fantom-foundation/go-opera/tracing"
"github.com/Fantom-foundation/go-opera/utils/errlock"
"github.com/Fantom-foundation/go-opera/utils/rate"
)

Expand Down Expand Up @@ -307,6 +309,12 @@ func (em *Emitter) createEvent(sortedTxs *types.TransactionsByPriceAndNonce) (*i
if !ok {
return nil, nil
}
prevEmitted := em.readLastEmittedEventID()
if prevEmitted != nil && prevEmitted.Epoch() >= em.epoch {
if selfParent == nil || *selfParent != *prevEmitted {
errlock.Permanent(errors.New("Local database is corrupted, which may lead to a doublesign"))
}
}

// Set parent-dependent fields
parentHeaders := make(inter.Events, len(parents))
Expand Down
4 changes: 0 additions & 4 deletions gossip/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,10 +788,6 @@ func (h *handler) handle(p *peer) error {
useless = true
discfilter.Ban(p.ID())
}
if !p.Peer.Info().Network.Trusted && useless && h.peers.UselessNum() >= h.maxPeers/10 {
// don't allow more than 10% of useless peers
return p2p.DiscTooManyPeers
}
if !p.Peer.Info().Network.Trusted && useless {
if h.peers.UselessNum() >= h.maxPeers/10 {
// don't allow more than 10% of useless peers
Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func init() {
params.VersionMajor = 1 // Major version component of the current release
params.VersionMinor = 1 // Minor version component of the current release
params.VersionPatch = 3 // Patch version component of the current release
params.VersionMeta = "txtracing-rc.1" // Version metadata to append to the version string
params.VersionMeta = "txtracing-rc.3" // Version metadata to append to the version string
}

func BigToString(b *big.Int) string {
Expand Down

0 comments on commit 7a6c9bb

Please sign in to comment.