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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ https://pkg.go.dev/badge/github.com/ethereum/go-ethereum
)](https://pkg.go.dev/github.com/ethereum/go-ethereum?tab=doc)
[![Go Report Card](https://goreportcard.com/badge/github.com/ethereum/go-ethereum)](https://goreportcard.com/report/github.com/ethereum/go-ethereum)
[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://discord.gg/oasysgames)
[![Twitter](https://img.shields.io/twitter/follow/oasyschain)](https://x.com/oasyschain)

Automated builds are available for stable releases and the unstable master branch. Binary
archives are published at https://github.com/oasysgames/oasys-validator/releases.
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ participating.

It expects the genesis file as argument.`,
}
// this command is not used in Oasys
initNetworkCommand = &cli.Command{
Action: initNetwork,
Name: "init-network",
Expand Down
2 changes: 1 addition & 1 deletion cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
}
if ctx.IsSet(utils.OverrideMinBlocksForBlobRequests.Name) {
params.MinBlocksForBlobRequests = ctx.Uint64(utils.OverrideMinBlocksForBlobRequests.Name)
params.MinTimeDurationForBlobRequests = uint64(float64(params.MinBlocksForBlobRequests) * 0.75 /*maxwellBlockInterval*/)
params.MinTimeDurationForBlobRequests = uint64(float64(params.MinBlocksForBlobRequests) * params.SHORT_BLOCK_TIME_SECONDS)
}
if ctx.IsSet(utils.OverrideDefaultExtraReserveForBlobRequests.Name) {
params.DefaultExtraReserveForBlobRequests = ctx.Uint64(utils.OverrideDefaultExtraReserveForBlobRequests.Name)
Expand Down
40 changes: 23 additions & 17 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ import (

const (
// All flags for BSC specific features default to false
bscFeaturesDefault = false
bscFeaturesDefaultBool = false
bscFeaturesDefaultInt = 0
bscFeaturesDefaultString = ""
)

var (
Expand All @@ -106,31 +108,31 @@ var (
Name: "multidatabase",
Usage: "Enable a separated state and block database, it will be created within two subdirectory called state and block, " +
"Users can copy this state or block directory to another directory or disk, and then create a symbolic link to the state directory under the chaindata",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.EthCategory,
}
DirectBroadcastFlag = &cli.BoolFlag{
Name: "directbroadcast",
Usage: "Enable directly broadcast mined block to all peers",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.EthCategory,
}
DisableSnapProtocolFlag = &cli.BoolFlag{
Name: "disablesnapprotocol",
Usage: "Disable snap protocol",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.EthCategory,
}
EnableTrustProtocolFlag = &cli.BoolFlag{
Name: "enabletrustprotocol",
Usage: "Enable trust protocol",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.FastNodeCategory,
}
RangeLimitFlag = &cli.BoolFlag{
Name: "rangelimit",
Usage: "Enable 5000 blocks limit for range query",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.APICategory,
}
DiffFlag = flags.DirectoryFlag{
Expand Down Expand Up @@ -228,7 +230,7 @@ var (
ForceFlag = &cli.BoolFlag{
Name: "force",
Usage: "Force convert hbss trie node to pbss trie node. Ignore any metadata",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
}
// Dump command options.
IterativeOutputFlag = &cli.BoolFlag{
Expand Down Expand Up @@ -354,13 +356,13 @@ var (
PathDBSyncFlag = &cli.BoolFlag{
Name: "pathdb.sync",
Usage: "sync flush nodes cache to disk in path schema",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.StateCategory,
}
JournalFileFlag = &cli.BoolFlag{
Name: "journalfile",
Usage: "Enable using journal file to store the TrieJournal instead of KVDB in pbss (default = false)",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.StateCategory,
}
StateHistoryFlag = &cli.Uint64Flag{
Expand Down Expand Up @@ -567,7 +569,7 @@ var (
PersistDiffFlag = &cli.BoolFlag{
Name: "persistdiff",
Usage: "Enable persistence of the diff layer",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.FastNodeCategory,
}
DiffBlockFlag = &cli.Uint64Flag{
Expand All @@ -579,7 +581,7 @@ var (
PruneAncientDataFlag = &cli.BoolFlag{
Name: "pruneancient",
Usage: "Prune ancient data, is an optional config and disabled by default. Only keep the latest 9w blocks' data,the older blocks' data will be permanently pruned. Notice:the geth/chaindata/ancient dir will be removed, if restart without the flag, the ancient data will start with the previous point that the oldest unpruned block number. Recommends to the user who don't care about the ancient data.",
Value: bscFeaturesDefault,
Value: bscFeaturesDefaultBool,
Category: flags.BlockHistoryCategory,
}
CacheLogSizeFlag = &cli.IntFlag{
Expand Down Expand Up @@ -1118,48 +1120,52 @@ Please note that --` + MetricsHTTPFlag.Name + ` must be set to start the server.
InitSentryNodeSize = &cli.IntFlag{
Name: "init.sentrynode-size",
Usage: "the size of the sentry node",
Value: 0,
Value: bscFeaturesDefaultInt,
}
InitSentryNodeIPs = &cli.StringFlag{
Name: "init.sentrynode-ips",
Usage: "the ips of each sentry node in the network, example '192.168.0.1,192.168.0.2'",
Value: "",
Value: bscFeaturesDefaultString,
}
InitSentryNodePorts = &cli.StringFlag{
Name: "init.sentrynode-ports",
Usage: "the ports of each sentry node in the network, example '30311,30312'",
Value: "",
Value: bscFeaturesDefaultString,
}
InitFullNodeSize = &cli.IntFlag{
Name: "init.fullnode-size",
Usage: "the size of the full node",
Value: 0,
Value: bscFeaturesDefaultInt,
}
InitFullNodeIPs = &cli.StringFlag{
Name: "init.fullnode-ips",
Usage: "the ips of each full node in the network, example '192.168.0.1,192.168.0.2'",
Value: "",
Value: bscFeaturesDefaultString,
}
InitFullNodePorts = &cli.StringFlag{
Name: "init.fullnode-ports",
Usage: "the ports of each full node in the network, example '30311,30312'",
Value: "",
Value: bscFeaturesDefaultString,
}
InitEVNSentryWhitelist = &cli.BoolFlag{
Name: "init.evn-sentry-whitelist",
Usage: "whether to add evn sentry NodeIDs in Node.P2P.EVNNodeIDsWhitelist",
Value: bscFeaturesDefaultBool,
}
InitEVNValidatorWhitelist = &cli.BoolFlag{
Name: "init.evn-validator-whitelist",
Usage: "whether to add evn validator NodeIDs in Node.P2P.EVNNodeIDsWhitelist",
Value: bscFeaturesDefaultBool,
}
InitEVNSentryRegister = &cli.BoolFlag{
Name: "init.evn-sentry-register",
Usage: "whether to add evn sentry NodeIDs in ETH.EVNNodeIDsToAdd",
Value: bscFeaturesDefaultBool,
}
InitEVNValidatorRegister = &cli.BoolFlag{
Name: "init.evn-validator-register",
Usage: "whether to add evn validator NodeIDs in ETH.EVNNodeIDsToAdd",
Value: bscFeaturesDefaultBool,
}
MetricsInfluxDBOrganizationFlag = &cli.StringFlag{
Name: "metrics.influxdb.organization",
Expand Down
23 changes: 0 additions & 23 deletions common/bidutil/bidutil.go

This file was deleted.

10 changes: 0 additions & 10 deletions common/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,3 @@ func (t PrettyAge) String() string {
}
return result
}

func FormatMilliTime(n int64) string {
if n < 0 {
return "invalid"
}
if n == 0 {
return ""
}
return time.UnixMilli(n).Format("2006-01-02 15:04:05.000")
}
2 changes: 1 addition & 1 deletion consensus/misc/eip4844/eip4844.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
var frac uint64
switch config.LatestFork(header.Time) {
case forks.Maxwell, forks.Lorentz, forks.Prague:
case forks.Prague:
frac = config.BlobScheduleConfig.Prague.UpdateFraction
case forks.Cancun:
frac = config.BlobScheduleConfig.Cancun.UpdateFraction
Expand Down
6 changes: 3 additions & 3 deletions contracts/oasys/deployments14.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions contracts/oasys/oasys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,17 +1184,17 @@ func _deployments14(genesisHash common.Hash, contracts wantContracts) {
case params.OasysMainnetGenesisHash:
contracts["0x5200000000000000000000000000000000000040"] = &wantContract{
name: "SlashIndicator",
codeHash: "035b45de2221fbed16a132979c729c5e",
codeHash: "8abd8f98bfb52fe5d10557e4951818bf",
}
case params.OasysTestnetGenesisHash:
contracts["0x5200000000000000000000000000000000000040"] = &wantContract{
name: "SlashIndicator",
codeHash: "0d55b7f8f29f3c74504e7de4de62cb86",
codeHash: "02d07c1ec7beca01c4772ae03f0afb01",
}
default:
contracts["0x5200000000000000000000000000000000000040"] = &wantContract{
name: "SlashIndicator",
codeHash: "ef5eb9771fa3dc3a0a81a9df61696197",
codeHash: "bc0ee10dac3f5f4393b1967ce2a39284",
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/headerchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import (
)

const (
headerCacheLimit = 1280 // a buffer exceeding the EpochLength
tdCacheLimit = 1280 // a buffer exceeding the EpochLength
headerCacheLimit = 512 // Smaller due to longer block time than BSC
tdCacheLimit = 1024 // Same as above
Comment thread
tak1827 marked this conversation as resolved.
numberCacheLimit = 2048
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/blobpool/blobpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func makeUnsignedTx(nonce uint64, gasTipCap uint64, gasFeeCap uint64, blobFeeCap
return makeUnsignedTxWithTestBlob(nonce, gasTipCap, gasFeeCap, blobFeeCap, rnd.Intn(len(testBlobs)))
}

// makeUnsignedTx is a utility method to construct a random blob transaction
// makeUnsignedTxWithTestBlob is a utility method to construct a random blob transaction
// without signing it.
func makeUnsignedTxWithTestBlob(nonce uint64, gasTipCap uint64, gasFeeCap uint64, blobFeeCap uint64, blobIdx int) *types.BlobTx {
return &types.BlobTx{
Expand Down
16 changes: 0 additions & 16 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (

"golang.org/x/crypto/sha3"

"github.com/holiman/uint256"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rlp"
Expand Down Expand Up @@ -158,20 +156,6 @@ func (h *Header) Hash() common.Hash {
return rlpHash(h)
}

// SetMilliseconds can be called once millisecond representation supported
func (h *Header) SetMilliseconds(milliseconds uint64) {
h.MixDigest = common.Hash(uint256.NewInt(milliseconds % 1000).Bytes32())
}

// Ensure Milliseconds is less than 1000 when verifying the block header
func (h *Header) MilliTimestamp() uint64 {
milliseconds := uint64(0)
if h.MixDigest != (common.Hash{}) {
milliseconds = uint256.NewInt(0).SetBytes32(h.MixDigest[:]).Uint64()
}
return h.Time*1000 + milliseconds
}

var headerSize = common.StorageSize(reflect.TypeOf(Header{}).Size())

// Size returns the approximate memory used by all internal contents. It is used
Expand Down
3 changes: 2 additions & 1 deletion core/vote/vote_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ import (
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/params"
)

// Many validators maintain backup machines.
// When switching from a primary node to a backup (e.g., due to failure),
// the new node may cast votes for the same block height that the previous node already voted on.
// To avoid double-voting issues, the node should wait for a few blocks
// before participating in voting after it starts mining.
const blocksNumberSinceMining = 20
const blocksNumberSinceMining = 20 * params.MaxwellBlockTimeReductionFactorForBSC
Comment thread
tak1827 marked this conversation as resolved.

var diffInTurn = big.NewInt(2) // Block difficulty for in-turn signatures
var votesManagerCounter = metrics.NewRegisteredCounter("votesManager/local", nil)
Expand Down
2 changes: 1 addition & 1 deletion core/vote/vote_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (

highestVerifiedBlockChanSize = 10 // highestVerifiedBlockChanSize is the size of channel listening to HighestVerifiedBlockEvent.

defaultMajorityThreshold = 14 // this is an inaccurate value, mainly used for metric acquisition, ref parlia.verifyVoteAttestation
defaultMajorityThreshold = 20 // this is an inaccurate value, mainly used for metric acquisition, ref parlia.verifyVoteAttestation
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/vote/vote_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func testVotePool(t *testing.T, isValidRules bool) {
// Test future votes scenario: votes number within latestBlockHeader ~ latestBlockHeader + 11
futureVote := &types.VoteEnvelope{
Data: &types.VoteData{
TargetNumber: 294,
TargetNumber: 294 - (blocksNumberSinceMining / params.MaxwellBlockTimeReductionFactorForBSC) - blocksNumberSinceMining,
},
}
if err := voteManager.signer.SignVote(futureVote); err != nil {
Expand Down
Loading