Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync - v2.46.0 #84

Merged
merged 55 commits into from
Jul 20, 2023
Merged

Upstream sync - v2.46.0 #84

merged 55 commits into from
Jul 20, 2023

Commits on Jun 8, 2023

  1. Configuration menu
    Copy the full SHA
    8f8da14 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7671f41 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2023

  1. Configuration menu
    Copy the full SHA
    afa4f53 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2c39570 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ddfe93b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1546a79 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    06af87d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    614769f View commit details
    Browse the repository at this point in the history
  7. 7667 cli params vhost (erigontech#7669)

    This change adds 'any' as an alternate wildcard to '*'.
    
    I have updated all doc references in the main erigon repo - let me know
    if there is anywhere else that needs changing.
    mh0lt authored Jun 9, 2023
    Configuration menu
    Copy the full SHA
    62b2375 View commit details
    Browse the repository at this point in the history
  8. [bor] Desambiguate the term checkpoint (erigontech#7698)

    I realised that the term `checkpoint` is used in 2 different meanings in
    the code, which are distinct. Renaming one of the to persistentSnapshots
    to reduce confusion
    AlexeyAkhunov authored Jun 9, 2023
    Configuration menu
    Copy the full SHA
    2ea9eb5 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2023

  1. rpc service and stageloop logger updates (erigontech#7696)

    This is another update to logging to replace the root logger with a
    contextual logger
    mh0lt authored Jun 10, 2023
    Configuration menu
    Copy the full SHA
    1e575ea View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8841055 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2023

  1. Configuration menu
    Copy the full SHA
    b7469d2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3b89ed8 View commit details
    Browse the repository at this point in the history
  3. e2: avoid do RestoreCodeHash twice (erigontech#7706)

    - do it only once in HistoryStateReader
    AskAlexSharov authored Jun 11, 2023
    Configuration menu
    Copy the full SHA
    4766cd8 View commit details
    Browse the repository at this point in the history
  4. eth_sendRawTransaction: remove logging, because we have `--txpool.tra…

    …ce.senders` which enabling more verbose logging for given senders list (erigontech#7686)
    
    When testing with `Bor` consensus turned on I discovered that
    `SendRawTransaction` returns a 0x000... hash when transactions are
    submitted during block transitions. This turns out to be spurious in the
    sense that the transaction insertion is successful.
    
    The cause is that `ReadCurrentBlockNumber` returns a nil block number.
    
    This in turn is caused by the following: In `accessors_chain.go` there
    are two methods: `WriteHeader` and `WriteHeadHeaderHash` when the first
    is called the block number is written for the header. The second writes
    the header has, but there is no guarantee when it does that the head
    header will have been written yet. In fact it seems to happen sometime
    later.
    
    The problem for `SendRawTransation` is that it begins a transaction
    after inserting into the txpool. And depending on timing this
    transaction may see only the `WriteHeadHeaderHash` insertion, and hence
    can't read the block number.
    
    I have mitigated this by opening the db transaction before calling the
    tx pool insertion, meaning that it is more likely to have a clean view
    of the DB.
    
    I have also moved the chain id check earlier in the code - as I think
    that if this is invalid the method should not try to insert transactions
    in the first place.
    
    The `ReadCurrentBlockNumber` is only used to produce a log message - so
    I've changed this to not fail the whole function but to just log an
    unknown sender. Which means that the hash is still returned to the
    sender after a successful txpool insertion
    mh0lt authored Jun 11, 2023
    Configuration menu
    Copy the full SHA
    f9acbff View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    afd8ea9 View commit details
    Browse the repository at this point in the history
  6. [Caplin] added deneb into converting payload to grpc (erigontech#7708)

    Added so now we can have version 3 payloads preparing for Deneb
    enriavil1 authored Jun 11, 2023
    Configuration menu
    Copy the full SHA
    eac9ead View commit details
    Browse the repository at this point in the history
  7. [Caplin] added configurations for beacon api (erigontech#7699)

    Now you can configure:
    
    Read timeout (default: 5s)
    Write timeout  (default: 5s)
    On/off (default: ON)
    Port (default:5555)
    Address (default:localhost)
    Protocol (default: tcp)
    
    erigontech#7684
    enriavil1 authored Jun 11, 2023
    Configuration menu
    Copy the full SHA
    e380ee4 View commit details
    Browse the repository at this point in the history
  8. [caplin] abstract transition (erigontech#7661)

    start of abstracting the transition layer. 
    
    incremental movements.
    elee1766 authored Jun 11, 2023
    Configuration menu
    Copy the full SHA
    4d35e77 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    6300661 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2023

  1. Fix: typos (erigontech#7710)

    Fix: typos
    omahs authored Jun 12, 2023
    Configuration menu
    Copy the full SHA
    c21d77a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6c8b070 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31be6f6 View commit details
    Browse the repository at this point in the history
  4. consensus/bor: optimise get span, fixes in header validation (erigont…

    …ech#7689)
    
    This PR does the following things. 
    
    - Optimises the get span for bor function. The function was responsible
    to fetch span from heimdall and store in cache. If not found, it would
    iterate back (or front) depending on the last found span in cache. In
    this iteration it would also fetch the span every time it moves front /
    back which is not necessary at all. As we know the `spanLength` we can
    leverage it to directly jump to the required span ID without fetching
    all the intermediate ones.
    - Adds a check for `number > 255` in validating producers from headers'
    extra data with ones in span. As bor fetches this data from contract, it
    used to give correct results for 0th span (i.e. 0-255 blocks) and hence
    no error occurs. Erigon on the other hand directly uses span to get
    producers for all blocks. Hence, the data in 0th span turns out to be
    wrong (as it's hardcoded in contract). We can skip validation for 0th
    span blocks until we start fetching data from contract.
    - As we're planning to use erigon as a validator, it will also be
    responsible for preparing headers. It used to write all the validators
    in the `header.Extra` field instead of just the selected producers. As
    we have `GetCurrentProducers` function available now, we can use it
    instead of `GetCurrentValidators`.
    manav2401 authored Jun 12, 2023
    Configuration menu
    Copy the full SHA
    5c0c9fd View commit details
    Browse the repository at this point in the history
  5. added --log.dir.prefix flag (erigontech#7714)

    This request adds an additional logging flag to change the name of the
    logfiles produced by erigon to be prefixed by a name other than
    'erigon'.
    
    This allows multiple nodes to log to the same directory without
    overwriting each others files. It is requires so that the devnet when
    running can maintain all of its log files in a single consolidated
    directory which survives devnet restarts.
    
    ---------
    
    Co-authored-by: Mark Holt <[email protected]>
    mholt-dv and mh0lt authored Jun 12, 2023
    Configuration menu
    Copy the full SHA
    e99269e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a45f6bd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cefbf18 View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. Configuration menu
    Copy the full SHA
    ae1b193 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6121f63 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    78d9e00 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2023

  1. Configuration menu
    Copy the full SHA
    5ff8246 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f4d8bd8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    226763b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8b312d5 View commit details
    Browse the repository at this point in the history
  5. ws unfreeze (erigontech#7724)

    attempt to address next issue: 
    
    > when I'm having a lot of websocket connections the node is freezing
    and then it needs like 10 mins to sync. Then if I keep pushing requests
    it falls out of sync all the time
    AskAlexSharov authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    1b14785 View commit details
    Browse the repository at this point in the history
  6. Move ChainID from CommonTx to DynamicFeeTransaction (erigontech#7732)

    For legacy transactions ChainID is optional (missing in
    pre-[EIP155](https://eips.ethereum.org/EIPS/eip-155) transactions) and
    is derived from `V` anyway.
    
    Also, cherry pick ethereum/go-ethereum#27452.
    yperbasis authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    862d7b6 View commit details
    Browse the repository at this point in the history
  7. Fix lint issues (erigontech#7733)

    Fix some issues introduced in PR erigontech#7715
    yperbasis authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    2dd7df9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4a2a199 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4f812ef View commit details
    Browse the repository at this point in the history
  10. Devnet scenarios (erigontech#7723)

    This is an update to the devnet code which introduces the concept of
    configurable scenarios. This replaces the previous hard coded execution
    function.
    
    The intention is that now both the network and the operations to run on
    the network can be described in a data structure which is configurable
    and composable.
    
    The operating model is to create a network and then ask it to run
    scenarios:
    
    ```go
    network.Run(
    		runCtx,
    		scenarios.Scenario{
    			Name: "all",
    			Steps: []*scenarios.Step{
    				&scenarios.Step{Text: "InitSubscriptions", Args: []any{[]requests.SubMethod{requests.Methods.ETHNewHeads}}},
    				&scenarios.Step{Text: "PingErigonRpc"},
    				&scenarios.Step{Text: "CheckTxPoolContent", Args: []any{0, 0, 0}},
    				&scenarios.Step{Text: "SendTxWithDynamicFee", Args: []any{recipientAddress, services.DevAddress, sendValue}},
    				&scenarios.Step{Text: "AwaitBlocks", Args: []any{2 * time.Second}},
    			},
    		})
    ```
    The steps here refer to step handlers which can be defined as follows:
    
    ```go
    func init() {
    	scenarios.MustRegisterStepHandlers(
    		scenarios.StepHandler(GetBalance),
    	)
    }
    
    func GetBalance(ctx context.Context, addr string, blockNum requests.BlockNumber, checkBal uint64) {
    ...
    ```
    This commit is an initial implementation of the scenario running - which
    is working, but will need to be enhanced to make it more usable &
    developable.
    
    The current version of the code is working and has been tested with the
    dev network, and bor withoutheimdall. There is a multi miner bor
    heimdall configuration but this is yet to be tested.
    
    Note that by default the scenario runner picks nodes at random on the
    network to send transactions to. this causes the dev network to run very
    slowly as it seems to take a long time to include transactions where the
    nonce is incremented across nodes. It seems to take a long time for the
    nonce to catch up in the transaction pool processing. This is yet to be
    investigated.
    mh0lt authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    f110102 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a588673 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2023

  1. Enforce blockReader interface (erigontech#7737)

    - breaks dependency from staged_sync to package with block_reader
    implementation
    - breaks dependency from snap_sync to package with block_reader
    implementation
    - breaks dependency from mining to txpool implementation
    AskAlexSharov authored Jun 15, 2023
    Configuration menu
    Copy the full SHA
    e502377 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    252e57b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3c3be9 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2023

  1. Configuration menu
    Copy the full SHA
    a63b24b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    94d592d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eae2d9a View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. save

    AskAlexSharov committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    6755f7e View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Configuration menu
    Copy the full SHA
    d98f706 View commit details
    Browse the repository at this point in the history
  2. Update erigon-lib version

    ImTei committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    524abf5 View commit details
    Browse the repository at this point in the history
  3. Add missing lines

    ImTei committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    d02c00a View commit details
    Browse the repository at this point in the history
  4. Fix build errors

    ImTei committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e9838d4 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2023

  1. Add ChainID initialization

    ImTei committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    8e4e432 View commit details
    Browse the repository at this point in the history
  2. Update erigon-lib version

    ImTei committed Jul 20, 2023
    Configuration menu
    Copy the full SHA
    4c52e8a View commit details
    Browse the repository at this point in the history