diff --git a/README.md b/README.md index 85e83dd6f0..502506dd2c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 80e0bbdd66..ae06a111e1 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -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", diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 684c2a7394..409c50dab3 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -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) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index b5afb76f5e..8552ed3ab9 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -91,7 +91,9 @@ import ( const ( // All flags for BSC specific features default to false - bscFeaturesDefault = false + bscFeaturesDefaultBool = false + bscFeaturesDefaultInt = 0 + bscFeaturesDefaultString = "" ) var ( @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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{ @@ -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", diff --git a/common/bidutil/bidutil.go b/common/bidutil/bidutil.go deleted file mode 100644 index 22b3891d1f..0000000000 --- a/common/bidutil/bidutil.go +++ /dev/null @@ -1,23 +0,0 @@ -package bidutil - -import ( - "time" - - "github.com/ethereum/go-ethereum/core/types" -) - -// BidBetterBefore returns the time when the next bid better be received, considering the delay and bid simulation. -// BidBetterBefore is earlier than BidMustBefore. -func BidBetterBefore(parentHeader *types.Header, blockPeriod uint64, delayLeftOver, simulationLeftOver time.Duration) time.Time { - nextHeaderTime := BidMustBefore(parentHeader, blockPeriod, delayLeftOver) - nextHeaderTime = nextHeaderTime.Add(-simulationLeftOver) - return nextHeaderTime -} - -// BidMustBefore returns the time when the next bid must be received, -// only considering the consensus delay but not bid simulation duration. -func BidMustBefore(parentHeader *types.Header, blockPeriod uint64, delayLeftOver time.Duration) time.Time { - nextHeaderTime := time.UnixMilli(int64(parentHeader.MilliTimestamp() + blockPeriod)) - nextHeaderTime = nextHeaderTime.Add(-delayLeftOver) - return nextHeaderTime -} diff --git a/common/format.go b/common/format.go index f8d2808846..7af41f52d5 100644 --- a/common/format.go +++ b/common/format.go @@ -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") -} diff --git a/consensus/misc/eip4844/eip4844.go b/consensus/misc/eip4844/eip4844.go index 382ce67a1e..5d72563221 100644 --- a/consensus/misc/eip4844/eip4844.go +++ b/consensus/misc/eip4844/eip4844.go @@ -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 diff --git a/contracts/oasys/deployments14.go b/contracts/oasys/deployments14.go index fc19c0c5fd..0285833975 100644 --- a/contracts/oasys/deployments14.go +++ b/contracts/oasys/deployments14.go @@ -19,7 +19,7 @@ var deployments14_slash_indicator_mainnet = []*deployment{ { // commit: https://github.com/oasysgames/oasys-genesis-contract/blob/v1.8.0/contracts/SlashIndicator.sol contract: slashIndicator, - code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610ebe565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f00000000000000000000000000000000000000000000000000000000000000f881565b60405161ffff90911681526020016100d2565b610095610160366004610faf565b6103ca565b61010a600381565b81511580159061017d5750805115155b6101bd5760405162461bcd60e51b815260206004820152600c60248201526b32b6b83a3c903432b0b232b960a11b60448201526064015b60405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101d55790505090506102197f00000000000000000000000000000000000000000000000000000000000000f861ffff166106e1565b8160008151811061022c5761022c611064565b6020026020010181905250610240836106fa565b8160018151811061025357610253611064565b6020026020010181905250610267826106fa565b8160028151811061027a5761027a611064565b6020026020010181905250600061029082610753565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa6102d257600080fd5b5060148101516034820151436102e66107f7565b6102f09083611090565b10156103315760405162461bcd60e51b815260206004820152601060248201526f195d9a59195b98d9481d1bdbc81bdb1960821b60448201526064016101b4565b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a7009161038f919086906003602482016110a8565b600060405180830381600087803b1580156103a957600080fd5b505af11580156103bd573d6000803e3d6000fd5b5050505050505050505050565b436103d36107f7565b8251604001516103e39190611090565b1180156104095750436103f46107f7565b8260200151604001516104079190611090565b115b61044c5760405162461bcd60e51b81526020600482015260146024820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b60448201526064016101b4565b80602001516020015181600001516020015114801561047a5750806020015160600151816000015160600151145b156104bd5760405162461bcd60e51b815260206004820152601360248201527274776f206964656e746963616c20766f74657360681b60448201526064016101b4565b8051604081015190511080156104dc5750602081015160408101519051105b6105285760405162461bcd60e51b815260206004820152601960248201527f7372634e756d20626967676572207468616e207461724e756d0000000000000060448201526064016101b4565b60208101515181515110801561054d5750806000015160400151816020015160400151105b8061057857508051516020820151511080156105785750806020015160400151816000015160400151105b806105925750806020015160400151816000015160400151145b6105de5760405162461bcd60e51b815260206004820152601a60248201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c657300000000000060448201526064016101b4565b6105f081600001518260400151610885565b8015610609575061060981602001518260400151610885565b6106555760405162461bcd60e51b815260206004820152601760248201527f766572696679207369676e6174757265206661696c656400000000000000000060448201526064016101b4565b6040808201519051622665a760e81b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916106ac916000918291906001906004016110a8565b600060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b5050505050565b60606106f46106ef83610a93565b6106fa565b92915050565b6060815160011480156107325750607f60f81b8260008151811061072057610720611064565b01602001516001600160f81b03191611155b1561073b575090565b6106f461074d8351608060ff16610ba7565b83610cbe565b606081516000141561077357505060408051600081526020810190915290565b60008260008151811061078857610788611064565b602002602001015190506000600190505b83518110156107d7576107c5828583815181106107b8576107b8611064565b6020026020010151610cbe565b91506107d081611121565b9050610799565b506107f06107ea825160c060ff16610ba7565b82610cbe565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa158015610858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087c919061113c565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816108a05750506040805160208082528183019092529192506000919080820181803683370190505090506108e585600001516106e1565b826000815181106108f8576108f8611064565b602002602001018190525061091e60208660200151839091018181526020918201910152565b610927816106fa565b8260018151811061093a5761093a611064565b602002602001018190525061095285604001516106e1565b8260028151811061096557610965611064565b602002602001018190525061098b60208660600151839091018181526020918201910152565b610994816106fa565b826003815181106109a7576109a7611064565b60200260200101819052506109d660206109c084610753565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610a06818360006020610d3b565b610a1881876080015160206060610d3b565b610a26818660806030610d3b565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610a6357600080fd5b506001610a71826000610dab565b60ff1614610a865760009450505050506106f4565b5060019695505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ad857506018610afc565b6fffffffffffffffffffffffffffffffff198416610af857506010610afc565b5060005b6020811015610b4057818181518110610b1757610b17611064565b01602001516001600160f81b03191615610b3057610b40565b610b3981611121565b9050610afc565b6000610b4d8260206111b7565b905060008167ffffffffffffffff811115610b6a57610b6a610dce565b6040519080825280601f01601f191660200182016040528015610b94576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610bf25760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b60448201526064016101b4565b60408051600180825281830190925260009160208201818036833701905050905060378411610c5957610c258385611090565b60f81b81600081518110610c3b57610c3b611064565b60200101906001600160f81b031916908160001a90535090506106f4565b6000610c6485610a93565b9050838151610c739190611090565b610c7e906037611090565b60f81b82600081518110610c9457610c94611064565b60200101906001600160f81b031916908160001a905350610cb58282610cbe565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610cef578051835260209283019201610cd7565b50855184518101855292509050808201602086015b81831015610d1c578051835260209283019201610d04565b508651929092011591909101601f01601f191660405250905092915050565b60005b818110156106da57838181518110610d5857610d58611064565b01602001516001600160f81b0319168584610d7281611121565b955081518110610d8457610d84611064565b60200101906001600160f81b031916908160001a905350610da481611121565b9050610d3e565b6000610db8826001611090565b83511015610dc557600080fd5b50016001015190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610e0757610e07610dce565b60405290565b604051610120810167ffffffffffffffff81118282101715610e0757610e07610dce565b600082601f830112610e4257600080fd5b813567ffffffffffffffff80821115610e5d57610e5d610dce565b604051601f8301601f19908116603f01168101908282118183101715610e8557610e85610dce565b81604052838152866020858801011115610e9e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610ed157600080fd5b823567ffffffffffffffff80821115610ee957600080fd5b610ef586838701610e31565b93506020850135915080821115610f0b57600080fd5b50610f1885828601610e31565b9150509250929050565b600060a08284031215610f3457600080fd5b60405160a0810167ffffffffffffffff8282108183111715610f5857610f58610dce565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115610f9557600080fd5b50610fa285828601610e31565b6080830152505092915050565b600060208284031215610fc157600080fd5b813567ffffffffffffffff80821115610fd957600080fd5b9083019060608286031215610fed57600080fd5b610ff5610de4565b82358281111561100457600080fd5b61101087828601610f22565b82525060208301358281111561102557600080fd5b61103187828601610f22565b60208301525060408301358281111561104957600080fd5b61105587828601610e31565b60408301525095945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110a3576110a361107a565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b828110156110ef5786810182015185820160a0015281016110d3565b8281111561110157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b60006000198214156111355761113561107a565b5060010190565b6000610120828403121561114f57600080fd5b611157610e0d565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b6000828210156111c9576111c961107a565b50039056fea26469706673582212208cb8319386262bf2df34af5bc26ec08e42b8dab25a0ed8b6bf66a65c3d58df3264736f6c634300080c0033`), + code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610fe7565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f00000000000000000000000000000000000000000000000000000000000000f881565b60405161ffff90911681526020016100d2565b610095610160366004611053565b610459565b61010a600381565b821580610178575080155b15610195576040516233519360e11b815260040160405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101ad5790505090506101f17f00000000000000000000000000000000000000000000000000000000000000f861ffff16610835565b81600081518110610204576102046110a4565b602002602001018190525061024e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b81600181518110610261576102616110a4565b60200260200101819052506102ab83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b816002815181106102be576102be6110a4565b602002602001018190525060006102d4826108a7565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa61031657600080fd5b50601481015160348201514361032a61094b565b61033490836110d0565b101561037357804361034461094b565b604051630182e80760e71b81526004810193909352602483019190915260448201526064015b60405180910390fd5b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916103d1919086906003602482016110e8565b600060405180830381600087803b1580156103eb57600080fd5b505af11580156103ff573d6000803e3d6000fd5b50505050816001600160a01b03167f416f2a54dbc4bc9f8447591684a243b9bf8a058798f6b04f4492871fb9dcf9248a8a8a8a86436040516104469695949392919061118a565b60405180910390a2505050505050505050565b4361046261094b565b61046c83806111c7565b6040013561047a91906110d0565b1115806104a957504361048b61094b565b61049860208401846111c7565b604001356104a691906110d0565b11155b15610505576104b881806111c7565b604001356104c960208301836111c7565b60400135436104d661094b565b604051636d33298d60e01b8152600481019490945260248401929092526044830152606482015260840161036a565b61051260208201826111c7565b6020013561052082806111c7565b6020013514801561054d575061053960208201826111c7565b6060013561054782806111c7565b60600135145b1561056b57604051630a298d5160e21b815260040160405180910390fd5b61057581806111c7565b3561058082806111c7565b604001351115806105ae575061059960208201826111c7565b356105a760208301836111c7565b6040013511155b1561061c576105bd81806111c7565b356105c882806111c7565b604001356105d960208401846111c7565b356105e760208501856111c7565b60408051630321016360e61b81526004810195909552602485019390935260448401919091520135606482015260840161036a565b61062960208201826111c7565b3561063482806111c7565b3510801561065e575061064781806111c7565b6040013561065860208301836111c7565b60400135105b806106a6575061066e81806111c7565b3561067c60208301836111c7565b351080156106a6575061069260208201826111c7565b604001356106a082806111c7565b60400135105b806106cd57506106b960208201826111c7565b604001356106c782806111c7565b60400135145b6106ea5760405163a2dde58760e01b815260040160405180910390fd5b6107096106f782806111c7565b61070460408401846111e7565b6109d9565b158061072257506107206106f760208301836111c7565b155b156107405760405163694bf28d60e11b815260040160405180910390fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000100116632665a70060008061077f60408601866111e7565b60016040518663ffffffff1660e01b81526004016107a195949392919061122e565b600060405180830381600087803b1580156107bb57600080fd5b505af11580156107cf573d6000803e3d6000fd5b507fd4398b9ace041382d6b9179a7561d36e690bdc7cfe1e548a9eaa9f7fec0b5227925061080391505060408301836111e7565b61080d84806111c7565b61081a60208601866111c7565b60405161082a94939291906112e8565b60405180910390a150565b606061084861084383610c5c565b61084e565b92915050565b6060815160011480156108865750607f60f81b82600081518110610874576108746110a4565b01602001516001600160f81b03191611155b1561088f575090565b6108486108a18351608060ff16610d70565b83610e87565b60608151600014156108c757505060408051600081526020810190915290565b6000826000815181106108dc576108dc6110a4565b602002602001015190506000600190505b835181101561092b576109198285838151811061090c5761090c6110a4565b6020026020010151610e87565b91506109248161132d565b90506108ed565b5061094461093e825160c060ff16610d70565b82610e87565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190611380565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816109f4575050604080516020808252818301909252919250600091908082018180368337019050509050610a368635610835565b82600081518110610a4957610a496110a4565b6020026020010181905250610a6f60208760200135839091018181526020918201910152565b610a788161084e565b82600181518110610a8b57610a8b6110a4565b6020026020010181905250610aa38660400135610835565b82600281518110610ab657610ab66110a4565b6020026020010181905250610adc60208760600135839091018181526020918201910152565b610ae58161084e565b82600381518110610af857610af86110a4565b6020026020010181905250610b276020610b11846108a7565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610b57818360006020610f04565b610ba881610b6860808a018a6111e7565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506020925060609150610f049050565b610bee8187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506080925060309150610f049050565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610c2b57600080fd5b506001610c39826000610f7b565b60ff1614610c4e576000945050505050610944565b506001979650505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ca157506018610cc5565b6fffffffffffffffffffffffffffffffff198416610cc157506010610cc5565b5060005b6020811015610d0957818181518110610ce057610ce06110a4565b01602001516001600160f81b03191615610cf957610d09565b610d028161132d565b9050610cc5565b6000610d168260206113fb565b905060008167ffffffffffffffff811115610d3357610d3361108e565b6040519080825280601f01601f191660200182016040528015610d5d576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610dbb5760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b604482015260640161036a565b60408051600180825281830190925260009160208201818036833701905050905060378411610e2257610dee83856110d0565b60f81b81600081518110610e0457610e046110a4565b60200101906001600160f81b031916908160001a9053509050610848565b6000610e2d85610c5c565b9050838151610e3c91906110d0565b610e479060376110d0565b60f81b82600081518110610e5d57610e5d6110a4565b60200101906001600160f81b031916908160001a905350610e7e8282610e87565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610eb8578051835260209283019201610ea0565b50855184518101855292509050808201602086015b81831015610ee5578051835260209283019201610ecd565b508651929092011591909101601f01601f191660405250905092915050565b60005b81811015610f7457838181518110610f2157610f216110a4565b01602001516001600160f81b0319168584610f3b8161132d565b955081518110610f4d57610f4d6110a4565b60200101906001600160f81b031916908160001a905350610f6d8161132d565b9050610f07565b5050505050565b6000610f888260016110d0565b83511015610f9557600080fd5b50016001015190565b60008083601f840112610fb057600080fd5b50813567ffffffffffffffff811115610fc857600080fd5b602083019150836020828501011115610fe057600080fd5b9250929050565b60008060008060408587031215610ffd57600080fd5b843567ffffffffffffffff8082111561101557600080fd5b61102188838901610f9e565b9096509450602087013591508082111561103a57600080fd5b5061104787828801610f9e565b95989497509550505050565b60006020828403121561106557600080fd5b813567ffffffffffffffff81111561107c57600080fd5b82016060818503121561094457600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110e3576110e36110ba565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b8281101561112f5786810182015185820160a001528101611113565b8281111561114157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60808152600061119e60808301888a611161565b82810360208401526111b1818789611161565b6040840195909552505060600152949350505050565b60008235609e198336030181126111dd57600080fd5b9190910192915050565b6000808335601e198436030181126111fe57600080fd5b83018035915067ffffffffffffffff82111561121957600080fd5b602001915036819003821315610fe057600080fd5b6001600160a01b0386811682528516602082015260806040820181905260009061125b9083018587611161565b90508260608301529695505050505050565b8035825260208101356020830152604081013560408301526060810135606083015260006080820135601e198336030181126112a857600080fd5b8201803567ffffffffffffffff8111156112c157600080fd5b8036038413156112d057600080fd5b60a06080860152610e7e60a086018260208501611161565b6060815260006112fc606083018688611161565b828103602084015261130e818661126d565b90508281036040840152611322818561126d565b979650505050505050565b6000600019821415611341576113416110ba565b5060010190565b604051610120810167ffffffffffffffff8111828210171561137a57634e487b7160e01b600052604160045260246000fd5b60405290565b6000610120828403121561139357600080fd5b61139b611348565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b60008282101561140d5761140d6110ba565b50039056fea26469706673582212202ca9da21dec8d34a57fb32b1c9e6f8b6cf4eab7b40b3d99d0896cee00bfcf1f064736f6c634300080c0033`), }, } @@ -27,7 +27,7 @@ var deployments14_slash_indicator_testnet = []*deployment{ { // commit: https://github.com/oasysgames/oasys-genesis-contract/blob/v1.8.0/contracts/SlashIndicator.sol contract: slashIndicator, - code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610ebe565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f000000000000000000000000000000000000000000000000000000000000249c81565b60405161ffff90911681526020016100d2565b610095610160366004610faf565b6103ca565b61010a600381565b81511580159061017d5750805115155b6101bd5760405162461bcd60e51b815260206004820152600c60248201526b32b6b83a3c903432b0b232b960a11b60448201526064015b60405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101d55790505090506102197f000000000000000000000000000000000000000000000000000000000000249c61ffff166106e1565b8160008151811061022c5761022c611064565b6020026020010181905250610240836106fa565b8160018151811061025357610253611064565b6020026020010181905250610267826106fa565b8160028151811061027a5761027a611064565b6020026020010181905250600061029082610753565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa6102d257600080fd5b5060148101516034820151436102e66107f7565b6102f09083611090565b10156103315760405162461bcd60e51b815260206004820152601060248201526f195d9a59195b98d9481d1bdbc81bdb1960821b60448201526064016101b4565b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a7009161038f919086906003602482016110a8565b600060405180830381600087803b1580156103a957600080fd5b505af11580156103bd573d6000803e3d6000fd5b5050505050505050505050565b436103d36107f7565b8251604001516103e39190611090565b1180156104095750436103f46107f7565b8260200151604001516104079190611090565b115b61044c5760405162461bcd60e51b81526020600482015260146024820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b60448201526064016101b4565b80602001516020015181600001516020015114801561047a5750806020015160600151816000015160600151145b156104bd5760405162461bcd60e51b815260206004820152601360248201527274776f206964656e746963616c20766f74657360681b60448201526064016101b4565b8051604081015190511080156104dc5750602081015160408101519051105b6105285760405162461bcd60e51b815260206004820152601960248201527f7372634e756d20626967676572207468616e207461724e756d0000000000000060448201526064016101b4565b60208101515181515110801561054d5750806000015160400151816020015160400151105b8061057857508051516020820151511080156105785750806020015160400151816000015160400151105b806105925750806020015160400151816000015160400151145b6105de5760405162461bcd60e51b815260206004820152601a60248201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c657300000000000060448201526064016101b4565b6105f081600001518260400151610885565b8015610609575061060981602001518260400151610885565b6106555760405162461bcd60e51b815260206004820152601760248201527f766572696679207369676e6174757265206661696c656400000000000000000060448201526064016101b4565b6040808201519051622665a760e81b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916106ac916000918291906001906004016110a8565b600060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b5050505050565b60606106f46106ef83610a93565b6106fa565b92915050565b6060815160011480156107325750607f60f81b8260008151811061072057610720611064565b01602001516001600160f81b03191611155b1561073b575090565b6106f461074d8351608060ff16610ba7565b83610cbe565b606081516000141561077357505060408051600081526020810190915290565b60008260008151811061078857610788611064565b602002602001015190506000600190505b83518110156107d7576107c5828583815181106107b8576107b8611064565b6020026020010151610cbe565b91506107d081611121565b9050610799565b506107f06107ea825160c060ff16610ba7565b82610cbe565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa158015610858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087c919061113c565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816108a05750506040805160208082528183019092529192506000919080820181803683370190505090506108e585600001516106e1565b826000815181106108f8576108f8611064565b602002602001018190525061091e60208660200151839091018181526020918201910152565b610927816106fa565b8260018151811061093a5761093a611064565b602002602001018190525061095285604001516106e1565b8260028151811061096557610965611064565b602002602001018190525061098b60208660600151839091018181526020918201910152565b610994816106fa565b826003815181106109a7576109a7611064565b60200260200101819052506109d660206109c084610753565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610a06818360006020610d3b565b610a1881876080015160206060610d3b565b610a26818660806030610d3b565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610a6357600080fd5b506001610a71826000610dab565b60ff1614610a865760009450505050506106f4565b5060019695505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ad857506018610afc565b6fffffffffffffffffffffffffffffffff198416610af857506010610afc565b5060005b6020811015610b4057818181518110610b1757610b17611064565b01602001516001600160f81b03191615610b3057610b40565b610b3981611121565b9050610afc565b6000610b4d8260206111b7565b905060008167ffffffffffffffff811115610b6a57610b6a610dce565b6040519080825280601f01601f191660200182016040528015610b94576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610bf25760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b60448201526064016101b4565b60408051600180825281830190925260009160208201818036833701905050905060378411610c5957610c258385611090565b60f81b81600081518110610c3b57610c3b611064565b60200101906001600160f81b031916908160001a90535090506106f4565b6000610c6485610a93565b9050838151610c739190611090565b610c7e906037611090565b60f81b82600081518110610c9457610c94611064565b60200101906001600160f81b031916908160001a905350610cb58282610cbe565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610cef578051835260209283019201610cd7565b50855184518101855292509050808201602086015b81831015610d1c578051835260209283019201610d04565b508651929092011591909101601f01601f191660405250905092915050565b60005b818110156106da57838181518110610d5857610d58611064565b01602001516001600160f81b0319168584610d7281611121565b955081518110610d8457610d84611064565b60200101906001600160f81b031916908160001a905350610da481611121565b9050610d3e565b6000610db8826001611090565b83511015610dc557600080fd5b50016001015190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610e0757610e07610dce565b60405290565b604051610120810167ffffffffffffffff81118282101715610e0757610e07610dce565b600082601f830112610e4257600080fd5b813567ffffffffffffffff80821115610e5d57610e5d610dce565b604051601f8301601f19908116603f01168101908282118183101715610e8557610e85610dce565b81604052838152866020858801011115610e9e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610ed157600080fd5b823567ffffffffffffffff80821115610ee957600080fd5b610ef586838701610e31565b93506020850135915080821115610f0b57600080fd5b50610f1885828601610e31565b9150509250929050565b600060a08284031215610f3457600080fd5b60405160a0810167ffffffffffffffff8282108183111715610f5857610f58610dce565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115610f9557600080fd5b50610fa285828601610e31565b6080830152505092915050565b600060208284031215610fc157600080fd5b813567ffffffffffffffff80821115610fd957600080fd5b9083019060608286031215610fed57600080fd5b610ff5610de4565b82358281111561100457600080fd5b61101087828601610f22565b82525060208301358281111561102557600080fd5b61103187828601610f22565b60208301525060408301358281111561104957600080fd5b61105587828601610e31565b60408301525095945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110a3576110a361107a565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b828110156110ef5786810182015185820160a0015281016110d3565b8281111561110157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b60006000198214156111355761113561107a565b5060010190565b6000610120828403121561114f57600080fd5b611157610e0d565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b6000828210156111c9576111c961107a565b50039056fea26469706673582212208cb8319386262bf2df34af5bc26ec08e42b8dab25a0ed8b6bf66a65c3d58df3264736f6c634300080c0033`), + code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610fe7565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f000000000000000000000000000000000000000000000000000000000000249c81565b60405161ffff90911681526020016100d2565b610095610160366004611053565b610459565b61010a600381565b821580610178575080155b15610195576040516233519360e11b815260040160405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101ad5790505090506101f17f000000000000000000000000000000000000000000000000000000000000249c61ffff16610835565b81600081518110610204576102046110a4565b602002602001018190525061024e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b81600181518110610261576102616110a4565b60200260200101819052506102ab83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b816002815181106102be576102be6110a4565b602002602001018190525060006102d4826108a7565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa61031657600080fd5b50601481015160348201514361032a61094b565b61033490836110d0565b101561037357804361034461094b565b604051630182e80760e71b81526004810193909352602483019190915260448201526064015b60405180910390fd5b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916103d1919086906003602482016110e8565b600060405180830381600087803b1580156103eb57600080fd5b505af11580156103ff573d6000803e3d6000fd5b50505050816001600160a01b03167f416f2a54dbc4bc9f8447591684a243b9bf8a058798f6b04f4492871fb9dcf9248a8a8a8a86436040516104469695949392919061118a565b60405180910390a2505050505050505050565b4361046261094b565b61046c83806111c7565b6040013561047a91906110d0565b1115806104a957504361048b61094b565b61049860208401846111c7565b604001356104a691906110d0565b11155b15610505576104b881806111c7565b604001356104c960208301836111c7565b60400135436104d661094b565b604051636d33298d60e01b8152600481019490945260248401929092526044830152606482015260840161036a565b61051260208201826111c7565b6020013561052082806111c7565b6020013514801561054d575061053960208201826111c7565b6060013561054782806111c7565b60600135145b1561056b57604051630a298d5160e21b815260040160405180910390fd5b61057581806111c7565b3561058082806111c7565b604001351115806105ae575061059960208201826111c7565b356105a760208301836111c7565b6040013511155b1561061c576105bd81806111c7565b356105c882806111c7565b604001356105d960208401846111c7565b356105e760208501856111c7565b60408051630321016360e61b81526004810195909552602485019390935260448401919091520135606482015260840161036a565b61062960208201826111c7565b3561063482806111c7565b3510801561065e575061064781806111c7565b6040013561065860208301836111c7565b60400135105b806106a6575061066e81806111c7565b3561067c60208301836111c7565b351080156106a6575061069260208201826111c7565b604001356106a082806111c7565b60400135105b806106cd57506106b960208201826111c7565b604001356106c782806111c7565b60400135145b6106ea5760405163a2dde58760e01b815260040160405180910390fd5b6107096106f782806111c7565b61070460408401846111e7565b6109d9565b158061072257506107206106f760208301836111c7565b155b156107405760405163694bf28d60e11b815260040160405180910390fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000100116632665a70060008061077f60408601866111e7565b60016040518663ffffffff1660e01b81526004016107a195949392919061122e565b600060405180830381600087803b1580156107bb57600080fd5b505af11580156107cf573d6000803e3d6000fd5b507fd4398b9ace041382d6b9179a7561d36e690bdc7cfe1e548a9eaa9f7fec0b5227925061080391505060408301836111e7565b61080d84806111c7565b61081a60208601866111c7565b60405161082a94939291906112e8565b60405180910390a150565b606061084861084383610c5c565b61084e565b92915050565b6060815160011480156108865750607f60f81b82600081518110610874576108746110a4565b01602001516001600160f81b03191611155b1561088f575090565b6108486108a18351608060ff16610d70565b83610e87565b60608151600014156108c757505060408051600081526020810190915290565b6000826000815181106108dc576108dc6110a4565b602002602001015190506000600190505b835181101561092b576109198285838151811061090c5761090c6110a4565b6020026020010151610e87565b91506109248161132d565b90506108ed565b5061094461093e825160c060ff16610d70565b82610e87565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190611380565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816109f4575050604080516020808252818301909252919250600091908082018180368337019050509050610a368635610835565b82600081518110610a4957610a496110a4565b6020026020010181905250610a6f60208760200135839091018181526020918201910152565b610a788161084e565b82600181518110610a8b57610a8b6110a4565b6020026020010181905250610aa38660400135610835565b82600281518110610ab657610ab66110a4565b6020026020010181905250610adc60208760600135839091018181526020918201910152565b610ae58161084e565b82600381518110610af857610af86110a4565b6020026020010181905250610b276020610b11846108a7565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610b57818360006020610f04565b610ba881610b6860808a018a6111e7565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506020925060609150610f049050565b610bee8187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506080925060309150610f049050565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610c2b57600080fd5b506001610c39826000610f7b565b60ff1614610c4e576000945050505050610944565b506001979650505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ca157506018610cc5565b6fffffffffffffffffffffffffffffffff198416610cc157506010610cc5565b5060005b6020811015610d0957818181518110610ce057610ce06110a4565b01602001516001600160f81b03191615610cf957610d09565b610d028161132d565b9050610cc5565b6000610d168260206113fb565b905060008167ffffffffffffffff811115610d3357610d3361108e565b6040519080825280601f01601f191660200182016040528015610d5d576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610dbb5760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b604482015260640161036a565b60408051600180825281830190925260009160208201818036833701905050905060378411610e2257610dee83856110d0565b60f81b81600081518110610e0457610e046110a4565b60200101906001600160f81b031916908160001a9053509050610848565b6000610e2d85610c5c565b9050838151610e3c91906110d0565b610e479060376110d0565b60f81b82600081518110610e5d57610e5d6110a4565b60200101906001600160f81b031916908160001a905350610e7e8282610e87565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610eb8578051835260209283019201610ea0565b50855184518101855292509050808201602086015b81831015610ee5578051835260209283019201610ecd565b508651929092011591909101601f01601f191660405250905092915050565b60005b81811015610f7457838181518110610f2157610f216110a4565b01602001516001600160f81b0319168584610f3b8161132d565b955081518110610f4d57610f4d6110a4565b60200101906001600160f81b031916908160001a905350610f6d8161132d565b9050610f07565b5050505050565b6000610f888260016110d0565b83511015610f9557600080fd5b50016001015190565b60008083601f840112610fb057600080fd5b50813567ffffffffffffffff811115610fc857600080fd5b602083019150836020828501011115610fe057600080fd5b9250929050565b60008060008060408587031215610ffd57600080fd5b843567ffffffffffffffff8082111561101557600080fd5b61102188838901610f9e565b9096509450602087013591508082111561103a57600080fd5b5061104787828801610f9e565b95989497509550505050565b60006020828403121561106557600080fd5b813567ffffffffffffffff81111561107c57600080fd5b82016060818503121561094457600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110e3576110e36110ba565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b8281101561112f5786810182015185820160a001528101611113565b8281111561114157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60808152600061119e60808301888a611161565b82810360208401526111b1818789611161565b6040840195909552505060600152949350505050565b60008235609e198336030181126111dd57600080fd5b9190910192915050565b6000808335601e198436030181126111fe57600080fd5b83018035915067ffffffffffffffff82111561121957600080fd5b602001915036819003821315610fe057600080fd5b6001600160a01b0386811682528516602082015260806040820181905260009061125b9083018587611161565b90508260608301529695505050505050565b8035825260208101356020830152604081013560408301526060810135606083015260006080820135601e198336030181126112a857600080fd5b8201803567ffffffffffffffff8111156112c157600080fd5b8036038413156112d057600080fd5b60a06080860152610e7e60a086018260208501611161565b6060815260006112fc606083018688611161565b828103602084015261130e818661126d565b90508281036040840152611322818561126d565b979650505050505050565b6000600019821415611341576113416110ba565b5060010190565b604051610120810167ffffffffffffffff8111828210171561137a57634e487b7160e01b600052604160045260246000fd5b60405290565b6000610120828403121561139357600080fd5b61139b611348565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b60008282101561140d5761140d6110ba565b50039056fea26469706673582212202ca9da21dec8d34a57fb32b1c9e6f8b6cf4eab7b40b3d99d0896cee00bfcf1f064736f6c634300080c0033`), }, } @@ -35,6 +35,6 @@ var deployments14_slash_indicator_localnet = []*deployment{ { // commit: https://github.com/oasysgames/oasys-genesis-contract/blob/v1.8.0/contracts/SlashIndicator.sol contract: slashIndicator, - code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610ebe565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f000000000000000000000000000000000000000000000000000000000000303981565b60405161ffff90911681526020016100d2565b610095610160366004610faf565b6103ca565b61010a600381565b81511580159061017d5750805115155b6101bd5760405162461bcd60e51b815260206004820152600c60248201526b32b6b83a3c903432b0b232b960a11b60448201526064015b60405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101d55790505090506102197f000000000000000000000000000000000000000000000000000000000000303961ffff166106e1565b8160008151811061022c5761022c611064565b6020026020010181905250610240836106fa565b8160018151811061025357610253611064565b6020026020010181905250610267826106fa565b8160028151811061027a5761027a611064565b6020026020010181905250600061029082610753565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa6102d257600080fd5b5060148101516034820151436102e66107f7565b6102f09083611090565b10156103315760405162461bcd60e51b815260206004820152601060248201526f195d9a59195b98d9481d1bdbc81bdb1960821b60448201526064016101b4565b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a7009161038f919086906003602482016110a8565b600060405180830381600087803b1580156103a957600080fd5b505af11580156103bd573d6000803e3d6000fd5b5050505050505050505050565b436103d36107f7565b8251604001516103e39190611090565b1180156104095750436103f46107f7565b8260200151604001516104079190611090565b115b61044c5760405162461bcd60e51b81526020600482015260146024820152731d185c99d95d08189b1bd8dac81d1bdbc81bdb1960621b60448201526064016101b4565b80602001516020015181600001516020015114801561047a5750806020015160600151816000015160600151145b156104bd5760405162461bcd60e51b815260206004820152601360248201527274776f206964656e746963616c20766f74657360681b60448201526064016101b4565b8051604081015190511080156104dc5750602081015160408101519051105b6105285760405162461bcd60e51b815260206004820152601960248201527f7372634e756d20626967676572207468616e207461724e756d0000000000000060448201526064016101b4565b60208101515181515110801561054d5750806000015160400151816020015160400151105b8061057857508051516020820151511080156105785750806020015160400151816000015160400151105b806105925750806020015160400151816000015160400151145b6105de5760405162461bcd60e51b815260206004820152601a60248201527f6e6f2076696f6c6174696f6e206f6620766f74652072756c657300000000000060448201526064016101b4565b6105f081600001518260400151610885565b8015610609575061060981602001518260400151610885565b6106555760405162461bcd60e51b815260206004820152601760248201527f766572696679207369676e6174757265206661696c656400000000000000000060448201526064016101b4565b6040808201519051622665a760e81b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916106ac916000918291906001906004016110a8565b600060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b5050505050565b60606106f46106ef83610a93565b6106fa565b92915050565b6060815160011480156107325750607f60f81b8260008151811061072057610720611064565b01602001516001600160f81b03191611155b1561073b575090565b6106f461074d8351608060ff16610ba7565b83610cbe565b606081516000141561077357505060408051600081526020810190915290565b60008260008151811061078857610788611064565b602002602001015190506000600190505b83518110156107d7576107c5828583815181106107b8576107b8611064565b6020026020010151610cbe565b91506107d081611121565b9050610799565b506107f06107ea825160c060ff16610ba7565b82610cbe565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa158015610858573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087c919061113c565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816108a05750506040805160208082528183019092529192506000919080820181803683370190505090506108e585600001516106e1565b826000815181106108f8576108f8611064565b602002602001018190525061091e60208660200151839091018181526020918201910152565b610927816106fa565b8260018151811061093a5761093a611064565b602002602001018190525061095285604001516106e1565b8260028151811061096557610965611064565b602002602001018190525061098b60208660600151839091018181526020918201910152565b610994816106fa565b826003815181106109a7576109a7611064565b60200260200101819052506109d660206109c084610753565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610a06818360006020610d3b565b610a1881876080015160206060610d3b565b610a26818660806030610d3b565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610a6357600080fd5b506001610a71826000610dab565b60ff1614610a865760009450505050506106f4565b5060019695505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ad857506018610afc565b6fffffffffffffffffffffffffffffffff198416610af857506010610afc565b5060005b6020811015610b4057818181518110610b1757610b17611064565b01602001516001600160f81b03191615610b3057610b40565b610b3981611121565b9050610afc565b6000610b4d8260206111b7565b905060008167ffffffffffffffff811115610b6a57610b6a610dce565b6040519080825280601f01601f191660200182016040528015610b94576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610bf25760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b60448201526064016101b4565b60408051600180825281830190925260009160208201818036833701905050905060378411610c5957610c258385611090565b60f81b81600081518110610c3b57610c3b611064565b60200101906001600160f81b031916908160001a90535090506106f4565b6000610c6485610a93565b9050838151610c739190611090565b610c7e906037611090565b60f81b82600081518110610c9457610c94611064565b60200101906001600160f81b031916908160001a905350610cb58282610cbe565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610cef578051835260209283019201610cd7565b50855184518101855292509050808201602086015b81831015610d1c578051835260209283019201610d04565b508651929092011591909101601f01601f191660405250905092915050565b60005b818110156106da57838181518110610d5857610d58611064565b01602001516001600160f81b0319168584610d7281611121565b955081518110610d8457610d84611064565b60200101906001600160f81b031916908160001a905350610da481611121565b9050610d3e565b6000610db8826001611090565b83511015610dc557600080fd5b50016001015190565b634e487b7160e01b600052604160045260246000fd5b6040516060810167ffffffffffffffff81118282101715610e0757610e07610dce565b60405290565b604051610120810167ffffffffffffffff81118282101715610e0757610e07610dce565b600082601f830112610e4257600080fd5b813567ffffffffffffffff80821115610e5d57610e5d610dce565b604051601f8301601f19908116603f01168101908282118183101715610e8557610e85610dce565b81604052838152866020858801011115610e9e57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215610ed157600080fd5b823567ffffffffffffffff80821115610ee957600080fd5b610ef586838701610e31565b93506020850135915080821115610f0b57600080fd5b50610f1885828601610e31565b9150509250929050565b600060a08284031215610f3457600080fd5b60405160a0810167ffffffffffffffff8282108183111715610f5857610f58610dce565b81604052829350843583526020850135602084015260408501356040840152606085013560608401526080850135915080821115610f9557600080fd5b50610fa285828601610e31565b6080830152505092915050565b600060208284031215610fc157600080fd5b813567ffffffffffffffff80821115610fd957600080fd5b9083019060608286031215610fed57600080fd5b610ff5610de4565b82358281111561100457600080fd5b61101087828601610f22565b82525060208301358281111561102557600080fd5b61103187828601610f22565b60208301525060408301358281111561104957600080fd5b61105587828601610e31565b60408301525095945050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110a3576110a361107a565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b828110156110ef5786810182015185820160a0015281016110d3565b8281111561110157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b60006000198214156111355761113561107a565b5060010190565b6000610120828403121561114f57600080fd5b611157610e0d565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b6000828210156111c9576111c961107a565b50039056fea26469706673582212208cb8319386262bf2df34af5bc26ec08e42b8dab25a0ed8b6bf66a65c3d58df3264736f6c634300080c0033`), + code: mustDecodeCode(`0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806395bc989d1161005b57806395bc989d146101025780639a8a059214610118578063cc844b7314610152578063e99bbfaa1461016557600080fd5b8063279621181461008257806374e2b63c146100975780637542ff95146100db575b600080fd5b610095610090366004610fe7565b61016d565b005b6100be7f000000000000000000000000000000000000000000000000000000000000100081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100be7f000000000000000000000000000000000000000000000000000000000000100181565b61010a600181565b6040519081526020016100d2565b61013f7f000000000000000000000000000000000000000000000000000000000000303981565b60405161ffff90911681526020016100d2565b610095610160366004611053565b610459565b61010a600381565b821580610178575080155b15610195576040516233519360e11b815260040160405180910390fd5b60408051600380825260808201909252600091816020015b60608152602001906001900390816101ad5790505090506101f17f000000000000000000000000000000000000000000000000000000000000303961ffff16610835565b81600081518110610204576102046110a4565b602002602001018190525061024e85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b81600181518110610261576102616110a4565b60200260200101819052506102ab83838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061084e92505050565b816002815181106102be576102be6110a4565b602002602001018190525060006102d4826108a7565b6040805160348082526060820190925291925060009190602082018180368337019050509050815160346020830182602086016068600019fa61031657600080fd5b50601481015160348201514361032a61094b565b61033490836110d0565b101561037357804361034461094b565b604051630182e80760e71b81526004810193909352602483019190915260448201526064015b60405180910390fd5b6040805160008082526020820192839052622665a760e81b9092526001600160a01b037f00000000000000000000000000000000000000000000000000000000000010011691632665a700916103d1919086906003602482016110e8565b600060405180830381600087803b1580156103eb57600080fd5b505af11580156103ff573d6000803e3d6000fd5b50505050816001600160a01b03167f416f2a54dbc4bc9f8447591684a243b9bf8a058798f6b04f4492871fb9dcf9248a8a8a8a86436040516104469695949392919061118a565b60405180910390a2505050505050505050565b4361046261094b565b61046c83806111c7565b6040013561047a91906110d0565b1115806104a957504361048b61094b565b61049860208401846111c7565b604001356104a691906110d0565b11155b15610505576104b881806111c7565b604001356104c960208301836111c7565b60400135436104d661094b565b604051636d33298d60e01b8152600481019490945260248401929092526044830152606482015260840161036a565b61051260208201826111c7565b6020013561052082806111c7565b6020013514801561054d575061053960208201826111c7565b6060013561054782806111c7565b60600135145b1561056b57604051630a298d5160e21b815260040160405180910390fd5b61057581806111c7565b3561058082806111c7565b604001351115806105ae575061059960208201826111c7565b356105a760208301836111c7565b6040013511155b1561061c576105bd81806111c7565b356105c882806111c7565b604001356105d960208401846111c7565b356105e760208501856111c7565b60408051630321016360e61b81526004810195909552602485019390935260448401919091520135606482015260840161036a565b61062960208201826111c7565b3561063482806111c7565b3510801561065e575061064781806111c7565b6040013561065860208301836111c7565b60400135105b806106a6575061066e81806111c7565b3561067c60208301836111c7565b351080156106a6575061069260208201826111c7565b604001356106a082806111c7565b60400135105b806106cd57506106b960208201826111c7565b604001356106c782806111c7565b60400135145b6106ea5760405163a2dde58760e01b815260040160405180910390fd5b6107096106f782806111c7565b61070460408401846111e7565b6109d9565b158061072257506107206106f760208301836111c7565b155b156107405760405163694bf28d60e11b815260040160405180910390fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000100116632665a70060008061077f60408601866111e7565b60016040518663ffffffff1660e01b81526004016107a195949392919061122e565b600060405180830381600087803b1580156107bb57600080fd5b505af11580156107cf573d6000803e3d6000fd5b507fd4398b9ace041382d6b9179a7561d36e690bdc7cfe1e548a9eaa9f7fec0b5227925061080391505060408301836111e7565b61080d84806111c7565b61081a60208601866111c7565b60405161082a94939291906112e8565b60405180910390a150565b606061084861084383610c5c565b61084e565b92915050565b6060815160011480156108865750607f60f81b82600081518110610874576108746110a4565b01602001516001600160f81b03191611155b1561088f575090565b6108486108a18351608060ff16610d70565b83610e87565b60608151600014156108c757505060408051600081526020810190915290565b6000826000815181106108dc576108dc6110a4565b602002602001015190506000600190505b835181101561092b576109198285838151811061090c5761090c6110a4565b6020026020010151610e87565b91506109248161132d565b90506108ed565b5061094461093e825160c060ff16610d70565b82610e87565b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000010006001600160a01b0316633fa4f2456040518163ffffffff1660e01b815260040161012060405180830381865afa1580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190611380565b60600151905090565b60408051600480825260a08201909252600091829190816020015b60608152602001906001900390816109f4575050604080516020808252818301909252919250600091908082018180368337019050509050610a368635610835565b82600081518110610a4957610a496110a4565b6020026020010181905250610a6f60208760200135839091018181526020918201910152565b610a788161084e565b82600181518110610a8b57610a8b6110a4565b6020026020010181905250610aa38660400135610835565b82600281518110610ab657610ab66110a4565b6020026020010181905250610adc60208760600135839091018181526020918201910152565b610ae58161084e565b82600381518110610af857610af86110a4565b6020026020010181905250610b276020610b11846108a7565b8051602091820120918401828152918101910152565b6040805160b080825260e08201909252600091602082018180368337019050509050610b57818360006020610f04565b610ba881610b6860808a018a6111e7565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506020925060609150610f049050565b610bee8187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506080925060309150610f049050565b604080516001808252818301909252600091602082018180368337019050509050815160016020830182602086016066600019fa610c2b57600080fd5b506001610c39826000610f7b565b60ff1614610c4e576000945050505050610944565b506001979650505050505050565b60408051602080825281830190925260609160009190602082018180368337505050602081018490529050600067ffffffffffffffff198416610ca157506018610cc5565b6fffffffffffffffffffffffffffffffff198416610cc157506010610cc5565b5060005b6020811015610d0957818181518110610ce057610ce06110a4565b01602001516001600160f81b03191615610cf957610d09565b610d028161132d565b9050610cc5565b6000610d168260206113fb565b905060008167ffffffffffffffff811115610d3357610d3361108e565b6040519080825280601f01601f191660200182016040528015610d5d576020820181803683370190505b5082810196909652508452509192915050565b6060680100000000000000008310610dbb5760405162461bcd60e51b815260206004820152600e60248201526d696e70757420746f6f206c6f6e6760901b604482015260640161036a565b60408051600180825281830190925260009160208201818036833701905050905060378411610e2257610dee83856110d0565b60f81b81600081518110610e0457610e046110a4565b60200101906001600160f81b031916908160001a9053509050610848565b6000610e2d85610c5c565b9050838151610e3c91906110d0565b610e479060376110d0565b60f81b82600081518110610e5d57610e5d6110a4565b60200101906001600160f81b031916908160001a905350610e7e8282610e87565b95945050505050565b6060806040519050835180825260208201818101602087015b81831015610eb8578051835260209283019201610ea0565b50855184518101855292509050808201602086015b81831015610ee5578051835260209283019201610ecd565b508651929092011591909101601f01601f191660405250905092915050565b60005b81811015610f7457838181518110610f2157610f216110a4565b01602001516001600160f81b0319168584610f3b8161132d565b955081518110610f4d57610f4d6110a4565b60200101906001600160f81b031916908160001a905350610f6d8161132d565b9050610f07565b5050505050565b6000610f888260016110d0565b83511015610f9557600080fd5b50016001015190565b60008083601f840112610fb057600080fd5b50813567ffffffffffffffff811115610fc857600080fd5b602083019150836020828501011115610fe057600080fd5b9250929050565b60008060008060408587031215610ffd57600080fd5b843567ffffffffffffffff8082111561101557600080fd5b61102188838901610f9e565b9096509450602087013591508082111561103a57600080fd5b5061104787828801610f9e565b95989497509550505050565b60006020828403121561106557600080fd5b813567ffffffffffffffff81111561107c57600080fd5b82016060818503121561094457600080fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156110e3576110e36110ba565b500190565b600060018060a01b038087168352602081871681850152608060408501528551915081608085015260005b8281101561112f5786810182015185820160a001528101611113565b8281111561114157600060a084870101525b5050606083019390935250601f91909101601f19160160a0019392505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60808152600061119e60808301888a611161565b82810360208401526111b1818789611161565b6040840195909552505060600152949350505050565b60008235609e198336030181126111dd57600080fd5b9190910192915050565b6000808335601e198436030181126111fe57600080fd5b83018035915067ffffffffffffffff82111561121957600080fd5b602001915036819003821315610fe057600080fd5b6001600160a01b0386811682528516602082015260806040820181905260009061125b9083018587611161565b90508260608301529695505050505050565b8035825260208101356020830152604081013560408301526060810135606083015260006080820135601e198336030181126112a857600080fd5b8201803567ffffffffffffffff8111156112c157600080fd5b8036038413156112d057600080fd5b60a06080860152610e7e60a086018260208501611161565b6060815260006112fc606083018688611161565b828103602084015261130e818661126d565b90508281036040840152611322818561126d565b979650505050505050565b6000600019821415611341576113416110ba565b5060010190565b604051610120810167ffffffffffffffff8111828210171561137a57634e487b7160e01b600052604160045260246000fd5b60405290565b6000610120828403121561139357600080fd5b61139b611348565b825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b60008282101561140d5761140d6110ba565b50039056fea26469706673582212202ca9da21dec8d34a57fb32b1c9e6f8b6cf4eab7b40b3d99d0896cee00bfcf1f064736f6c634300080c0033`), }, } diff --git a/contracts/oasys/oasys_test.go b/contracts/oasys/oasys_test.go index c9a0ca57e7..eb2cef7508 100644 --- a/contracts/oasys/oasys_test.go +++ b/contracts/oasys/oasys_test.go @@ -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", } } } diff --git a/core/headerchain.go b/core/headerchain.go index 4923dd33f2..fe4e4493a4 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -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 numberCacheLimit = 2048 ) diff --git a/core/txpool/blobpool/blobpool_test.go b/core/txpool/blobpool/blobpool_test.go index a1c4c8d5f5..92ee734c4c 100644 --- a/core/txpool/blobpool/blobpool_test.go +++ b/core/txpool/blobpool/blobpool_test.go @@ -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{ diff --git a/core/types/block.go b/core/types/block.go index 657bcbc895..69afb53154 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -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" @@ -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 diff --git a/core/vote/vote_manager.go b/core/vote/vote_manager.go index f020075ac7..81ac959622 100644 --- a/core/vote/vote_manager.go +++ b/core/vote/vote_manager.go @@ -15,6 +15,7 @@ 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. @@ -22,7 +23,7 @@ import ( // 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 var diffInTurn = big.NewInt(2) // Block difficulty for in-turn signatures var votesManagerCounter = metrics.NewRegisteredCounter("votesManager/local", nil) diff --git a/core/vote/vote_pool.go b/core/vote/vote_pool.go index bf54bda42d..b976ac0ba6 100644 --- a/core/vote/vote_pool.go +++ b/core/vote/vote_pool.go @@ -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 ( diff --git a/core/vote/vote_pool_test.go b/core/vote/vote_pool_test.go index 5af311a92a..e1c1beb508 100644 --- a/core/vote/vote_pool_test.go +++ b/core/vote/vote_pool_test.go @@ -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 { diff --git a/eth/backend.go b/eth/backend.go index c0a5c26ac7..1b1c5bf122 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -26,8 +26,6 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/metrics" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -80,21 +78,6 @@ const ( ChainData = "chaindata" ) -const ( - MaxBlockHandleDelayMs = 3000 // max delay for block handles, max 3000 ms -) - -var ( - sendBlockTimer = metrics.NewRegisteredTimer("chain/delay/block/send", nil) - recvBlockTimer = metrics.NewRegisteredTimer("chain/delay/block/recv", nil) - startInsertBlockTimer = metrics.NewRegisteredTimer("chain/delay/block/insert", nil) - startMiningTimer = metrics.NewRegisteredTimer("chain/delay/block/mining", nil) - importedBlockTimer = metrics.NewRegisteredTimer("chain/delay/block/imported", nil) - sendVoteTimer = metrics.NewRegisteredTimer("chain/delay/vote/send", nil) - firstVoteTimer = metrics.NewRegisteredTimer("chain/delay/vote/first", nil) - majorityVoteTimer = metrics.NewRegisteredTimer("chain/delay/vote/majority", nil) -) - // Config contains the configuration options of the ETH protocol. // Deprecated: use ethconfig.Config instead. type Config = ethconfig.Config @@ -516,6 +499,162 @@ func (s *Ethereum) SetEtherbase(etherbase common.Address) { s.miner.SetEtherbase(etherbase) } +// waitForSyncAndMaxwell waits for the node to be fully synced and Maxwell fork to be active +func (s *Ethereum) waitForSyncAndMaxwell(oasys *oasys.Oasys) { + panic("should not happen") + // ticker := time.NewTicker(30 * time.Second) + // defer ticker.Stop() + // retryCount := 0 + // for { + // select { + // case <-s.stopCh: + // return + // case <-ticker.C: + // if !s.Synced() { + // continue + // } + // // Check if Maxwell fork is active + // header := s.blockchain.CurrentHeader() + // if header == nil { + // continue + // } + // chainConfig := s.blockchain.Config() + // if !chainConfig.IsMaxwell(header.Number, header.Time) { + // continue + // } + // log.Info("Node is synced and Maxwell fork is active, proceeding with node ID registration") + // err := s.updateNodeID(parlia) + // if err == nil { + // return + // } + // retryCount++ + // if retryCount > 3 { + // log.Error("Failed to update node ID exceed max retry count", "retryCount", retryCount, "err", err) + // return + // } + // } + // } +} + +// updateNodeID registers the node ID with the StakeHub contract +func (s *Ethereum) updateNodeID(oasys *oasys.Oasys) error { + panic("should not happen") + // nonce, err := s.APIBackend.GetPoolNonce(context.Background(), s.etherbase) + // if err != nil { + // return fmt.Errorf("failed to get nonce: %v", err) + // } + + // // Get currently registered node IDs + // registeredIDs, err := parlia.GetNodeIDs() + // if err != nil { + // log.Error("Failed to get registered node IDs", "err", err) + // return err + // } + + // // Create a set of registered IDs for quick lookup + // registeredSet := make(map[enode.ID]struct{}, len(registeredIDs)) + // for _, id := range registeredIDs { + // registeredSet[id] = struct{}{} + // } + + // // Handle removals first + // if err := s.handleRemovals(parlia, nonce, registeredSet); err != nil { + // return err + // } + // nonce++ + + // // Handle additions + // return s.handleAdditions(parlia, nonce, registeredSet) +} + +func (s *Ethereum) handleRemovals(oasys *oasys.Oasys, nonce uint64, registeredSet map[enode.ID]struct{}) error { + panic("should not happen") + // if len(s.config.EVNNodeIDsToRemove) == 0 { + // return nil + // } + + // // Handle wildcard removal + // if len(s.config.EVNNodeIDsToRemove) == 1 { + // var zeroID enode.ID // This will be all zeros + // if s.config.EVNNodeIDsToRemove[0] == zeroID { + // trx, err := parlia.RemoveNodeIDs([]enode.ID{}, nonce) + // if err != nil { + // return fmt.Errorf("failed to create node ID removal transaction: %v", err) + // } + // if err := s.txPool.Add([]*types.Transaction{trx}, false); err != nil { + // return fmt.Errorf("failed to add node ID removal transaction to pool: %v", err) + // } + // log.Info("Submitted node ID removal transaction for all node IDs") + // return nil + // } + // } + + // // Create a set of node IDs to add for quick lookup + // addSet := make(map[enode.ID]struct{}, len(s.config.EVNNodeIDsToAdd)) + // for _, id := range s.config.EVNNodeIDsToAdd { + // addSet[id] = struct{}{} + // } + + // // Filter out node IDs that are in the add set + // nodeIDsToRemove := make([]enode.ID, 0, len(s.config.EVNNodeIDsToRemove)) + // for _, id := range s.config.EVNNodeIDsToRemove { + // if _, exists := registeredSet[id]; exists { + // if _, exists := addSet[id]; !exists { + // nodeIDsToRemove = append(nodeIDsToRemove, id) + // } else { + // log.Debug("Skipping node ID removal", "id", id, "reason", "also in EVNNodeIDsToAdd") + // } + // } else { + // log.Debug("Skipping node ID removal", "id", id, "reason", "not registered") + // } + // } + + // if len(nodeIDsToRemove) == 0 { + // log.Debug("No node IDs to remove after filtering") + // return nil + // } + + // trx, err := parlia.RemoveNodeIDs(nodeIDsToRemove, nonce) + // if err != nil { + // return fmt.Errorf("failed to create node ID removal transaction: %v", err) + // } + // if errs := s.txPool.Add([]*types.Transaction{trx}, false); len(errs) > 0 && errs[0] != nil { + // return fmt.Errorf("failed to add node ID removal transaction to pool: %v", errs) + // } + // log.Info("Submitted node ID removal transaction", "nodeIDs", nodeIDsToRemove) + // return nil +} + +func (s *Ethereum) handleAdditions(oasys *oasys.Oasys, nonce uint64, registeredSet map[enode.ID]struct{}) error { + panic("should not happen") + // if len(s.config.EVNNodeIDsToAdd) == 0 { + // return nil + // } + + // // Filter out already registered IDs in a single pass + // nodeIDsToAdd := make([]enode.ID, 0, len(s.config.EVNNodeIDsToAdd)) + // for _, id := range s.config.EVNNodeIDsToAdd { + // if _, exists := registeredSet[id]; !exists { + // nodeIDsToAdd = append(nodeIDsToAdd, id) + // } + // } + + // if len(nodeIDsToAdd) == 0 { + // log.Info("No new node IDs to register after deduplication") + // return nil + // } + + // trx, err := parlia.AddNodeIDs(nodeIDsToAdd, nonce) + // if err != nil { + // return fmt.Errorf("failed to create node ID registration transaction: %v", err) + // } + // if errs := s.txPool.Add([]*types.Transaction{trx}, false); len(errs) > 0 && errs[0] != nil { + // return fmt.Errorf("failed to add node ID registration transaction to pool: %v", errs) + // } + // log.Info("Submitted node ID registration transaction", "nodeIDs", nodeIDsToAdd) + // return nil +} + // StartMining starts the miner with the given number of CPU threads. If mining // is already running, this method adjust the number of threads allowed to use // and updates the minimum price required by the transaction pool. @@ -564,13 +703,6 @@ func (s *Ethereum) StartMining() error { return fmt.Errorf("signer missing: %v", err) } oas.Authorize(eb, wallet.SignData, wallet.SignTx) - - // Temporarily force miners to enable voting to prompt validators to encourage validators to register voting keys - if !s.config.Miner.VoteEnable { - err := errors.New("vote is not enabled, please enable vote") - techDocRef := "https://docs.oasys.games/docs/hub-validator/operate-validator/build-validator-node#enabling-fast-finality" - return fmt.Errorf("temporarily force validators to enable voting. Please proceed with registering your BLS key. For more details, refer to the technical documentation: %s, err: %v", techDocRef, err) - } } // If mining is started, we can disable the transaction rejection mechanism // introduced to speed sync times. @@ -646,7 +778,6 @@ func (s *Ethereum) Start() error { // Start the networking layer s.handler.Start(s.p2pServer.MaxPeers, s.p2pServer.MaxPeersPerIP) - go s.reportRecentBlocksLoop() return nil } @@ -716,83 +847,3 @@ func (s *Ethereum) Stop() error { close(s.stopCh) return nil } - -func (s *Ethereum) reportRecentBlocksLoop() { - reportCnt := uint64(2) - reportTicker := time.NewTicker(time.Second) - for { - select { - case <-reportTicker.C: - cur := s.blockchain.CurrentBlock() - if cur == nil || cur.Number.Uint64() <= reportCnt { - continue - } - num := cur.Number.Uint64() - stats := s.blockchain.GetBlockStats(cur.Hash()) - sendBlockTime := stats.SendBlockTime.Load() - startImportBlockTime := stats.StartImportBlockTime.Load() - recvNewBlockTime := stats.RecvNewBlockTime.Load() - recvNewBlockHashTime := stats.RecvNewBlockHashTime.Load() - sendVoteTime := stats.SendVoteTime.Load() - firstVoteTime := stats.FirstRecvVoteTime.Load() - recvMajorityTime := stats.RecvMajorityVoteTime.Load() - startMiningTime := stats.StartMiningTime.Load() - importedBlockTime := stats.ImportedBlockTime.Load() - - records := make(map[string]interface{}) - records["BlockNum"] = num - records["SendBlockTime"] = common.FormatMilliTime(sendBlockTime) - records["StartImportBlockTime"] = common.FormatMilliTime(startImportBlockTime) - records["RecvNewBlockTime"] = common.FormatMilliTime(recvNewBlockTime) - records["RecvNewBlockHashTime"] = common.FormatMilliTime(recvNewBlockHashTime) - records["RecvNewBlockFrom"] = stats.RecvNewBlockFrom.Load() - records["RecvNewBlockHashFrom"] = stats.RecvNewBlockHashFrom.Load() - - records["SendVoteTime"] = common.FormatMilliTime(sendVoteTime) - records["FirstRecvVoteTime"] = common.FormatMilliTime(firstVoteTime) - records["RecvMajorityVoteTime"] = common.FormatMilliTime(recvMajorityTime) - - records["StartMiningTime"] = common.FormatMilliTime(startMiningTime) - records["ImportedBlockTime"] = common.FormatMilliTime(importedBlockTime) - - records["Coinbase"] = cur.Coinbase.String() - blockMsTime := int64(cur.MilliTimestamp()) - records["BlockTime"] = common.FormatMilliTime(blockMsTime) - metrics.GetOrRegisterLabel("report-blocks", nil).Mark(records) - - if validTimeMetric(blockMsTime, sendBlockTime) { - sendBlockTimer.Update(time.Duration(sendBlockTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, recvNewBlockTime) { - recvBlockTimer.Update(time.Duration(recvNewBlockTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, startImportBlockTime) { - startInsertBlockTimer.Update(time.Duration(startImportBlockTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, sendVoteTime) { - sendVoteTimer.Update(time.Duration(sendVoteTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, firstVoteTime) { - firstVoteTimer.Update(time.Duration(firstVoteTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, recvMajorityTime) { - majorityVoteTimer.Update(time.Duration(recvMajorityTime - blockMsTime)) - } - if validTimeMetric(blockMsTime, importedBlockTime) { - importedBlockTimer.Update(time.Duration(importedBlockTime - blockMsTime)) - } - if validTimeMetric(startMiningTime, blockMsTime) { - startMiningTimer.Update(time.Duration(blockMsTime - startMiningTime)) - } - case <-s.stopCh: - return - } - } -} - -func validTimeMetric(startMs, endMs int64) bool { - if startMs >= endMs { - return false - } - return endMs-startMs <= MaxBlockHandleDelayMs -} diff --git a/eth/handler.go b/eth/handler.go index be6f03f0fb..ca227dfc94 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -390,6 +390,8 @@ func newHandler(config *handlerConfig) (*handler, error) { // protoTracker tracks the number of active protocol handlers. func (h *handler) protoTracker() { defer h.wg.Done() + updateTicker := time.NewTicker(10 * time.Second) + defer updateTicker.Stop() var active int for { select { @@ -397,6 +399,13 @@ func (h *handler) protoTracker() { active++ case <-h.handlerDoneCh: active-- + case <-updateTicker.C: + if h.enableEVNFeatures { + panic("should not happen") + // add onchain validator p2p node list later, it will enable the direct broadcast + no tx broadcast feature + // here check & enable peer broadcast features periodically, and it's a simple way to handle the peer change and the list change scenarios. + // h.peers.enableEVNFeatures(h.queryValidatorNodeIDsMap(), h.evnNodeIdsWhitelistMap) + } case <-h.quitSync: // Wait for all active handlers to finish. for ; active > 0; active-- { @@ -833,7 +842,21 @@ func (h *handler) BroadcastBlock(block *types.Block, propagate bool) { peer.AsyncSendNewBlock(block, td) } - log.Debug("Propagated block", "hash", hash, "recipients", len(transfer), "duration", common.PrettyDuration(time.Since(block.ReceivedAt))) + // check if the block should be broadcast to more peers in EVN + var morePeers []*ethPeer + // if h.needFullBroadcastInEVN(block) { + // for i := len(transfer); i < len(peers); i++ { + // if peers[i].EVNPeerFlag.Load() { + // morePeers = append(morePeers, peers[i]) + // } + // } + // for _, peer := range morePeers { + // log.Debug("broadcast block to extra peer", "hash", hash, "peer", peer.ID(), "EVNPeerFlag", peer.EVNPeerFlag.Load()) + // peer.AsyncSendNewBlock(block, td) + // } + // } + + log.Debug("Propagated block", "hash", hash, "recipients", len(transfer), "extra", len(morePeers), "duration", common.PrettyDuration(time.Since(block.ReceivedAt))) return } // Otherwise if the block is indeed in our own chain, announce it @@ -846,6 +869,49 @@ func (h *handler) BroadcastBlock(block *types.Block, propagate bool) { } } +// needFullBroadcastInEVN checks if the block should be broadcast to EVN peers +// if the block is mined by self or received from proxyed validator, just broadcast to all EVN peers +// if not, skip it. +func (h *handler) needFullBroadcastInEVN(block *types.Block) bool { + panic("should not happen") + // if !h.enableEVNFeatures { + // return false + // } + + // parlia, ok := h.chain.Engine().(*parlia.Parlia) + // if !ok { + // return false + // } + // coinbase := block.Coinbase() + // // check whether the block is created by self + // if parlia.ConsensusAddress() == coinbase { + // log.Debug("full broadcast mined block to EVN", "coinbase", coinbase) + // return true + // } + + // return h.peers.isProxyedValidator(coinbase, h.proxyedValidatorAddressMap) +} + +func (h *handler) queryValidatorNodeIDsMap() map[common.Address][]enode.ID { + panic("should not happen") + // latest := h.chain.CurrentHeader() + // if !h.chain.Config().IsMaxwell(latest.Number, latest.Time) { + // return nil + // } + + // log.Debug("queryValidatorNodeIDs after maxwell", "number", latest.Number, "time", latest.Time) + // parlia, ok := h.chain.Engine().(*parlia.Parlia) + // if !ok { + // return nil + // } + + // nodeIDsMap, err := parlia.GetNodeIDsMap() + // if err != nil { + // return nil + // } + // return nodeIDsMap +} + // BroadcastTransactions will propagate a batch of transactions // - To a square root of all peers for non-blob transactions // - And, separately, as announcements to all peers which are not known to diff --git a/eth/protocols/bsc/peer.go b/eth/protocols/bsc/peer.go index 3bddc9cc3e..0b76769ac9 100644 --- a/eth/protocols/bsc/peer.go +++ b/eth/protocols/bsc/peer.go @@ -22,9 +22,9 @@ const ( // used to avoid of DDOS attack // It's the max number of received votes per second from one peer - // 21 validators exist now, so 21 votes will be produced every one block interval - // so the limit is 28 = 21/0.75, here set it to 40 with a buffer. - receiveRateLimitPerSecond = 40 + // 28 validators exist now, so 28 votes will be produced every one block interval + // so the limit is 4.6 = 28/6, here set it to 10 with a buffer. + receiveRateLimitPerSecond = 10 // the time span of one period secondsPerPeriod = float64(30) diff --git a/eth/protocols/trust/handler_test.go b/eth/protocols/trust/handler_test.go index 187b29c932..48bd8e0582 100644 --- a/eth/protocols/trust/handler_test.go +++ b/eth/protocols/trust/handler_test.go @@ -41,7 +41,7 @@ func newTestBackend(blocks int) *testBackend { return newTestBackendWithGenerator(blocks) } -// newTestBackend creates a chain with a number of explicitly defined blocks and +// newTestBackendWithGenerator creates a chain with a number of explicitly defined blocks and // wraps it into a mock backend. func newTestBackendWithGenerator(blocks int) *testBackend { signer := types.HomesteadSigner{} diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index a98f53ec17..018da2ee50 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1241,7 +1241,6 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param func (api *BlockChainAPI) rpcMarshalHeader(ctx context.Context, header *types.Header) map[string]interface{} { fields := RPCMarshalHeader(header) fields["totalDifficulty"] = (*hexutil.Big)(api.b.GetTd(ctx, header.Hash())) - fields["milliTimestamp"] = hexutil.Uint64(header.MilliTimestamp()) return fields } @@ -1251,7 +1250,6 @@ func (api *BlockChainAPI) rpcMarshalBlock(ctx context.Context, b *types.Block, i fields := RPCMarshalBlock(b, inclTx, fullTx, api.b.ChainConfig()) if inclTx { fields["totalDifficulty"] = (*hexutil.Big)(api.b.GetTd(ctx, b.Hash())) - fields["milliTimestamp"] = hexutil.Uint64(b.Header().MilliTimestamp()) } return fields, nil } diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 2077eb2907..edb31f9e69 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -3217,9 +3217,6 @@ func TestRPCGetBlockOrHeader(t *testing.T) { t.Errorf("test %d: want no error, have %v", i, err) continue } - if result != nil { - delete(result, "milliTimestamp") - } testRPCResponseWithFile(t, i, result, rpc, tt.file) } diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index ccb7edf3e4..054d3de8f5 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -19,7 +19,7 @@ package web3ext var Modules = map[string]string{ "admin": AdminJs, - "parlia": ParliaJs, + "clique": CliqueJs, "debug": DebugJs, "eth": EthJs, "miner": MinerJs, @@ -29,46 +29,60 @@ var Modules = map[string]string{ "dev": DevJs, } -const ParliaJs = ` +const CliqueJs = ` web3._extend({ - property: 'parlia', + property: 'clique', methods: [ new web3._extend.Method({ name: 'getSnapshot', - call: 'parlia_getSnapshot', + call: 'clique_getSnapshot', params: 1, inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] }), new web3._extend.Method({ name: 'getSnapshotAtHash', - call: 'parlia_getSnapshotAtHash', + call: 'clique_getSnapshotAtHash', params: 1 }), new web3._extend.Method({ - name: 'getValidators', - call: 'parlia_getValidators', + name: 'getSigners', + call: 'clique_getSigners', params: 1, inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] }), new web3._extend.Method({ - name: 'getValidatorsAtHash', - call: 'parlia_getValidatorsAtHash', + name: 'getSignersAtHash', + call: 'clique_getSignersAtHash', params: 1 }), new web3._extend.Method({ - name: 'getJustifiedNumber', - call: 'parlia_getJustifiedNumber', - params: 1, - inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] + name: 'propose', + call: 'clique_propose', + params: 2 }), new web3._extend.Method({ - name: 'getFinalizedNumber', - call: 'parlia_getFinalizedNumber', + name: 'discard', + call: 'clique_discard', + params: 1 + }), + new web3._extend.Method({ + name: 'status', + call: 'clique_status', + params: 0 + }), + new web3._extend.Method({ + name: 'getSigner', + call: 'clique_getSigner', params: 1, - inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] + inputFormatter: [null] }), ], - properties: [] + properties: [ + new web3._extend.Property({ + name: 'proposals', + getter: 'clique_proposals' + }), + ] }); ` diff --git a/miner/minerconfig/config.go b/miner/minerconfig/config.go index dc32c706e4..3261e000a2 100644 --- a/miner/minerconfig/config.go +++ b/miner/minerconfig/config.go @@ -28,15 +28,8 @@ import ( ) var ( - defaultDelayLeftOver = 50 * time.Millisecond - defaultRecommit = 6 * time.Second - defaultMaxWaitProposalInSecs = uint64(45) - // default configurations for MEV - defaultGreedyMergeTx bool = true - defaultValidatorCommission uint64 = 100 - defaultBidSimulationLeftOver = 50 * time.Millisecond - defaultNoInterruptLeftOver = 250 * time.Millisecond - defaultMaxBidsPerBuilder uint32 = 2 + defaultDelayLeftOver = 50 * time.Millisecond + defaultRecommit = 6 * time.Second ) // Config is the configuration parameters of mining. diff --git a/miner/worker.go b/miner/worker.go index a6e4014019..ce0c803f51 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1222,7 +1222,7 @@ LOOP: break } else { log.Debug("commitWork stopTimer", "block", work.header.Number, - "header time", time.UnixMilli(int64(work.header.MilliTimestamp())), + "header time", time.Until(time.Unix(int64(work.header.Time), 0)), "commit delay", *delay, "DelayLeftOver", w.config.DelayLeftOver) stopTimer.Reset(*delay) } @@ -1266,7 +1266,7 @@ LOOP: newTxsNum := 0 // stopTimer was the maximum delay for each fillTransactions // but now it is used to wait until (head.Time - DelayLeftOver) is reached. - stopTimer.Reset(time.Until(time.UnixMilli(int64(work.header.MilliTimestamp()))) - *w.config.DelayLeftOver) + stopTimer.Reset(time.Until(time.Unix(int64(work.header.Time), 0)) - *w.config.DelayLeftOver) LOOP_WAIT: for { select { diff --git a/node/node.go b/node/node.go index 7fa1fd9aea..ce86a9e9a6 100644 --- a/node/node.go +++ b/node/node.go @@ -92,6 +92,13 @@ func New(conf *Config) (*Node, error) { // working directory don't affect the node. confCopy := *conf conf = &confCopy + + // Forcibly disable BSC's EVN(BEP-563) and NewBlockFetchingMessages(BEP-564) + conf.EnableEVNFeatures = false + conf.EnableQuickBlockFetching = false + conf.P2P.EVNNodeIdsWhitelist = nil + conf.P2P.ProxyedValidatorAddresses = nil + if conf.DataDir != "" { absdatadir, err := filepath.Abs(conf.DataDir) if err != nil { diff --git a/params/forks/forks.go b/params/forks/forks.go index 77accf942e..2d44e13b04 100644 --- a/params/forks/forks.go +++ b/params/forks/forks.go @@ -39,7 +39,5 @@ const ( Shanghai Cancun Prague - Lorentz - Maxwell Osaka ) diff --git a/params/network_params.go b/params/network_params.go index 1de7245cb4..5c647921a8 100644 --- a/params/network_params.go +++ b/params/network_params.go @@ -37,5 +37,5 @@ var ( // considered immutable (i.e. soft finality). It is used by the downloader as a // hard limit against deep ancestors, by the blockchain against deep reorgs, by // the freezer as the cutoff threshold and by clique as the snapshot trust limit. - FullImmutabilityThreshold uint64 = 360_000 + FullImmutabilityThreshold uint64 = 360_000 * MaxwellBlockTimeReductionFactorForBSC // =90000 ) diff --git a/params/protocol_params.go b/params/protocol_params.go index 5d5660faeb..aa74db1cc5 100644 --- a/params/protocol_params.go +++ b/params/protocol_params.go @@ -178,20 +178,23 @@ const ( BlobTxPointEvaluationPrecompileGas = 50000 // Gas price for the point evaluation precompile. HistoryServeWindow = 8192 // Number of blocks to serve historical block hashes for, EIP-2935. -) -var ( + // after maxwell(0.75s) / before maxwell(3s) = 0.25 + MaxwellBlockTimeReductionFactorForBSC = 0.25 + // The factor to adjust blob reserve period for Oasys. - // Oasys blocktime(6s) / BSC blocktime(3s) = 2 - divisionFactorForOasys uint64 = 2 + // Oasys blocktime(6s) / BSC maxwellBlocktime(0.75s) = 8 + divisionFactorForOasys = 8 +) +var ( // it keeps blob data available for ~18.2 days in local, ref: https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-336.md#51-parameters. // Same as the default blob reserve period in Ethereum (4096 epochs). MinTimeDurationForBlobRequests uint64 = uint64(float64(24*3600) * 18.2) - MinBlocksForBlobRequests uint64 = 524288 / divisionFactorForOasys + MinBlocksForBlobRequests uint64 = uint64(float64(MinTimeDurationForBlobRequests)/0.75) / divisionFactorForOasys // it adds more time for expired blobs for some request cases, like expiry blob when remote peer is syncing, default 1 day. - DefaultExtraReserveForBlobRequests uint64 = 1 * (24 * 3600) / 3 / divisionFactorForOasys + DefaultExtraReserveForBlobRequests uint64 = uint64(24*3600/0.75) / divisionFactorForOasys ) var Bls12381G1MultiExpDiscountTable = [128]uint64{1000, 949, 848, 797, 764, 750, 738, 728, 719, 712, 705, 698, 692, 687, 682, 677, 673, 669, 665, 661, 658, 654, 651, 648, 645, 642, 640, 637, 635, 632, 630, 627, 625, 623, 621, 619, 617, 615, 613, 611, 609, 608, 606, 604, 603, 601, 599, 598, 596, 595, 593, 592, 591, 589, 588, 586, 585, 584, 582, 581, 580, 579, 577, 576, 575, 574, 573, 572, 570, 569, 568, 567, 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, 548, 547, 547, 546, 545, 544, 543, 542, 541, 540, 540, 539, 538, 537, 536, 536, 535, 534, 533, 532, 532, 531, 530, 529, 528, 528, 527, 526, 525, 525, 524, 523, 522, 522, 521, 520, 520, 519}