Compare commits
14 Commits
stale-peer
...
zzzckck-pa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33d7760e8a | ||
|
|
b5cd70c282 | ||
|
|
3e44dcaa55 | ||
|
|
282aee5856 | ||
|
|
44e91bba23 | ||
|
|
774d1b7ddb | ||
|
|
8bbd8fbf48 | ||
|
|
a28262b3ec | ||
|
|
7de27ca9e9 | ||
|
|
03069a7703 | ||
|
|
24a46de5b2 | ||
|
|
75af65dbf2 | ||
|
|
26a4d4fda6 | ||
|
|
83a9b13771 |
@@ -1,2 +1,3 @@
|
|||||||
CVE-2024-34478 # "CWE-754: Improper Check for Unusual or Exceptional Conditions." This vulnerability is BTC only, BSC does not have the issue.
|
CVE-2024-34478 # "CWE-754: Improper Check for Unusual or Exceptional Conditions." This vulnerability is BTC only, BSC does not have the issue.
|
||||||
CVE-2024-6104 # "CWE-532: Information Exposure Through Log Files" This is caused by the vulnerabilities go-retryablehttp@v0.7.4, it is only used in cmd devp2p, impact is limited. will upgrade to v0.7.7 later
|
CVE-2024-6104 # "CWE-532: Information Exposure Through Log Files" This is caused by the vulnerabilities go-retryablehttp@v0.7.4, it is only used in cmd devp2p, impact is limited. will upgrade to v0.7.7 later
|
||||||
|
CVE-2024-8421 # "CWE-400: Uncontrolled Resource Consumption (Resource Exhaustion)" This vulnerability is caused by issues in the golang.org/x/net package. Even the latest version(v0.29.0) has not yet addressed it, but we will continue to monitor updates closely.
|
||||||
14
cmd/faucet/customized/README.md
Normal file
14
cmd/faucet/customized/README.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# 1.Background
|
||||||
|
This is to support some projects with customized tokens that they want to integrate into the BSC faucet tool.
|
||||||
|
|
||||||
|
## 1.1. How to Integrate Your Token
|
||||||
|
- Step 1: Submmit a Pull Request to [bsc develop branch](https://github.com/bnb-chain/bsc/tree/develop) with relevant token information: `symbol`, `amount`, `icon`, `addr`. Append these information in [Section 2: Token List](#2token-list)
|
||||||
|
- Step 2: Wait for approval, we will review the request, and once it is approved, the faucet tool will start to support the customized token and list it on https://www.bnbchain.org/en/testnet-faucet.
|
||||||
|
- Step 3: Deposit your test token to designated address(0xaa25aa7a19f9c426e07dee59b12f944f4d9f1dd3) on the BSC testnet.
|
||||||
|
|
||||||
|
# 2.Token List
|
||||||
|
## 2.1.DemoToken
|
||||||
|
- symbol: DEMO
|
||||||
|
- amount: 10000000000000000000
|
||||||
|
- icon: ./demotoken.png
|
||||||
|
- addr: https://testnet.bscscan.com/address/0xe15c158d768c306dae87b96430a94f884333e55d
|
||||||
BIN
cmd/faucet/customized/demotoken.png
Normal file
BIN
cmd/faucet/customized/demotoken.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -500,7 +500,7 @@ func (f *faucet) apiHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// check #2: check IP and ID(address) to ensure the user didn't request funds too recently,
|
// check #2: check IP and ID(address) to ensure the user didn't request funds too frequently
|
||||||
f.lock.Lock()
|
f.lock.Lock()
|
||||||
|
|
||||||
if ipTimeout := f.timeouts[ips[len(ips)-2]]; time.Now().Before(ipTimeout) {
|
if ipTimeout := f.timeouts[ips[len(ips)-2]]; time.Now().Before(ipTimeout) {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ const (
|
|||||||
|
|
||||||
wiggleTime = uint64(1) // second, Random delay (per signer) to allow concurrent signers
|
wiggleTime = uint64(1) // second, Random delay (per signer) to allow concurrent signers
|
||||||
initialBackOffTime = uint64(1) // second
|
initialBackOffTime = uint64(1) // second
|
||||||
processBackOffTime = uint64(1) // second
|
|
||||||
|
|
||||||
systemRewardPercent = 4 // it means 1/2^4 = 1/16 percentage of gas fee incoming will be distributed to system
|
systemRewardPercent = 4 // it means 1/2^4 = 1/16 percentage of gas fee incoming will be distributed to system
|
||||||
|
|
||||||
@@ -1616,12 +1615,15 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
|
|||||||
copy(header.Extra[len(header.Extra)-extraSeal:], sig)
|
copy(header.Extra[len(header.Extra)-extraSeal:], sig)
|
||||||
|
|
||||||
if p.shouldWaitForCurrentBlockProcess(chain, header, snap) {
|
if p.shouldWaitForCurrentBlockProcess(chain, header, snap) {
|
||||||
log.Info("Waiting for received in turn block to process")
|
highestVerifiedHeader := chain.GetHighestVerifiedHeader()
|
||||||
|
// including time for writing and committing blocks
|
||||||
|
waitProcessEstimate := math.Ceil(float64(highestVerifiedHeader.GasUsed) / float64(100_000_000))
|
||||||
|
log.Info("Waiting for received in turn block to process", "waitProcessEstimate(Seconds)", waitProcessEstimate)
|
||||||
select {
|
select {
|
||||||
case <-stop:
|
case <-stop:
|
||||||
log.Info("Received block process finished, abort block seal")
|
log.Info("Received block process finished, abort block seal")
|
||||||
return
|
return
|
||||||
case <-time.After(time.Duration(processBackOffTime) * time.Second):
|
case <-time.After(time.Duration(waitProcessEstimate) * time.Second):
|
||||||
if chain.CurrentHeader().Number.Uint64() >= header.Number.Uint64() {
|
if chain.CurrentHeader().Number.Uint64() >= header.Number.Uint64() {
|
||||||
log.Info("Process backoff time exhausted, and current header has updated to abort this seal")
|
log.Info("Process backoff time exhausted, and current header has updated to abort this seal")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
// gfP2 implements a field of size p² as a quadratic extension of the base field
|
// gfP2 implements a field of size p² as a quadratic extension of the base field
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
// gfP6 implements the field of size p⁶ as a cubic extension of gfP2 where τ³=ξ
|
// gfP6 implements the field of size p⁶ as a cubic extension of gfP2 where τ³=ξ
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
package bn256
|
package bn256
|
||||||
|
|
||||||
// For details of the algorithms used, see "Multiplication and Squaring on
|
// For details of the algorithms used, see "Multiplication and Squaring on
|
||||||
// Pairing-Friendly Fields, Devegili et al.
|
// Pairing-Friendly Fields", Devegili et al.
|
||||||
// http://eprint.iacr.org/2006/471.pdf.
|
// http://eprint.iacr.org/2006/471.pdf.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
@@ -868,9 +868,9 @@ func (f *BlockFetcher) importHeaders(op *blockOrHeaderInject) {
|
|||||||
parent := f.getHeader(header.ParentHash)
|
parent := f.getHeader(header.ParentHash)
|
||||||
if parent == nil {
|
if parent == nil {
|
||||||
log.Debug("Unknown parent of propagated header", "peer", peer, "number", header.Number, "hash", hash, "parent", header.ParentHash)
|
log.Debug("Unknown parent of propagated header", "peer", peer, "number", header.Number, "hash", hash, "parent", header.ParentHash)
|
||||||
time.Sleep(reQueueBlockTimeout)
|
|
||||||
// forget block first, then re-queue
|
// forget block first, then re-queue
|
||||||
f.done <- hash
|
f.done <- hash
|
||||||
|
time.Sleep(reQueueBlockTimeout)
|
||||||
f.requeue <- op
|
f.requeue <- op
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -909,9 +909,9 @@ func (f *BlockFetcher) importBlocks(op *blockOrHeaderInject) {
|
|||||||
parent := f.getBlock(block.ParentHash())
|
parent := f.getBlock(block.ParentHash())
|
||||||
if parent == nil {
|
if parent == nil {
|
||||||
log.Debug("Unknown parent of propagated block", "peer", peer, "number", block.Number(), "hash", hash, "parent", block.ParentHash())
|
log.Debug("Unknown parent of propagated block", "peer", peer, "number", block.Number(), "hash", hash, "parent", block.ParentHash())
|
||||||
time.Sleep(reQueueBlockTimeout)
|
|
||||||
// forget block first, then re-queue
|
// forget block first, then re-queue
|
||||||
f.done <- hash
|
f.done <- hash
|
||||||
|
time.Sleep(reQueueBlockTimeout)
|
||||||
f.requeue <- op
|
f.requeue <- op
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/forkid"
|
"github.com/ethereum/go-ethereum/core/forkid"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -46,7 +47,7 @@ var ProtocolVersions = []uint{ETH68}
|
|||||||
var protocolLengths = map[uint]uint64{ETH68: 17}
|
var protocolLengths = map[uint]uint64{ETH68: 17}
|
||||||
|
|
||||||
// maxMessageSize is the maximum cap on the size of a protocol message.
|
// maxMessageSize is the maximum cap on the size of a protocol message.
|
||||||
const maxMessageSize = 10 * 1024 * 1024
|
var maxMessageSize = params.MaxMessageSize
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StatusMsg = 0x00
|
StatusMsg = 0x00
|
||||||
|
|||||||
@@ -248,6 +248,9 @@ func (h *handler) doSync(op *chainSyncOp) error {
|
|||||||
// degenerate connectivity, but it should be healthy for the mainnet too to
|
// degenerate connectivity, but it should be healthy for the mainnet too to
|
||||||
// more reliably update peers or the local TD state.
|
// more reliably update peers or the local TD state.
|
||||||
if block := h.chain.GetBlock(head.Hash(), head.Number.Uint64()); block != nil {
|
if block := h.chain.GetBlock(head.Hash(), head.Number.Uint64()); block != nil {
|
||||||
|
if h.chain.Config().IsCancun(block.Number(), block.Time()) {
|
||||||
|
block = block.WithSidecars(h.chain.GetSidecarsByHash(block.Hash()))
|
||||||
|
}
|
||||||
h.BroadcastBlock(block, false)
|
h.BroadcastBlock(block, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -692,6 +692,14 @@ func (b *bidSimulator) simBid(interruptCh chan int32, bidRuntime *BidRuntime) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check bid size
|
||||||
|
if bidRuntime.env.size+blockReserveSize > params.MaxMessageSize {
|
||||||
|
log.Error("BidSimulator: failed to check bid size", "builder", bidRuntime.bid.Builder,
|
||||||
|
"bidHash", bidRuntime.bid.Hash(), "env.size", bidRuntime.env.size)
|
||||||
|
err = errors.New("invalid bid size")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
bestBid := b.GetBestBid(parentHash)
|
bestBid := b.GetBestBid(parentHash)
|
||||||
if bestBid == nil {
|
if bestBid == nil {
|
||||||
log.Info("[BID RESULT]", "win", "true[first]", "builder", bidRuntime.bid.Builder, "hash", bidRuntime.bid.Hash().TerminalString())
|
log.Info("[BID RESULT]", "win", "true[first]", "builder", bidRuntime.bid.Builder, "hash", bidRuntime.bid.Hash().TerminalString())
|
||||||
@@ -858,6 +866,7 @@ func (r *BidRuntime) commitTransaction(chain *core.BlockChain, chainConfig *para
|
|||||||
}
|
}
|
||||||
|
|
||||||
r.env.tcount++
|
r.env.tcount++
|
||||||
|
r.env.size += uint32(tx.Size())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ const (
|
|||||||
|
|
||||||
// the default to wait for the mev miner to finish
|
// the default to wait for the mev miner to finish
|
||||||
waitMEVMinerEndTimeLimit = 50 * time.Millisecond
|
waitMEVMinerEndTimeLimit = 50 * time.Millisecond
|
||||||
|
|
||||||
|
// Reserve block size for the following 3 components:
|
||||||
|
// a. System transactions at the end of the block
|
||||||
|
// b. Seal in the block header
|
||||||
|
// c. Overhead from RLP encoding
|
||||||
|
blockReserveSize = 100 * 1024
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -89,6 +95,7 @@ type environment struct {
|
|||||||
signer types.Signer
|
signer types.Signer
|
||||||
state *state.StateDB // apply state changes here
|
state *state.StateDB // apply state changes here
|
||||||
tcount int // tx count in cycle
|
tcount int // tx count in cycle
|
||||||
|
size uint32 // almost accurate block size,
|
||||||
gasPool *core.GasPool // available gas used to pack transactions
|
gasPool *core.GasPool // available gas used to pack transactions
|
||||||
coinbase common.Address
|
coinbase common.Address
|
||||||
|
|
||||||
@@ -105,6 +112,7 @@ func (env *environment) copy() *environment {
|
|||||||
signer: env.signer,
|
signer: env.signer,
|
||||||
state: env.state.Copy(),
|
state: env.state.Copy(),
|
||||||
tcount: env.tcount,
|
tcount: env.tcount,
|
||||||
|
size: env.size,
|
||||||
coinbase: env.coinbase,
|
coinbase: env.coinbase,
|
||||||
header: types.CopyHeader(env.header),
|
header: types.CopyHeader(env.header),
|
||||||
receipts: copyReceipts(env.receipts),
|
receipts: copyReceipts(env.receipts),
|
||||||
@@ -895,6 +903,13 @@ LOOP:
|
|||||||
txs.Pop()
|
txs.Pop()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// If we don't have enough size left for the next transaction, skip it.
|
||||||
|
if env.size+uint32(tx.Size())+blockReserveSize > params.MaxMessageSize {
|
||||||
|
log.Trace("Not enough size left for transaction", "hash", ltx.Hash,
|
||||||
|
"env.size", env.size, "needed", uint32(tx.Size()))
|
||||||
|
txs.Pop()
|
||||||
|
continue
|
||||||
|
}
|
||||||
// Error may be ignored here. The error has already been checked
|
// Error may be ignored here. The error has already been checked
|
||||||
// during transaction acceptance is the transaction pool.
|
// during transaction acceptance is the transaction pool.
|
||||||
from, _ := types.Sender(env.signer, tx)
|
from, _ := types.Sender(env.signer, tx)
|
||||||
@@ -920,6 +935,7 @@ LOOP:
|
|||||||
// Everything ok, collect the logs and shift in the next transaction from the same account
|
// Everything ok, collect the logs and shift in the next transaction from the same account
|
||||||
coalescedLogs = append(coalescedLogs, logs...)
|
coalescedLogs = append(coalescedLogs, logs...)
|
||||||
env.tcount++
|
env.tcount++
|
||||||
|
env.size += uint32(tx.Size()) // size of BlobTxSidecar included
|
||||||
txs.Shift()
|
txs.Shift()
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1055,6 +1071,9 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) {
|
|||||||
vmenv := vm.NewEVM(context, vm.TxContext{}, env.state, w.chainConfig, vm.Config{})
|
vmenv := vm.NewEVM(context, vm.TxContext{}, env.state, w.chainConfig, vm.Config{})
|
||||||
core.ProcessBeaconBlockRoot(*header.ParentBeaconRoot, vmenv, env.state)
|
core.ProcessBeaconBlockRoot(*header.ParentBeaconRoot, vmenv, env.state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
env.size = uint32(env.header.Size())
|
||||||
|
|
||||||
return env, nil
|
return env, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ const (
|
|||||||
GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block.
|
GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block.
|
||||||
PayBidTxGasLimit uint64 = 25000 // Gas limit of the PayBidTx in the types.BidArgs.
|
PayBidTxGasLimit uint64 = 25000 // Gas limit of the PayBidTx in the types.BidArgs.
|
||||||
|
|
||||||
|
MaxMessageSize uint32 = 10 * 1024 * 1024 // MaxMessageSize is the maximum cap on the size of a eth protocol message.
|
||||||
|
|
||||||
MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis.
|
MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis.
|
||||||
ForkIDSize uint64 = 4 // The length of fork id
|
ForkIDSize uint64 = 4 // The length of fork id
|
||||||
ExpByteGas uint64 = 10 // Times ceil(log256(exponent)) for the EXP instruction.
|
ExpByteGas uint64 = 10 // Times ceil(log256(exponent)) for the EXP instruction.
|
||||||
|
|||||||
Reference in New Issue
Block a user