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

*: support extra dBFT stage #118

Merged
merged 16 commits into from
Aug 1, 2024
Merged

*: support extra dBFT stage #118

merged 16 commits into from
Aug 1, 2024

Commits on Jul 17, 2024

  1. internal: move tx64 to internal/consensus package

    It will be reused by anti-MEV related dBFT interfaces implementations.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    377942e View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. *: support extra dBFT stage

    Ref. #112.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    eea3ee4 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. *: add testing infrastructure for Anti-MEV dBFT extension

    Add custom PreBlock and Block interfaces implementation, custom Commit
    and CommitAck, adjust testing logic.
    
    Signed-off-by: Anna Shaleva <[email protected]>
    AnnaShaleva authored and roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    6592d82 View commit details
    Browse the repository at this point in the history
  2. dbft: don't react on transactions if PreCommit or Commit sent

    Technically, this is implied by d.ResponseSent(), but we still have BlockSent()
    check as well, so these don't hurt.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    ea7cfc6 View commit details
    Browse the repository at this point in the history
  3. dbft: remove redundant index check

    It's done at the start of OnReceive() and it's even more strict there.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    51cab0b View commit details
    Browse the repository at this point in the history
  4. dbft: raise PrepareRequest sender mismatch log to Info

    It's a security event, this should never happen and we better know if it does.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    ff190eb View commit details
    Browse the repository at this point in the history
  5. dbft: drop "empty PrepareRequest" log

    It's useless, we log tx number down below anyway.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    b5bef38 View commit details
    Browse the repository at this point in the history
  6. dbft: fix commit checking with AMEV enabled

    Commit payloads can't be checked with PrepareRequest data only in AMEV case,
    we don't yet have a complete header. So check them after we have enough
    PreCommit payloads.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    752f616 View commit details
    Browse the repository at this point in the history
  7. dbft: reduce cyclomatic complexity of on[Pre]Commit()

    Be a bit more optimistic about the message (similar to how onPrepareResponse()
    works).
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    3a9f202 View commit details
    Browse the repository at this point in the history
  8. context: reset preBlockProcessed properly

    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    1bce289 View commit details
    Browse the repository at this point in the history
  9. context: define preBlockProcessed, make it fire only once

    Supposedly AMEV code will do its magic here and it doesn't need to do it twice.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    aa532ae View commit details
    Browse the repository at this point in the history
  10. preblock: drop Hash()

    For a single height/view there is a single proper hash and it's not a final
    block hash, likely logging it won't help much. Can be done in future if needed,
    but let's have view number for now.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    53fb1ea View commit details
    Browse the repository at this point in the history
  11. recovery: add PreCommit support

    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    e2e3d08 View commit details
    Browse the repository at this point in the history
  12. dbft: extend single node test with AMEV

    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    799ce0e View commit details
    Browse the repository at this point in the history
  13. dbft: add caching support for precommits

    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    f123518 View commit details
    Browse the repository at this point in the history
  14. dbft: make future message cache work properly, add a test

    start() was designed to be called at every view change, but looks like it
    _never_ worked this way. Which means two things:
     * on every view change Primary doesn't send PrepareRequest during
       initialization (which is mostly OK, OnTimeout() will be triggered
       immediately with 0 timeout)
     * our future message caching system has never really worked since start() is
       the only place where messages can be picked up from it
    
    Just drop start(), make caches work and add a test for them.
    
    Signed-off-by: Roman Khimov <[email protected]>
    roman-khimov committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    2fca051 View commit details
    Browse the repository at this point in the history