Skip to content

Commit

Permalink
Feat/merge fast finality to testnet (#89)
Browse files Browse the repository at this point in the history
* Configured block time shortening epoch for the mainnet

* Fix block time shortening epoch for the mainnet

* Feat/finalizer (#61)

* copy new files from [email protected]

* copy from bsc v1.4.6

* resolve interface missing method error for mock structs

* apply finality to our consensus

* add oasys consensus test: env/validators assemble

* whether broadcast vote judging from peers's TD

* fix lots of error to make work voting

* increase vote DOS threadhold

* fix lint error

* modify go.mod according to BSC

* vote attestaion stake weighted

* add MaliciousVoteMonitor

* remove bsc dependent comments/message

* rename finalizer to fast finality

* replace genesis contract by v1.6.0

* update genesis contract submodule (v1.6.0)

* resolved several consensus issue

* increment version to v1.6.0

* print error log: prepareWork and commit

* print warn log in case of invalid vote

* sort validators by owner for fast finality

* apply validators sort changes to snapshot.go

* disable deployments11

* refactor consensus

* upgrade stake manager contract version

* delete unused CeilDiv function

* delete unused metrics.label file copyed from bsc

* add comment to formHeader of finalize and seal case

* add comment why disable fromHeader on Finalize

* fix mainnet sync error: failed to verify header

* fix getValidators marshal error by suppporting old contract interface

* commit leak of previous one

* fix verify header error by adding missing return

* deal with unexpected value is presented to callGetHighStakesCommon

* fix getHighStakes unpack error. replace wrong contract

* sort by owner only fast finality enabled

* Improved performance degradation due to change in json format of consensus snapshot

* Improved EnvironmentValue parsing (#70)

* Add note to BLSPublicKey's Marshaler

* fix null pointer error after taking #69

* temporary set testnet hardfork for private testnet

* increase private testnet hardork block

* bring private hardfork time closer

* fix feedback from @ironbeer part1

* vot validator point to parent block(=target block)

* Add contract deploy test

* Update consensus/oasys/snapshot.go

Co-authored-by: ironbeer <[email protected]>

* fix feedback from ironbeer part2

* Added `Equal` method to EnvironmentValue (#71)

* Imported diffs of blockchain.go and headerchain.go from [email protected] (#74)

* Imported diffs of blockchain.go and headerchain.go from [email protected]

* Imported fast finality reorganization from [email protected] (#75)

* Imported fast finality reorganization from [email protected]

* Fix errors in test code

* elaborate the timeing update finalized and justified gauge (#77)

---------

Co-authored-by: tak <[email protected]>

* Fix panic when BLS key is nothing & support multiple keys (#81)

* Imported eth.handler from [email protected] (#78)

* Imported stop process of eth.handler from [email protected]

* Imported `chainFinalizedHeightFn` of fetcher.BlockFetcher from [email protected]

* remove stop chan from eth/handler (#82)

---------

Co-authored-by: tak <[email protected]>

* fix feadback from ironbeer part3

* Fix reorg when justification chain is split (#85)

* update loas contract & reset testnet hardfork schedule

* Fix misc (#87)

* Fix test error

* Fix image build error

---------

Co-authored-by: ironbeer <[email protected]>

* set testnet hardfork for v1.6.0 (#88)

---------

Co-authored-by: ironbeer <[email protected]>
  • Loading branch information
tak1827 and ironbeer authored Oct 31, 2024
1 parent 759f454 commit 02f07e6
Show file tree
Hide file tree
Showing 74 changed files with 6,291 additions and 732 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
[submodule "oasys-genesis-contract-6037082"]
path = consensus/oasys/oasys-genesis-contract-6037082
url = https://github.com/oasysgames/oasys-genesis-contract.git
[submodule "consensus/oasys/oasys-genesis-contract-5675779"]
path = consensus/oasys/oasys-genesis-contract-5675779
url = https://github.com/oasysgames/oasys-genesis-contract.git
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Geth in a stock Go builder container
FROM golang:1.20.14-bookworm as builder
FROM golang:1.21.13-bookworm as builder

# Support setting various labels on the final image
ARG COMMIT=""
Expand Down
8 changes: 8 additions & 0 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,10 @@ func (fb *filterBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Su
return fb.bc.SubscribeChainEvent(ch)
}

func (fb *filterBackend) SubscribeFinalizedHeaderEvent(ch chan<- core.FinalizedHeaderEvent) event.Subscription {
return nil
}

func (fb *filterBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
return fb.bc.SubscribeRemovedLogsEvent(ch)
}
Expand All @@ -953,6 +957,10 @@ func (fb *filterBackend) SubscribePendingLogsEvent(ch chan<- []*types.Log) event
return nullSubscription()
}

func (fb *filterBackend) SubscribeNewVoteEvent(ch chan<- core.NewVoteEvent) event.Subscription {
return nil
}

func (fb *filterBackend) BloomStatus() (uint64, uint64) { return 4096, 0 }

func (fb *filterBackend) ServiceFilter(ctx context.Context, ms *bloombits.MatcherSession) {
Expand Down
2 changes: 1 addition & 1 deletion accounts/scwallet/securechannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func NewSecureChannelSession(card *pcsc.Card, keyData []byte) (*SecureChannelSes
return &SecureChannelSession{
card: card,
secret: secret.Bytes(),
publicKey: elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y),
publicKey: elliptic.Marshal(crypto.S256(), key.PublicKey.X, key.PublicKey.Y), //nolint:all //TODO
}, nil
}

Expand Down
Loading

0 comments on commit 02f07e6

Please sign in to comment.