Merge branch 'develop' into manav/upstream_merge_v1.14.11

This commit is contained in:
Manav Darji 2025-02-27 11:18:07 +05:30
commit 646f6358dd
No known key found for this signature in database
GPG key ID: A426F0124435F36E
24 changed files with 102 additions and 24 deletions

View file

@ -15,7 +15,7 @@ jobs:
permissions: permissions:
id-token: write id-token: write
contents: write contents: write
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View file

@ -19,7 +19,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -51,7 +51,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -79,7 +79,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -130,7 +130,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -167,7 +167,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: [unit-tests, integration-tests] needs: [unit-tests, integration-tests]
steps: steps:
@ -182,7 +182,7 @@ jobs:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true) if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments os: [ ubuntu-22.04 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -250,6 +250,11 @@ jobs:
cd - cd -
timeout 60m bash bor/integration-tests/smoke_test.sh timeout 60m bash bor/integration-tests/smoke_test.sh
- name: Run RPC Tests
run: |
echo "Starting RPC Tests..."
timeout 5m bash bor/integration-tests/rpc_test.sh
- name: Upload logs - name: Upload logs
if: always() if: always()
uses: actions/upload-artifact@v4.4.0 uses: actions/upload-artifact@v4.4.0

View file

@ -15,7 +15,7 @@ jobs:
permissions: permissions:
id-token: write id-token: write
contents: write contents: write
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View file

@ -15,7 +15,7 @@ jobs:
permissions: permissions:
id-token: write id-token: write
contents: write contents: write
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4

View file

@ -269,7 +269,7 @@ func (s *Scheduler) addEvent(event Event) {
s.Trigger() s.Trigger()
} }
// filterEvent sorts each Event either as a request event or a server event, // filterEvents sorts each Event either as a request event or a server event,
// depending on its type. Request events are also sorted in a map based on the // depending on its type. Request events are also sorted in a map based on the
// module that originally initiated the request. It also ensures that no events // module that originally initiated the request. It also ensures that no events
// related to a server are returned before EvRegistered or after EvUnregistered. // related to a server are returned before EvRegistered or after EvUnregistered.

View file

@ -394,7 +394,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
execRs.CurrentExcessBlobGas = (*math.HexOrDecimal64)(&excessBlobGas) execRs.CurrentExcessBlobGas = (*math.HexOrDecimal64)(&excessBlobGas)
execRs.CurrentBlobGasUsed = (*math.HexOrDecimal64)(&blobGasUsed) execRs.CurrentBlobGasUsed = (*math.HexOrDecimal64)(&blobGasUsed)
} }
if chainConfig.IsPrague(vmContext.BlockNumber) { if chainConfig.IsPrague(vmContext.BlockNumber) && chainConfig.Bor == nil {
// Parse the requests from the logs // Parse the requests from the logs
var allLogs []*types.Log var allLogs []*types.Log
for _, receipt := range receipts { for _, receipt := range receipts {

View file

@ -2,6 +2,7 @@ package utils
import ( import (
"os" "os"
"time"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -22,6 +23,13 @@ var (
Value: "http://localhost:1317", Value: "http://localhost:1317",
} }
// HeimdallTimeoutFlag flag for heimdall timeout
HeimdallTimeoutFlag = &cli.DurationFlag{
Name: "bor.heimdalltimeout",
Usage: "Timeout of Heimdall service",
Value: 5 * time.Second,
}
// WithoutHeimdallFlag no heimdall (for testing purpose) // WithoutHeimdallFlag no heimdall (for testing purpose)
WithoutHeimdallFlag = &cli.BoolFlag{ WithoutHeimdallFlag = &cli.BoolFlag{
Name: "bor.withoutheimdall", Name: "bor.withoutheimdall",
@ -56,6 +64,7 @@ var (
// BorFlags all bor related flags // BorFlags all bor related flags
BorFlags = []cli.Flag{ BorFlags = []cli.Flag{
HeimdallURLFlag, HeimdallURLFlag,
HeimdallTimeoutFlag,
WithoutHeimdallFlag, WithoutHeimdallFlag,
HeimdallgRPCAddressFlag, HeimdallgRPCAddressFlag,
RunHeimdallFlag, RunHeimdallFlag,
@ -67,6 +76,7 @@ var (
// SetBorConfig sets bor config // SetBorConfig sets bor config
func SetBorConfig(ctx *cli.Context, cfg *eth.Config) { func SetBorConfig(ctx *cli.Context, cfg *eth.Config) {
cfg.HeimdallURL = ctx.String(HeimdallURLFlag.Name) cfg.HeimdallURL = ctx.String(HeimdallURLFlag.Name)
cfg.HeimdallTimeout = ctx.Duration(HeimdallTimeoutFlag.Name)
cfg.WithoutHeimdall = ctx.Bool(WithoutHeimdallFlag.Name) cfg.WithoutHeimdall = ctx.Bool(WithoutHeimdallFlag.Name)
cfg.HeimdallgRPCAddress = ctx.String(HeimdallgRPCAddressFlag.Name) cfg.HeimdallgRPCAddress = ctx.String(HeimdallgRPCAddressFlag.Name)
cfg.RunHeimdall = ctx.Bool(RunHeimdallFlag.Name) cfg.RunHeimdall = ctx.Bool(RunHeimdallFlag.Name)

View file

@ -2282,6 +2282,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
configs := &ethconfig.Config{ configs := &ethconfig.Config{
Genesis: gspec, Genesis: gspec,
HeimdallURL: ctx.String(HeimdallURLFlag.Name), HeimdallURL: ctx.String(HeimdallURLFlag.Name),
HeimdallTimeout: ctx.Duration(HeimdallTimeoutFlag.Name),
WithoutHeimdall: ctx.Bool(WithoutHeimdallFlag.Name), WithoutHeimdall: ctx.Bool(WithoutHeimdallFlag.Name),
HeimdallgRPCAddress: ctx.String(HeimdallgRPCAddressFlag.Name), HeimdallgRPCAddress: ctx.String(HeimdallgRPCAddressFlag.Name),
RunHeimdall: ctx.Bool(RunHeimdallArgsFlag.Name), RunHeimdall: ctx.Bool(RunHeimdallArgsFlag.Name),

View file

@ -391,6 +391,10 @@ func (c *Bor) verifyHeader(chain consensus.ChainHeaderReader, header *types.Head
return consensus.ErrUnexpectedWithdrawals return consensus.ErrUnexpectedWithdrawals
} }
if header.RequestsHash != nil {
return consensus.ErrUnexpectedRequests
}
// All basic checks passed, verify cascading fields // All basic checks passed, verify cascading fields
return c.verifyCascadingFields(chain, header, parents) return c.verifyCascadingFields(chain, header, parents)
} }
@ -820,6 +824,9 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
if body.Withdrawals != nil || header.WithdrawalsHash != nil { if body.Withdrawals != nil || header.WithdrawalsHash != nil {
return return
} }
if body.Requests != nil || header.RequestsHash != nil {
return
}
var ( var (
stateSyncData []*types.StateSyncData stateSyncData []*types.StateSyncData
@ -906,6 +913,9 @@ func (c *Bor) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *typ
if body.Withdrawals != nil || header.WithdrawalsHash != nil { if body.Withdrawals != nil || header.WithdrawalsHash != nil {
return nil, consensus.ErrUnexpectedWithdrawals return nil, consensus.ErrUnexpectedWithdrawals
} }
if body.Requests != nil || header.RequestsHash != nil {
return nil, consensus.ErrUnexpectedRequests
}
var ( var (
stateSyncData []*types.StateSyncData stateSyncData []*types.StateSyncData

View file

@ -33,7 +33,6 @@ var (
const ( const (
heimdallAPIBodyLimit = 128 * 1024 * 1024 // 128 MB heimdallAPIBodyLimit = 128 * 1024 * 1024 // 128 MB
stateFetchLimit = 50 stateFetchLimit = 50
apiHeimdallTimeout = 5 * time.Second
retryCall = 5 * time.Second retryCall = 5 * time.Second
) )
@ -59,11 +58,11 @@ type Request struct {
start time.Time start time.Time
} }
func NewHeimdallClient(urlString string) *HeimdallClient { func NewHeimdallClient(urlString string, timeout time.Duration) *HeimdallClient {
return &HeimdallClient{ return &HeimdallClient{
urlString: urlString, urlString: urlString,
client: http.Client{ client: http.Client{
Timeout: apiHeimdallTimeout, Timeout: timeout,
}, },
closeCh: make(chan struct{}), closeCh: make(chan struct{}),
} }
@ -294,7 +293,13 @@ func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL
log.Warn("an error while trying fetching from Heimdall", "path", url.Path, "attempt", attempt, "error", err) log.Warn("an error while trying fetching from Heimdall", "path", url.Path, "attempt", attempt, "error", err)
// create a new ticker for retrying the request // create a new ticker for retrying the request
ticker := time.NewTicker(retryCall) var ticker *time.Ticker
if client.Timeout != 0 {
ticker = time.NewTicker(client.Timeout)
} else {
// only reach here when HeimdallClient is HeimdallGRPCClient or HeimdallAppClient
ticker = time.NewTicker(retryCall)
}
defer ticker.Stop() defer ticker.Stop()
const logEach = 5 const logEach = 5
@ -469,7 +474,7 @@ func internalFetch(ctx context.Context, client http.Client, u *url.URL) ([]byte,
} }
func internalFetchWithTimeout(ctx context.Context, client http.Client, url *url.URL) ([]byte, error) { func internalFetchWithTimeout(ctx context.Context, client http.Client, url *url.URL) ([]byte, error) {
ctx, cancel := context.WithTimeout(ctx, apiHeimdallTimeout) ctx, cancel := context.WithTimeout(ctx, client.Timeout)
defer cancel() defer cancel()
// request data once // request data once

View file

@ -143,7 +143,7 @@ func TestFetchCheckpointFromMockHeimdall(t *testing.T) {
require.NoError(t, err, "expect no error in starting mock heimdall server") require.NoError(t, err, "expect no error in starting mock heimdall server")
// Create a new heimdall client and use same port for connection // Create a new heimdall client and use same port for connection
client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port)) client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port), 5*time.Second)
_, err = client.FetchCheckpoint(context.Background(), -1) _, err = client.FetchCheckpoint(context.Background(), -1)
require.NoError(t, err, "expect no error in fetching checkpoint") require.NoError(t, err, "expect no error in fetching checkpoint")
@ -194,7 +194,7 @@ func TestFetchMilestoneFromMockHeimdall(t *testing.T) {
require.NoError(t, err, "expect no error in starting mock heimdall server") require.NoError(t, err, "expect no error in starting mock heimdall server")
// Create a new heimdall client and use same port for connection // Create a new heimdall client and use same port for connection
client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port)) client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port), 5*time.Second)
_, err = client.FetchMilestone(context.Background()) _, err = client.FetchMilestone(context.Background())
require.NoError(t, err, "expect no error in fetching milestone") require.NoError(t, err, "expect no error in fetching milestone")
@ -250,7 +250,7 @@ func TestFetchShutdown(t *testing.T) {
require.NoError(t, err, "expect no error in starting mock heimdall server") require.NoError(t, err, "expect no error in starting mock heimdall server")
// Create a new heimdall client and use same port for connection // Create a new heimdall client and use same port for connection
client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port)) client := NewHeimdallClient(fmt.Sprintf("http://localhost:%d", port), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)

View file

@ -41,4 +41,7 @@ var (
// ErrUnexpectedWithdrawals is returned if a pre-Shanghai block has withdrawals. // ErrUnexpectedWithdrawals is returned if a pre-Shanghai block has withdrawals.
ErrUnexpectedWithdrawals = errors.New("unexpected withdrawals") ErrUnexpectedWithdrawals = errors.New("unexpected withdrawals")
// ErrUnexpectedRequests is returned if a pre-Shanghai block has requests.
ErrUnexpectedRequests = errors.New("unexpected requests")
) )

View file

@ -137,7 +137,7 @@ func TestCalcBaseFee(t *testing.T) {
} }
} }
// TestCalcBaseFee assumes all blocks are 1559-blocks post Delhi Hard Fork // TestCalcBaseFeeDelhi assumes all blocks are 1559-blocks post Delhi Hard Fork
func TestCalcBaseFeeDelhi(t *testing.T) { func TestCalcBaseFeeDelhi(t *testing.T) {
t.Parallel() t.Parallel()

View file

@ -360,7 +360,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
} }
var requests types.Requests var requests types.Requests
if config.IsPrague(b.header.Number) { if config.IsPrague(b.header.Number) && config.Bor == nil {
for _, r := range b.receipts { for _, r := range b.receipts {
d, err := ParseDepositLogs(r.Logs, config) d, err := ParseDepositLogs(r.Logs, config)
if err != nil { if err != nil {

View file

@ -301,7 +301,12 @@ func (p *ParallelStateProcessor) Process(block *types.Block, statedb *state.Stat
} }
blockContext := NewEVMBlockContext(header, p.bc, nil) blockContext := NewEVMBlockContext(header, p.bc, nil)
context := NewEVMBlockContext(header, p.bc.hc, nil)
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, p.config, cfg)
if p.config.IsPrague(block.Number()) {
ProcessParentBlockHash(block.ParentHash(), vmenv, statedb)
}
// Iterate over and process the individual transactions // Iterate over and process the individual transactions
for i, tx := range block.Transactions() { for i, tx := range block.Transactions() {
msg, err := TransactionToMessage(tx, types.MakeSigner(p.config, header.Number, header.Time), header.BaseFee) msg, err := TransactionToMessage(tx, types.MakeSigner(p.config, header.Number, header.Time), header.BaseFee)
@ -391,7 +396,7 @@ func (p *ParallelStateProcessor) Process(block *types.Block, statedb *state.Stat
// Read requests if Prague is enabled. // Read requests if Prague is enabled.
var requests types.Requests var requests types.Requests
if p.config.IsPrague(block.Number()) { if p.config.IsPrague(block.Number()) && p.config.Bor == nil {
requests, err = ParseDepositLogs(allLogs, p.config) requests, err = ParseDepositLogs(allLogs, p.config)
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -994,6 +994,7 @@ func (s *StateDB) getStateObject(addr common.Address) *stateObject {
// Insert into the live set // Insert into the live set
obj := newObject(s, addr, acct) obj := newObject(s, addr, acct)
s.setStateObject(obj) s.setStateObject(obj)
s.AccountLoaded++
return obj return obj
}) })
} }

View file

@ -8,6 +8,8 @@ The ```bor server``` command runs the Bor client.
- ```bor.heimdall```: URL of Heimdall service (default: http://localhost:1317) - ```bor.heimdall```: URL of Heimdall service (default: http://localhost:1317)
- ```bor.heimdalltimeout```: Timeout of Heimdall service (default: 5s)
- ```bor.heimdallgRPC```: Address of Heimdall gRPC service - ```bor.heimdallgRPC```: Address of Heimdall gRPC service
- ```bor.logs```: Enables bor log retrieval (default: false) - ```bor.logs```: Enables bor log retrieval (default: false)

View file

@ -176,6 +176,9 @@ type Config struct {
// URL to connect to Heimdall node // URL to connect to Heimdall node
HeimdallURL string HeimdallURL string
// timeout in heimdall requests
HeimdallTimeout time.Duration
// No heimdall service // No heimdall service
WithoutHeimdall bool WithoutHeimdall bool
@ -232,7 +235,7 @@ func CreateConsensusEngine(chainConfig *params.ChainConfig, ethConfig *Config, d
} else if ethConfig.HeimdallgRPCAddress != "" { } else if ethConfig.HeimdallgRPCAddress != "" {
heimdallClient = heimdallgrpc.NewHeimdallGRPCClient(ethConfig.HeimdallgRPCAddress) heimdallClient = heimdallgrpc.NewHeimdallGRPCClient(ethConfig.HeimdallgRPCAddress)
} else { } else {
heimdallClient = heimdall.NewHeimdallClient(ethConfig.HeimdallURL) heimdallClient = heimdall.NewHeimdallClient(ethConfig.HeimdallURL, ethConfig.HeimdallTimeout)
} }
return bor.New(chainConfig, db, blockchainAPI, spanner, heimdallClient, genesisContractsClient, false), nil return bor.New(chainConfig, db, blockchainAPI, spanner, heimdallClient, genesisContractsClient, false), nil

View file

@ -50,6 +50,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
BlobPool blobpool.Config BlobPool blobpool.Config
GPO gasprice.Config GPO gasprice.Config
EnablePreimageRecording bool EnablePreimageRecording bool
EnableWitnessCollection bool `toml:"-"`
VMTrace string VMTrace string
VMTraceJsonConfig string VMTraceJsonConfig string
DocRoot string `toml:"-"` DocRoot string `toml:"-"`
@ -59,6 +60,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
RPCTxFeeCap float64 RPCTxFeeCap float64
OverrideCancun *big.Int `toml:",omitempty"` OverrideCancun *big.Int `toml:",omitempty"`
HeimdallURL string HeimdallURL string
HeimdallTimeout time.Duration
WithoutHeimdall bool WithoutHeimdall bool
HeimdallgRPCAddress string HeimdallgRPCAddress string
RunHeimdall bool RunHeimdall bool
@ -112,6 +114,7 @@ func (c Config) MarshalTOML() (interface{}, error) {
enc.RPCTxFeeCap = c.RPCTxFeeCap enc.RPCTxFeeCap = c.RPCTxFeeCap
enc.OverrideCancun = c.OverrideCancun enc.OverrideCancun = c.OverrideCancun
enc.HeimdallURL = c.HeimdallURL enc.HeimdallURL = c.HeimdallURL
enc.HeimdallTimeout = c.HeimdallTimeout
enc.WithoutHeimdall = c.WithoutHeimdall enc.WithoutHeimdall = c.WithoutHeimdall
enc.HeimdallgRPCAddress = c.HeimdallgRPCAddress enc.HeimdallgRPCAddress = c.HeimdallgRPCAddress
enc.RunHeimdall = c.RunHeimdall enc.RunHeimdall = c.RunHeimdall
@ -160,6 +163,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
BlobPool *blobpool.Config BlobPool *blobpool.Config
GPO *gasprice.Config GPO *gasprice.Config
EnablePreimageRecording *bool EnablePreimageRecording *bool
EnableWitnessCollection *bool `toml:"-"`
VMTrace *string VMTrace *string
VMTraceJsonConfig *string VMTraceJsonConfig *string
DocRoot *string `toml:"-"` DocRoot *string `toml:"-"`
@ -169,6 +173,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
RPCTxFeeCap *float64 RPCTxFeeCap *float64
OverrideCancun *big.Int `toml:",omitempty"` OverrideCancun *big.Int `toml:",omitempty"`
HeimdallURL *string HeimdallURL *string
HeimdallTimeout *time.Duration
WithoutHeimdall *bool WithoutHeimdall *bool
HeimdallgRPCAddress *string HeimdallgRPCAddress *string
RunHeimdall *bool RunHeimdall *bool
@ -307,6 +312,9 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error {
if dec.HeimdallURL != nil { if dec.HeimdallURL != nil {
c.HeimdallURL = *dec.HeimdallURL c.HeimdallURL = *dec.HeimdallURL
} }
if dec.HeimdallTimeout != nil {
c.HeimdallTimeout = *dec.HeimdallTimeout
}
if dec.WithoutHeimdall != nil { if dec.WithoutHeimdall != nil {
c.WithoutHeimdall = *dec.WithoutHeimdall c.WithoutHeimdall = *dec.WithoutHeimdall
} }

View file

@ -0,0 +1,14 @@
#!/bin/bash
set -e
signersFile="matic-cli/devnet/devnet/signer-dump.json"
signersDump=$(jq . "$signersFile")
privKey=$(echo "$signersDump" | jq -r ".[0].priv_key")
rpc_url="http://localhost:8545"
cd matic-cli/tests/rpc-tests
go mod tidy
go run . --priv-key "$privKey" --rpc-url "$rpc_url" --log-req-res true
cd -

View file

@ -254,6 +254,8 @@ type HeimdallConfig struct {
// URL is the url of the heimdall server // URL is the url of the heimdall server
URL string `hcl:"url,optional" toml:"url,optional"` URL string `hcl:"url,optional" toml:"url,optional"`
Timeout time.Duration `hcl:"timeout,optional" toml:"timeout,optional"`
// Without is used to disable remote heimdall during testing // Without is used to disable remote heimdall during testing
Without bool `hcl:"bor.without,optional" toml:"bor.without,optional"` Without bool `hcl:"bor.without,optional" toml:"bor.without,optional"`
@ -644,6 +646,7 @@ func DefaultConfig() *Config {
}, },
Heimdall: &HeimdallConfig{ Heimdall: &HeimdallConfig{
URL: "http://localhost:1317", URL: "http://localhost:1317",
Timeout: 5 * time.Second,
Without: false, Without: false,
GRPCAddress: "", GRPCAddress: "",
}, },
@ -930,6 +933,7 @@ func (c *Config) buildEth(stack *node.Node, accountManager *accounts.Manager) (*
} }
n.HeimdallURL = c.Heimdall.URL n.HeimdallURL = c.Heimdall.URL
n.HeimdallTimeout = c.Heimdall.Timeout
n.WithoutHeimdall = c.Heimdall.Without n.WithoutHeimdall = c.Heimdall.Without
n.HeimdallgRPCAddress = c.Heimdall.GRPCAddress n.HeimdallgRPCAddress = c.Heimdall.GRPCAddress
n.RunHeimdall = c.Heimdall.RunHeimdall n.RunHeimdall = c.Heimdall.RunHeimdall

View file

@ -167,6 +167,12 @@ func (c *Command) Flags(config *Config) *flagset.Flagset {
Value: &c.cliConfig.Heimdall.URL, Value: &c.cliConfig.Heimdall.URL,
Default: c.cliConfig.Heimdall.URL, Default: c.cliConfig.Heimdall.URL,
}) })
f.DurationFlag(&flagset.DurationFlag{
Name: "bor.heimdalltimeout",
Usage: "Timeout period for bor's outgoing requests to heimdall",
Value: &c.cliConfig.Heimdall.Timeout,
Default: c.cliConfig.Heimdall.Timeout,
})
f.BoolFlag(&flagset.BoolFlag{ f.BoolFlag(&flagset.BoolFlag{
Name: "bor.withoutheimdall", Name: "bor.withoutheimdall",
Usage: "Run without Heimdall service (for testing purpose)", Usage: "Run without Heimdall service (for testing purpose)",

View file

@ -1408,7 +1408,7 @@ func (w *worker) generateWork(params *generateParams, witness bool) *newPayloadR
allLogs = append(allLogs, r.Logs...) allLogs = append(allLogs, r.Logs...)
} }
// Read requests if Prague is enabled. // Read requests if Prague is enabled.
if w.chainConfig.IsPrague(work.header.Number) { if w.chainConfig.IsPrague(work.header.Number) && w.chainConfig.Bor == nil {
requests, err := core.ParseDepositLogs(allLogs, w.chainConfig) requests, err := core.ParseDepositLogs(allLogs, w.chainConfig)
if err != nil { if err != nil {
return &newPayloadResult{err: err} return &newPayloadResult{err: err}

View file

@ -110,6 +110,7 @@ var nameTagMap = map[string]string{
"0-snapshot": "snapshot", "0-snapshot": "snapshot",
"\"bor.logs\"": "bor.logs", "\"bor.logs\"": "bor.logs",
"url": "bor.heimdall", "url": "bor.heimdall",
"timeout": "bor.heimdalltimeout",
"\"bor.without\"": "bor.withoutheimdall", "\"bor.without\"": "bor.withoutheimdall",
"grpc-address": "bor.heimdallgRPC", "grpc-address": "bor.heimdallgRPC",
"\"bor.runheimdall\"": "bor.runheimdall", "\"bor.runheimdall\"": "bor.runheimdall",