Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,47 @@ jobs:
steps:

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Get dependencies
run: go get -v -t -d ./...
run: |
go version
go mod download
go mod tidy

- name: Test
run: go test -race `go list ./... | grep -v benchmark` -short
run: |
go version
go test -race `go list ./... | grep -v benchmark` -short

- name: Check code quality
run: |
export PATH=$PATH:$(go env GOPATH)/bin
wget https://github.com/mgechev/revive/releases/download/v1.2.1/revive_1.2.1_Linux_x86_64.tar.gz
go version
export GOROOT=$(go env GOROOT)
export GOPATH=$(go env GOPATH)
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
echo "GOROOT=$GOROOT"
echo "GOPATH=$GOPATH"
echo "PATH=$PATH"
which go
go env GOROOT
wget -q https://github.com/mgechev/revive/releases/download/v1.2.1/revive_1.2.1_Linux_x86_64.tar.gz
tar xf revive_1.2.1_Linux_x86_64.tar.gz -C /tmp
/tmp/revive -config .revive.toml -formatter friendly -exclude vendor/... $(go list ./...)
chmod +x /tmp/revive
env GOROOT=$GOROOT GOPATH=$GOPATH PATH=$GOROOT/bin:$GOPATH/bin:$PATH /tmp/revive -config .revive.toml -formatter friendly -exclude vendor/... $(go list ./...)

- name: Make
run: make dev

- name : Upload artifact
uses: actions/upload-artifact@master
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ela-ubuntu
path: ela
if-no-files-found: warn
1 change: 0 additions & 1 deletion core/transaction/reverttodpostransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func (t *RevertToDPOSTransaction) SpecialContextCheck() (elaerr.ELAError, bool)
}
if p.WorkHeightInterval != payload.WorkHeightInterval {
return elaerr.Simple(elaerr.ErrTxPayload, errors.New("invalid WorkHeightInterval")), true

}

// check dpos state
Expand Down
6 changes: 6 additions & 0 deletions dpos/manager/dposmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,14 @@ func (d *DPOSManager) OnBlockReceived(b *types.Block, confirmed bool) {

if d.arbitrators.IsInPOWMode() {
d.changeHeight()
if b.Height > d.dispatcher.GetFinishedHeight() {
// need to reset consensus
log.Info("### OnBlockReceived set ready", b.Height)
d.consensus.SetReady(b.Height)
}
return
}

if confirmed {
d.ConfirmBlock(b.Height, b.Hash())
d.changeHeight()
Expand Down
Loading