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

Merge pre v2.57 #81

Merged
merged 126 commits into from
Feb 12, 2024
Merged

Merge pre v2.57 #81

merged 126 commits into from
Feb 12, 2024

Commits on Dec 24, 2023

  1. "downloader manifest": cmd to produce manifest.txt (erigontech#9067)

    Co-authored-by: Alex Sharp <[email protected]>
    AskAlexSharov and Alex Sharp authored Dec 24, 2023
    Configuration menu
    Copy the full SHA
    77d32cc View commit details
    Browse the repository at this point in the history
  2. block retire: merge all possible files (even bor) even if nothing to …

    …retire (erigontech#9068)
    
    Co-authored-by: Alex Sharp <[email protected]>
    AskAlexSharov and Alex Sharp authored Dec 24, 2023
    Configuration menu
    Copy the full SHA
    e08003f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2944abb View commit details
    Browse the repository at this point in the history

Commits on Dec 25, 2023

  1. [Grindmas] Added tests to Beacon API, also fixed stuff. (erigontech#9074

    )
    
    * Testing Beacon API
    * Fixed sentinel code (a little bit)
    * Fixed sentinel tests
    * Added historical state support
    * Fixed state-related endpoints (i was drunk when writing them)
    Giulio2002 authored Dec 25, 2023
    Configuration menu
    Copy the full SHA
    eaf0348 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ab4a00f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bc50bd5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0d31444 View commit details
    Browse the repository at this point in the history
  5. Update Polygon storage requirements (erigontech#9014)

    Co-authored-by: Alex Sharp <[email protected]>
    yperbasis and Alex Sharp authored Dec 25, 2023
    Configuration menu
    Copy the full SHA
    9f9e364 View commit details
    Browse the repository at this point in the history
  6. Added Validators endpoint to Beacon API (erigontech#9080)

    * Added /validators retrieval to beacon api
    * fixed race in sentinel
    * fixed possible UB in gossip management
    Giulio2002 authored Dec 25, 2023
    Configuration menu
    Copy the full SHA
    cdb4731 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2023

  1. Configuration menu
    Copy the full SHA
    a48db43 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2023

  1. Added sentry simulator implementation (erigontech#9087)

    This adds a simulator object with implements the SentryServer api but
    takes objects from a pre-existing snapshot file.
    
    If the snapshot is not available locally it will download and index the
    .seg file for the header range being asked for.
    
    It is created as follows: 
    
    ```go
    sim, err := simulator.NewSentry(ctx, "mumbai", dataDir, 1, logger)
    ```
    
    Where the arguments are:
    
    * ctx - a callable context where cancel will close the simulator torrent
    and file connections (it also has a Close method)
    * chain - the name of the chain to take the snapshots from
    * datadir - a directory potentially containing snapshot .seg files. If
    not files exist in this directory they will be downloaded
     *  num peers - the number of peers the simulator should create
     *  logger - the loger to log actions to
    
    It can be attached to a client as follows:
    
    ```go
    simClient := direct.NewSentryClientDirect(66, sim)
    ```
    
    At the moment only very basic functionality is implemented:
    
    * get headers will return headers by range or hash (hash assumes a
    pre-downloaded .seg as it needs an index
    * the header replay semantics need to be confirmed
    * eth 65 and 66(+) messaging is supported
    * For details see: `simulator_test.go
    
    More advanced peer behavior (e.g. header rewriting) can be added
    Bodies/Transactions handling can be added
    mh0lt authored Dec 27, 2023
    Configuration menu
    Copy the full SHA
    df0699a View commit details
    Browse the repository at this point in the history
  2. E2 snapshot uploading (erigontech#9056)

    This change introduces additional processes to manage snapshot uploading
    for E2 snapshots:
    
    ## erigon snapshots upload
    
    The `snapshots uploader` command starts a version of erigon customized
    for uploading snapshot files to
    a remote location.  
    
    It breaks the stage execution process after the senders stage and then
    uses the snapshot stage to send
    uploaded headers, bodies and (in the case of polygon) bor spans and
    events to snapshot files. Because
    this process avoids execution in run signifigantly faster than a
    standard erigon configuration.
    
    The uploader uses rclone to send seedable (100K or 500K blocks) to a
    remote storage location specified
    in the rclone config file.
    
    The **uploader** is configured to minimize disk usage by doing the
    following:
    
    * It removes snapshots once they are loaded
    * It aggressively prunes the database once entities are transferred to
    snapshots
    
    in addition to this it has the following performance related features:
    
    * maximizes the workers allocated to snapshot processing to improve
    throughput
    * Can be started from scratch by downloading the latest snapshots from
    the remote location to seed processing
    
    ## snapshots command
    
    Is a stand alone command for managing remote snapshots it has the
    following sub commands
    
    * **cmp** - compare snapshots
    * **copy** - copy snapshots
    * **verify** - verify snapshots
    * **manifest** - manage the manifest file in the root of remote snapshot
    locations
    * **torrent** - manage snapshot torrent files
    mh0lt authored Dec 27, 2023
    Configuration menu
    Copy the full SHA
    79ed8ca View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2023

  1. rpc: implement txpool_contentFrom (erigontech#9057)

    implement the `txpool_contentFrom` rpc, used to retrieve the specified
    address's tx contents.
    
    ---------
    
    Signed-off-by: jsvisa <[email protected]>
    jsvisa authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    398bcb5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    698ee60 View commit details
    Browse the repository at this point in the history
  3. Introduce new public buckets for the snapshots (erigontech#9094)

    Co-authored-by: Alex Sharp <[email protected]>
    AlexeyAkhunov and Alex Sharp authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    ab27531 View commit details
    Browse the repository at this point in the history
  4. borheimdall: add tests for validator set and selected proposers valid…

    …ation (erigontech#9089)
    
    Adds unit tests for:
    - Bor Heimdall Stage - `checkHeaderExtraData`
    - at end of each sprint verifies that the validators in the header extra
    data matches the selected proposers from the heimdall span
       - 1 test for selected proposers length mismatch
       - 1 test for selected proposers bytes mismatch
    - BorHeimdall Stage - `persistValidatorSets`
    - verifies that each header is created by a validator in the validator
    set
       - in such situation we set the unwind point
    taratorio authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    6770487 View commit details
    Browse the repository at this point in the history
  5. borheimdall: only fetch next span when in last sprint of current span (

    …erigontech#9096)
    
    Heimdall prepares the next span a number of sprints before the current
    span ends. Currently we always fetch the next span regardless of which
    sprint we are in during the current span. This causes a liveness issue
    due to how the Heimdall client works (it infinitely retries until it
    fetches a span - this issue will be fixed in a separate PR). This PR
    fixes this by matching what bor does - it fetches the next span only in
    the last sprint of the current span.
    
    Changes:
    
    - Adds a unit test for the above
    - Adds a new function BlockInLastSprintOfSpan
    - Some code reorg and cleanup - moves the span num related functions
    from the bor package to the span sub package for better logical grouping
    taratorio authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    1f237c0 View commit details
    Browse the repository at this point in the history
  6. heimdall: use span id as naming (erigontech#9097)

    follow up on naming as suggested here
    erigontech#9096 (review)
    taratorio authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    f8cc27a View commit details
    Browse the repository at this point in the history
  7. heimdall: add max retries to heimdall client (erigontech#9098)

    Corresponds to the client fix in this PR description -
    erigontech#9096 (comment)
    taratorio authored Dec 28, 2023
    Configuration menu
    Copy the full SHA
    fc9dae1 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2023

  1. heimdall: better error logging for clerk/event-record/list nil respon…

    …se (erigontech#9103)
    
    Users reported this error
    ```
    [bor.heimdall] an error while trying fetching path=clerk/event-record/list attempt=5 error="unexpected end of JSON input"
    ```
    
    Which may happen if:
    
    1. Heimdall is behind and not sync-ed - for more info check
    maticnetwork/heimdall#993
    2. Or the header time erigon is sending is far into the future
    
    The logs in this PR will help us see which of the 2 is the culprit but
    most likely it is 1. We will investigate further 2. if it ever happens.
    
    Changes:
    1. Improves logging upon heimdall client retries - prints out the full
    url that failed.
    2. Fixes a bug where the body was incorrectly checked if it is empty -
    `len(body) == 0` vs `body == nil`
    3. Unit test for the bug regression
    4. Adds a log to indicate to users to check their heimdall process if
    they run into this scenario since that may be the culprit
    
    
    Example output with new logs
    <img width="1465" alt="Screenshot 2023-12-29 at 20 16 57"
    src="https://github.com/ledgerwatch/erigon/assets/94537774/1ebfde68-aa93-41d6-889a-27bef5414f25">
    taratorio authored Dec 30, 2023
    Configuration menu
    Copy the full SHA
    b562eff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    510d62a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    78bb3cd View commit details
    Browse the repository at this point in the history
  4. Added GET /eth/v1/beacon/rewards/blocks/{block_id} and POST /eth/v1/b…

    …eacon/rewards/sync_committee/{block_id} (erigontech#9102)
    
    * Changed slightly archive format (again)
    * Added all of the remaining rewards endpoints
    Giulio2002 authored Dec 30, 2023
    Configuration menu
    Copy the full SHA
    46ecf03 View commit details
    Browse the repository at this point in the history

Commits on Dec 31, 2023

  1. Added db loggers to all db callers and fixed flag settings (erigontec…

    …h#9099)
    
    Mdbx now takes a logger - but this has not been pushed to all callers -
    meaning it had an invalid logger
    
    This fixes the log propagation.
    
    It also fixed a start-up issue for http.enabled and txpool.disable
    created by a previous merge
    mh0lt authored Dec 31, 2023
    Configuration menu
    Copy the full SHA
    19bc328 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    580c555 View commit details
    Browse the repository at this point in the history

Commits on Jan 1, 2024

  1. Configuration menu
    Copy the full SHA
    a959387 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bab123c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    13da868 View commit details
    Browse the repository at this point in the history

Commits on Jan 2, 2024

  1. Configuration menu
    Copy the full SHA
    415b17c View commit details
    Browse the repository at this point in the history
  2. Make Caplin work with Otterscan (erigontech#9115)

    * Fixed mispelling in json fields
    * Added CORS
    Giulio2002 authored Jan 2, 2024
    Configuration menu
    Copy the full SHA
    3d10cee View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2024

  1. Configuration menu
    Copy the full SHA
    777f5dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2274f3 View commit details
    Browse the repository at this point in the history
  3. Update README.md (erigontech#9112)

    Hi, I made three suggestions for this section:
    
    - "devenet" should be "devnet" (typo).
    
    - "are currently build" should be "are currently built" (grammatical
    error).
    
    - "sptep" should be "step" (typo).
    
    Thanks.
    oxbau authored Jan 3, 2024
    Configuration menu
    Copy the full SHA
    a645ef6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    391b267 View commit details
    Browse the repository at this point in the history
  5. devnet: fix ws port clash for state-sync scenario (erigontech#9125)

    Getting an error in one of the bor nodes in devnet when trying to run
    the "state-sync" scenario:
    ```
    [EROR] [01-03|16:55:44.179] cli.StartRpcServer error                 err="could not start separate Websocket RPC api at port 8546: listen tcp 127.0.0.1:8546: bind: address already in use"
    ```
    
    This happens for scenarios with more than 1 node.
    
    Digging further this regressions has happened due to this change:
    erigontech#8909
    
    This PR fixes this by updating the devnet `NodeArgs` struct to set the
    corresponding `--ws.port` `arg` tag which now exists.
    taratorio authored Jan 3, 2024
    Configuration menu
    Copy the full SHA
    b94ca6d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    18baf81 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Configuration menu
    Copy the full SHA
    82822ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b57cbdc View commit details
    Browse the repository at this point in the history
  3. data (erigontech#9126)

    elee1766 authored Jan 4, 2024
    Configuration menu
    Copy the full SHA
    9cd5f58 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. Configuration menu
    Copy the full SHA
    3eeb572 View commit details
    Browse the repository at this point in the history
  2. bor: BorConfig setup fix (erigontech#9145)

    A crash on startup happens on --chain=mumbai , because I've confused
    chainConfig.Bor (from type chain.Config) and config.Bor (from type
    ethconfig.Config) in the setup code.
    
    ethconfig.Config.Bor property contained bogus values, and was used only
    to check its type in CreateConsensusEngine(). Its value was never read
    (before PR erigontech#9117).
    
    This change removes the property to avoid confusion and fix the crash.
    
    Devnet network.BorStateSyncDelay was implemented using
    ethconfig.Config.Bor, but it wasn't taking any effect. It should be
    fixed separately in a different way.
    battlmonstr authored Jan 5, 2024
    Configuration menu
    Copy the full SHA
    ebe16d8 View commit details
    Browse the repository at this point in the history
  3. stagedsync: implement bor span for chain reader and fix loggers (erig…

    …ontech#9146)
    
    While working on fixing the bor mining loop I stumbled across an error
    in `ChainReader.BorSpan` - not implemented panic. Also hit a few other
    panics due to missed logger in `ChainReaderImpl` struct initialisations.
    This PR fixes both.
    taratorio authored Jan 5, 2024
    Configuration menu
    Copy the full SHA
    98cc1ee View commit details
    Browse the repository at this point in the history

Commits on Jan 6, 2024

  1. Configuration menu
    Copy the full SHA
    e958d35 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2024

  1. Configuration menu
    Copy the full SHA
    235af8a View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2024

  1. Change retire progress log level to debug (erigontech#9153)

    This moved the log level of retire progress messaging to debug, to avoid
    log nose on qa and test runs
    mh0lt authored Jan 8, 2024
    Configuration menu
    Copy the full SHA
    15ff418 View commit details
    Browse the repository at this point in the history
  2. add amoy bootnodes (erigontech#9158)

    this PR adds amoy bootnodes to the configuration
    temaniarpit27 authored Jan 8, 2024
    Configuration menu
    Copy the full SHA
    134dc85 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fe9bc35 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2cbe8b7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7490e7d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b4fd278 View commit details
    Browse the repository at this point in the history
  7. dvovk/updsync (erigontech#9134)

    refactored data structure for sync statistics
    dvovk authored Jan 8, 2024
    Configuration menu
    Copy the full SHA
    ff92b70 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de6c159 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2521f47 View commit details
    Browse the repository at this point in the history
  10. Caplin: Fixed crash in OnAttestation (erigontech#9159)

    * Added handling of AggregateAndProof
    Giulio2002 authored Jan 8, 2024
    Configuration menu
    Copy the full SHA
    b2fa618 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b4e6563 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    19b9504 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2024

  1. Configuration menu
    Copy the full SHA
    36fefbb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b25d8cc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    22f7615 View commit details
    Browse the repository at this point in the history
  4. [E3] Some fixes for the in-memory database when working with Caplin (… (

    erigontech#9164)
    
    …testing on Sepolia) (erigontech#9151)
    
    ---------
    
    Co-authored-by: Alex Sharp <[email protected]>
    AlexeyAkhunov and Alex Sharp authored Jan 9, 2024
    Configuration menu
    Copy the full SHA
    459ccf8 View commit details
    Browse the repository at this point in the history
  5. ci: run macOS jobs on macos-13 instead of macos-13-xlarge (erigontech…

    …#9177)
    
    macos-13-xlarge was needed to use M1 CPU,
    because previously silkworm-go didn't have macOS Intel support
    battlmonstr authored Jan 9, 2024
    Configuration menu
    Copy the full SHA
    302f1f7 View commit details
    Browse the repository at this point in the history
  6. stagedsync: fix bor heimdall mining flow (erigontech#9149)

    Currently the mining loop is broken for the polygon chain. This PR fixes
    this.
    
    High level changes:
    
    - Introduces new Bor<->Heimdall stage specifically for the needs of the
    mining flow
    - Extracts out common logic from Bor<->Heimdall sync and mining stages
    into shared functions
    - Removes `mine` flag for the Bor<->Heimdall sync stage
    - Extends the current `StartMining` function to prefetch span zero if
    needed before the mining loop is started
    - Fixes Bor to read span zero (instead of span 1) from heimdall when the
    span is not initially set in the local smart contract that the Spanner
    uses
    
    Test with devnet "state-sync" scenario:
    ![Screenshot 2024-01-05 at 17 41
    23](https://github.com/ledgerwatch/erigon/assets/94537774/34ca903a-69b8-416a-900f-a32f2d4417fa)
    taratorio authored Jan 9, 2024
    Configuration menu
    Copy the full SHA
    74ec3a9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e25b15b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    fec0c9e View commit details
    Browse the repository at this point in the history
  9. bor: fix for TestMiningBenchmark (erigontech#9182)

    integration test TestMiningBenchmark is failing the CI on devel - this
    PR aims to fix it
    taratorio authored Jan 9, 2024
    Configuration menu
    Copy the full SHA
    af913fd View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    9c47cce View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8db023b View commit details
    Browse the repository at this point in the history
  12. devnet: fix infinite recursion & enable TestStateSync & TestCallContr…

    …act integration tests (erigontech#9183)
    
    This PR fixes an infinite recursion (stack overflow) error in devnet
    integration tests that surfaced in our integration CI a week or more ago
    and additionally enables some integration tests that are now fixed -
    `TestStateSync` & `TestCallContract`.
    
    ![Screenshot 2024-01-09 at 17 10
    24](https://github.com/ledgerwatch/erigon/assets/94537774/a5a8c9c9-9f68-4084-9e08-1bf3c1601cab)
    taratorio authored Jan 9, 2024
    Configuration menu
    Copy the full SHA
    0cfe661 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. mdbx: hard dirtyPages limit (erigontech#9178)

    logic: 1/42 of ram, but not more than 2Gb for chandata and not more than
    256mb for other databases.
    
    ---------
    
    Co-authored-by: battlmonstr <[email protected]>
    AskAlexSharov and battlmonstr authored Jan 10, 2024
    Configuration menu
    Copy the full SHA
    ceeb090 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95109d9 View commit details
    Browse the repository at this point in the history
  3. Fix DenebForkEpoch for Chiado (erigontech#9188)

    In PR erigontech#9184 I confused slot with epoch. Refer to
    gnosischain/configs#26.
    yperbasis authored Jan 10, 2024
    Configuration menu
    Copy the full SHA
    09ec1f1 View commit details
    Browse the repository at this point in the history
  4. Added EthV1AggregateAndProofs API (erigontech#9192)

    Added publishing of aggregates and proofs
    Giulio2002 authored Jan 10, 2024
    Configuration menu
    Copy the full SHA
    284aa1d View commit details
    Browse the repository at this point in the history
  5. Fixes for Bor Block Production Synchronization (erigontech#9162)

    This PR contains 3 fixes for interaction between the Bor mining loop and
    the TX pool which where causing the regular creation of blocks with zero
    transactions.
    
    * Mining/Tx pool block synchronization
    The synchronization of the tx pool between the sync loop and the mining
    loop has been changed so that both are triggered by the same event and
    synchronized via a sync.Cond rather than a polling loop with a hard
    coded loop limit. This means that mining now waits for the pool to be
    updated from the previous block before it starts the mining process.
    * Txpool Startup consolidated into its MainLoop
    Previously the tx pool start process was dynamically triggered at
    various points in the code. This has all now been moved to the start of
    the main loop. This is necessary to avoid a timing hole which can leave
    the mining loop hanging waiting for a previously block broadcast which
    it missed due to its delay start.
    * Mining listens for block broadcast to avoid duplicate mining
    operations
    The mining loop for bor has a recommit timer in case blocks re not
    produced on time. However in the case of sprint transitions where the
    seal publication is delayed this can lead to duplicate block production.
    This is suppressed by introducing a `waiting` state which is exited upon
    the block being broadcast from the sealing operation.
    mh0lt authored Jan 10, 2024
    Configuration menu
    Copy the full SHA
    b05ffc9 View commit details
    Browse the repository at this point in the history
  6. devnet: integration tests port clash fix (erigontech#9194)

    Integration tests CI is failing due to a port clash in devnet tests. I
    believe this is because there are 2 packages of devnet integration tests
    and go can run tests from separate packages in parallel (by default it
    does package level parallelism). A simple fix would be to just have all
    devnet integration tests in 1 package and run all these tests
    sequentially within the package (ie not use t.Parallel). This PR moves
    all devnet integration tests in 1 package.
    
    `"ContextStart devnet start failed: private api: could not create
    listener: listen top 127.0.0.1:10090: bind: address already in use,
    addr=localhost:10090"`
    
    ![Screenshot 2024-01-10 at 13 38
    37](https://github.com/ledgerwatch/erigon/assets/94537774/06bda987-45e5-46ef-9e0b-3876b3f85c01)
    taratorio authored Jan 10, 2024
    Configuration menu
    Copy the full SHA
    f690301 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2024

  1. Remove duplicate flags (erigontech#9199)

    This fixes the snapshot uploader start as flags have been moved to
    default
    mh0lt authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    641f53e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1ee439e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b1c3006 View commit details
    Browse the repository at this point in the history
  4. clean-exit test: increase test time (erigontech#9193)

    This PR
    - increase the test time
    - use the updated python scripts that reports as an issue a long exit
    time
    - change the test name to states that it is runned in the snapshot
    downloading phase
    (a later PR will add a similar test on the block downloading phase)
    mriccobene authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    470f05e View commit details
    Browse the repository at this point in the history
  5. Fix txpool queue overflow (erigontech#9197)

    When discarding spamming we need to remove the tx from the subpools as
    well as the sender tx list. Otherwise the tx is ignored by other
    operations and left in the subpool
    
    As well as the fix here this PR also contains several changes to TX
    TRACING and other logging to make it easier to see what is going on with
    pool processing
    mh0lt authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    7308e87 View commit details
    Browse the repository at this point in the history
  6. build(deps): bump github.com/quic-go/quic-go from 0.38.1 to 0.38.2 (e…

    …rigontech#9196)
    
    Bumps [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go)
    from 0.38.1 to 0.38.2.
    <details>
    <summary>Release notes</summary>
    <p><em>Sourced from <a
    href="https://github.com/quic-go/quic-go/releases">github.com/quic-go/quic-go's
    releases</a>.</em></p>
    <blockquote>
    <h2>v0.38.2</h2>
    <p>This release contains fixes for a resource exhaustion attack on
    QUIC's path validation logic (CVE-2023-49295), see <a
    href="https://seemann.io/posts/2023-12-18-exploiting-quics-path-validation">https://seemann.io/posts/2023-12-18-exploiting-quics-path-validation</a>
    for details:</p>
    <ul>
    <li>limit the number of queued PATH_RESPONSE frames to 256 (<a
    href="https://redirect.github.com/quic-go/quic-go/pull/4199">quic-go/quic-go#4199</a>)</li>
    <li>don't retransmit PATH_CHALLENGE and PATH_RESPONSE frames (<a
    href="https://redirect.github.com/quic-go/quic-go/pull/4200">quic-go/quic-go#4200</a>)</li>
    </ul>
    <p><strong>Full Changelog</strong>: <a
    href="https://github.com/quic-go/quic-go/compare/v0.38.1...v0.38.2">https://github.com/quic-go/quic-go/compare/v0.38.1...v0.38.2</a></p>
    </blockquote>
    </details>
    <details>
    <summary>Commits</summary>
    <ul>
    <li><a
    href="https://github.com/quic-go/quic-go/commit/9aaefe19fc3dc8c8917cc87e6128bb56d9e9e6cc"><code>9aaefe1</code></a>
    don't retransmit PATH_CHALLENGE and PATH_RESPONSE frames (<a
    href="https://redirect.github.com/quic-go/quic-go/issues/4200">#4200</a>)</li>
    <li><a
    href="https://github.com/quic-go/quic-go/commit/17fc98c2d81dbe685c19702dc694a9d606ac56dc"><code>17fc98c</code></a>
    limit the number of queued PATH_RESPONSE frames to 256 (<a
    href="https://redirect.github.com/quic-go/quic-go/issues/4199">#4199</a>)</li>
    <li>See full diff in <a
    href="https://github.com/quic-go/quic-go/compare/v0.38.1...v0.38.2">compare
    view</a></li>
    </ul>
    </details>
    <br />
    
    
    [![Dependabot compatibility
    score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/quic-go/quic-go&package-manager=go_modules&previous-version=0.38.1&new-version=0.38.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
    
    Dependabot will resolve any conflicts with this PR as long as you don't
    alter it yourself. You can also trigger a rebase manually by commenting
    `@dependabot rebase`.
    
    [//]: # (dependabot-automerge-start)
    [//]: # (dependabot-automerge-end)
    
    ---
    
    <details>
    <summary>Dependabot commands and options</summary>
    <br />
    
    You can trigger Dependabot actions by commenting on this PR:
    - `@dependabot rebase` will rebase this PR
    - `@dependabot recreate` will recreate this PR, overwriting any edits
    that have been made to it
    - `@dependabot merge` will merge this PR after your CI passes on it
    - `@dependabot squash and merge` will squash and merge this PR after
    your CI passes on it
    - `@dependabot cancel merge` will cancel a previously requested merge
    and block automerging
    - `@dependabot reopen` will reopen this PR if it is closed
    - `@dependabot close` will close this PR and stop Dependabot recreating
    it. You can achieve the same result by closing it manually
    - `@dependabot show <dependency name> ignore conditions` will show all
    of the ignore conditions of the specified dependency
    - `@dependabot ignore this major version` will close this PR and stop
    Dependabot creating any more for this major version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this minor version` will close this PR and stop
    Dependabot creating any more for this minor version (unless you reopen
    the PR or upgrade to it yourself)
    - `@dependabot ignore this dependency` will close this PR and stop
    Dependabot creating any more for this dependency (unless you reopen the
    PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the
    [Security Alerts
    page](https://github.com/ledgerwatch/erigon/network/alerts).
    
    </details>
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    9a9808f View commit details
    Browse the repository at this point in the history
  7. p2p/discv4: revert gotreply handler change from erigontech#8661 (erig…

    …ontech#9119) (erigontech#9195)
    
    The handler had race conditions in the candidates processing goroutine.
    battlmonstr authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    0449818 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c1e3ec5 View commit details
    Browse the repository at this point in the history
  9. Added more checks on state reconstruction + made history reconstructi…

    …on resumable. (erigontech#9211)
    
    Co-authored-by: Bayram Guvanjov <[email protected]>
    Giulio2002 and bayram98 authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    8315033 View commit details
    Browse the repository at this point in the history
  10. Mumbai uploader regression fixes (erigontech#9212)

    This fixes a couple of regressions for running the uploader for mumbai
    
    * Now flags have moved to a higher context they need to be set in the
    context not the flag values
    * Span 0 of mumbai has a header/span mismatch for span zero sprint 0. So
    the check here needs to be suppressed
    mh0lt authored Jan 11, 2024
    Configuration menu
    Copy the full SHA
    66cd4e7 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2024

  1. recsplit: reduce ram pressure (erigontech#9218)

    reasons: 
    - indexing done in background (or in many workers)
    - `recsplit` has 2 etl collectors
    AskAlexSharov authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    3bb1917 View commit details
    Browse the repository at this point in the history
  2. mdbx: reduce 2 times hard dplimit (erigontech#9216)

    can do it, because we don't do read-after-write in same rwtx
    AskAlexSharov authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    e806db9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa1e1ba View commit details
    Browse the repository at this point in the history
  4. refactor(erigon-lib/metrics): replace strings.IndexByte with strings.…

    …Cut (erigontech#9202)
    
    above go1.18  Index calls are more clearly written using Cut.
    golang/go#46336
    ddl-hust authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    db1dcbb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    574ec80 View commit details
    Browse the repository at this point in the history
  6. Deneb integration to Caplin (erigontech#9093)

    Pr is ready to review and merge. 
    
    This PR includes implementing and integrating Ethereum Deneb's hard work
    with the Caplin Ethereum client.
    
    Changes:
    
    - Full compatibility with Deneb Ethereum hard fork
    - Added new EIPs introduced in Deneb. (`EIP-4788`, `EIP-4844`,
    `EIP-7044`, `EIP-7045`, `EIP-7514`)
    - Tests integration
    
    ---------
    
    Co-authored-by: Giulio <[email protected]>
    bayram98 and Giulio2002 authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a191296 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c11e504 View commit details
    Browse the repository at this point in the history
  8. Removed the check for milestoneID in the GetVoteOnHash() (erigontech#…

    …9021)
    
    Removed the check for milestoneID in the GetVoteOnHash()
    
    maticnetwork/bor#1109
    temaniarpit27 authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    a592cbf View commit details
    Browse the repository at this point in the history
  9. Don't run pos downloader or engine api for bor (erigontech#9220)

    Pos downloader and the engine api code are not necessary for Bor. This
    adds code to suppress their start up.
    mh0lt authored Jan 12, 2024
    Configuration menu
    Copy the full SHA
    320fe0a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    52a9487 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2024

  1. Configuration menu
    Copy the full SHA
    7b58dab View commit details
    Browse the repository at this point in the history
  2. chore: some proofreading in the docs (erigontech#9223)

    Hi, caught a few mistakes while reading the docs. Hope I can be of any
    help.
    Have a nice day.
    Pan-chao authored Jan 13, 2024
    Configuration menu
    Copy the full SHA
    2b0fd6d View commit details
    Browse the repository at this point in the history
  3. Fix startup sync for txpool processing for bor block production (erig…

    …ontech#9219)
    
    When the sync loop first runs it suppresses block sync events both in
    the initial loop and when the blocks being processed are greater than
    1000.
    
    This fix removed the first check, because otherwise the first block
    received by the process ends up not getting sent to the tx pool. Which
    means it won't produce new block for polygon.
    
    As well as this fix - I have also moved the gas initialization to the
    txpool start method rather than prompting it with a 'synthetic block
    event'
    
    As the txpool start has access to the core & tx DB's it can find the
    current block and chain config internally so that it doesn't need to be
    externally activated it can just do this itself on start up. This has
    the advantage of making the txpool more self contained.
    mh0lt authored Jan 13, 2024
    Configuration menu
    Copy the full SHA
    d8b91c4 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2024

  1. Configuration menu
    Copy the full SHA
    ac9f9e0 View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2024

  1. Configuration menu
    Copy the full SHA
    8d4d4d8 View commit details
    Browse the repository at this point in the history
  2. polygon/sync: span updates (erigontech#9229)

    It is possible that a span update happens during a milestone.
    A headers slice might cross to the new span.
    Also if 2 forks evolve simulaneously, a shorter fork can still be in the
    previous span.
    In these cases we need access to the previous span to calculate
    difficulty and validate header times.
    
    SpansCache will keep recent spans.
    The cache will be updated on new span events from the heimdall.
    The cache is pruned on new milestone events and in practice no more than
    2 spans are kept.
    
    The header difficulty calculation and time validation depends on having
    a span for that header in the cache.
    battlmonstr authored Jan 15, 2024
    Configuration menu
    Copy the full SHA
    c5b75d0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fb0226d View commit details
    Browse the repository at this point in the history
  4. rpcdaemon: fix remote bor engine for trace transaction (erigontech#9214)

    This PR fixes the below error when running a remote rpcdaemon for
    Polygon debug_traceTransaction.
    
    Request:
    ```
    curl http://localhost:9545/ \
    -X POST \
    -H "Content-Type: application/json" \
    --data '{
      "jsonrpc": "2.0",
      "id": 0,
      "method": "debug_traceTransaction",
      "params": [
        "0xf265c04fc31c91eec9971e118f059322a910776ce40584114c351732ab01aec7",
        {
          "tracer": "callTracer",
          "borTraceEnabled": true,
          "borTx": true
        }
      ]
    }'
    ```
    
    Response:
    ```
    {"jsonrpc":"2.0","id":0,"result":null,"error":{"code":-32000,"message":"method handler crashed"}}
    ```
    
    Logs:
    ```
    EROR[01-11|18:45:14.087] RPC method debug_traceTransaction crashed: interface conversion: *cli.remoteConsensusEngine is not consensus.Engine: missing method APIs
    ```
    taratorio authored Jan 15, 2024
    Configuration menu
    Copy the full SHA
    a7d5b55 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f03d266 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cda48ae View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    79499b5 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2024

  1. polygon: flatten redundant packages (erigontech#9241)

    * move mocks to the owner packages
    * squash single file packages
    * move types to more appropriate files
    * remove unused mocks
    battlmonstr authored Jan 16, 2024
    Configuration menu
    Copy the full SHA
    2793ef6 View commit details
    Browse the repository at this point in the history
  2. p2p: panic in enode DB Close on shutdown (erigontech#9237) (erigontec…

    …h#9240)
    
    If any DB method is called while Close() is waiting for db.kv.Close()
    (it waits for ongoing method calls/transactions to finish)
    a panic: "WaitGroup is reused before previous Wait has returned" might
    happen.
    
    Use context cancellation to ensure that new method calls immediately
    return during db.kv.Close().
    battlmonstr authored Jan 16, 2024
    Configuration menu
    Copy the full SHA
    e979d79 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2024

  1. Configuration menu
    Copy the full SHA
    a1eee5e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26ce6aa View commit details
    Browse the repository at this point in the history
  3. qa tests: add clean exit test on block downloading (erigontech#9238)

    This test uses a pre-built database to test Erigon's behaviour on ctrl-c
    during the block download phase (Caplin sync).
    mriccobene authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    dd010bb View commit details
    Browse the repository at this point in the history
  4. ci: Use GITHUB_OUTPUT envvar instead of set-output command (erigontec…

    …h#9215)
    
    `save-state` and `set-output` commands used in GitHub Actions are
    deprecated and [GitHub recommends using environment
    files](https://github.blog/changelog/2023-07-24-github-actions-update-on-save-state-and-set-output-commands/).
    
    This PR updates the usage of `set-output` to `$GITHUB_OUTPUT`
    
    Instructions for envvar usage from GitHub docs:
    
    
    https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
    arunsathiya authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    e1195ba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e1a1c0c View commit details
    Browse the repository at this point in the history
  6. Update TestGoerliForkDigest after Dencun (erigontech#9251)

    Current fork digest for Görli has changed after the [Dencun
    upgrade](https://blog.ethereum.org/2024/01/10/goerli-dencun-announcement)
    on 17 Jan.
    yperbasis authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    8f6fe88 View commit details
    Browse the repository at this point in the history
  7. Implement PIP-33: Napoli Hardfork (erigontech#8975)

    Initial support of the upcoming Napoli hard fork on Polygon – see
    [PIP-33](https://forum.polygon.technology/t/pip-33-napoli-upgrade). Per
    [PIP-31](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-31.md),
    it parallels the
    [Cancun](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md)
    upgrade of Ethereum, but does not include
    [EIP-4788](https://eips.ethereum.org/EIPS/eip-4788),
    [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844),
    [EIP-7516](https://eips.ethereum.org/EIPS/eip-7516). In other words,
    Napoli includes [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153),
    [EIP-5656](https://eips.ethereum.org/EIPS/eip-5656),
    [EIP-6780](https://eips.ethereum.org/EIPS/eip-6780) from Cancun.
    
    This PR implements
    [PIP-31](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-31.md),
    [PIP-16: Transaction Dependency
    Data](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-16.md)
    (by merging `ParallelUniverseBlock` into `NapoliBlock`; the bulk of
    PIP-16 was implemented in PR erigontech#8037), and [PIP-27: Precompiled for
    secp256r1 Curve
    Support](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-27.md)
    ([EIP-7212](https://eips.ethereum.org/EIPS/eip-7212); see also
    maticnetwork/bor#1069 &
    ethereum/go-ethereum#27540).
    
    ---------
    
    Co-authored-by: Anshal Shukla <[email protected]>
    yperbasis and anshalshukla authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    b38e17e View commit details
    Browse the repository at this point in the history
  8. Move blob cache check in txpool (erigontech#9250)

    This should help with less frequent lock/unlock. Following from an
    earlier "TODO"
    somnathb1 authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    5e5d849 View commit details
    Browse the repository at this point in the history
  9. mdbx: race conditions in MdbxKV.Close (erigontech#8409) (erigontech#9244

    )
    
    In the previous code WaitGroup db.wg.Add(), Wait() and db.closed were
    not treated in sync. In particular, it was theoretically possible to
    first check closed, then set closed and Wait, and then call wg.Add()
    while waiting (leading to WaitGroup panic).
    In theory it was also possible that db.env.BeginTxn() is called on a
    closed or nil db.env, because db.wg.Add() was called only after BeginTxn
    (db.wg.Wait() could already return).
    
    WaitGroup is replaced with a Cond variable.
    Now it is not possible to increase the active transactions count on a
    closed database. It is also not possible to call BeginTxn on a closed
    database.
    battlmonstr authored Jan 17, 2024
    Configuration menu
    Copy the full SHA
    1914b52 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2024

  1. Configuration menu
    Copy the full SHA
    4abc6cd View commit details
    Browse the repository at this point in the history
  2. logs: remove "height=unknown" (erigontech#9261)

    "[EngineBlockDownloader] Downloading PoS headers... height=unknown"
    might be
    [confusing](https://discord.com/channels/687972960811745322/1001501454076477450/1197365760125841550)
    for users.
    yperbasis authored Jan 18, 2024
    Configuration menu
    Copy the full SHA
    3040e25 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2024

  1. Configuration menu
    Copy the full SHA
    4864674 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9af1499 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    81b9d4f View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Set initial gas limit in txpool

    This is a bit of a hack, and isn't how I'd like to see this change
    maintained.  But, it's also pretty simple/direct and unlikely to create
    conflicts, so going that way for the moment.
    jyellick committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    92e3dbe View commit details
    Browse the repository at this point in the history
  2. Suppress 'unwinding to previous canonical block'

    This message is spamming the log even when an unwind is not happening.
    This is because we forgot to check if we were not in the unwind path
    before printing.
    jyellick committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    168ef78 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f98041d View commit details
    Browse the repository at this point in the history
  4. Reduce diff slightly, merge conflicts less likely

    This simply pulls the 'Optimism' fields into their own section in a few
    structs.  This prevents realigning the rest of the fields and will
    hopefully reduce merge conflicts.
    jyellick committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    302e86f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    233a689 View commit details
    Browse the repository at this point in the history