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

[authority sync] Provide an interface for explorers to sync with single authority #509

Merged
merged 36 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f295ff4
Added tables for execution sequence and blocks
Feb 21, 2022
fd9fedc
Added architecture skeleton
Feb 21, 2022
12584a9
Rename to batch
Feb 22, 2022
9bacf5e
FMT
Feb 22, 2022
8ae557a
Added batch db open logic, and tests
Feb 22, 2022
fe359d9
Rename block to batch in code and comments
Feb 22, 2022
864ca6f
Batch logic and tests
Feb 22, 2022
fed3e4b
Appease clippy & fmt
Feb 22, 2022
9c3ba3e
Add out of order test
Feb 22, 2022
2dbead9
Logic to fix the database
Feb 22, 2022
f5477e2
Remove unused error
Feb 22, 2022
3a13f05
Rename test
Feb 22, 2022
99e3599
Added comments
Feb 22, 2022
dbdf817
Make fmt happy
Feb 22, 2022
0adec15
Minor changes
Feb 23, 2022
01d6172
Define clean consutructors
Feb 23, 2022
49a3a45
Clean Licence
Feb 23, 2022
01776c9
Integrations of batch listener into authority & tests
Feb 23, 2022
bd62573
Make fmt & clippy happy
Feb 23, 2022
060c85b
Move from usize to u64 for seq numbers
Feb 24, 2022
2ede6ea
Make fmt / clippy happy
Feb 24, 2022
a086b7f
Do not add genesis to transaction sequence
Mar 1, 2022
3d1c3cb
Updated from review comments
Mar 1, 2022
a76a810
Remove confusing comment
Mar 1, 2022
945942d
Added hashes to batches
Mar 2, 2022
eae08cd
Updated names to Batch(-er)
Mar 2, 2022
a1f4ca6
Make fmt happy
Mar 2, 2022
ba2ef2a
Created structures for signed batches
Mar 2, 2022
775c5de
Handle SignedBatches instead of Batches
Mar 2, 2022
03cee3c
Remove pub from file
Mar 2, 2022
afcba11
Appease clippy
Mar 2, 2022
1e09d11
Turn on format test and do fmt
Mar 2, 2022
6b7ae14
Use TxSequenceNumber
Mar 3, 2022
bd63cb0
Allow gaps in the sequence + simplify
Mar 3, 2022
3992943
Updated structures
Mar 3, 2022
3c94310
Fixed clippy on incoming?
Mar 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename to batch
  • Loading branch information
George Danezis committed Mar 3, 2022
commit 12584a983303f594cfdfcb8bd81c3daf45f6bfad
6 changes: 4 additions & 2 deletions sui_core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ mod authority_store;
pub use authority_store::AuthorityStore;



// based on https://github.com/diem/move/blob/62d48ce0d8f439faa83d05a4f5cd568d4bfcb325/language/tools/move-cli/src/sandbox/utils/mod.rs#L50
const MAX_GAS_BUDGET: u64 = 18446744073709551615 / 1000 - 1;

mod authority_blocks;
pub use authority_blocks::AuthorityBlock;
mod authority_batch;
pub use authority_batch::AuthorityBatch;


/// a Trait object for `signature::Signer` that is:
/// - Pin, i.e. confined to one place in memory (we don't want to copy private keys).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,47 @@ use super::*;

/*

An authority asynchronously creates blocks from its sequence of
certificates / effects. Then both the sequence of certificates
An authority asynchronously creates blocks from its sequence of
certificates / effects. Then both the sequence of certificates
/ effects are transmitted to listeners (as a transaction digest)
as well as blocks.

The architecture is as follows:
- The authority store notifies through the Sender that a new
- The authority store notifies through the Sender that a new
certificate / effect has been sequenced, at a specific sequence
number.
- The sender sends this information through a channel to the Manager,
that decides whether a new block should be made. This is based on
time elapsed as well as current size of block. If so a new block
time elapsed as well as current size of block. If so a new block
is created.
- The authority manager also holds the sending ends of a number of
- The authority manager also holds the sending ends of a number of
channels that eventually go to clients that registered interest
in receiving all updates from the authority. When a new item is
sequenced of a block created this is sent out to them.

*/


/// Either a freshly sequenced transaction hash or a block
pub struct UpdateItem { }
pub struct UpdateItem {}

pub struct Sender { }
pub struct Manager { }
pub struct Sender {}
pub struct Manager {}

impl Sender {
/// Send a new event to the block manager
pub fn sequenced_item() { }
pub fn sequenced_item() {}
}

impl Manager {
/// Starts the manager service / tokio task
pub fn start_service() { }
pub fn start_service() {}

/// Register a sending channel used to send streaming
/// updates to clients.
pub fn register_listener() { }
pub fn register_listener() {}
}


pub struct AuthorityBlock {
pub struct AuthorityBatch {
/// The total number of items executed by this authority.
total_size: usize,

Expand Down
2 changes: 1 addition & 1 deletion sui_core/src/authority/authority_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct AuthorityStore {
executed_sequence: DBMap<usize, TransactionDigest>,

/// A sequence of blocks indexing into the sequence of executed transactions.
blocks: DBMap<usize, AuthorityBlock>,
blocks: DBMap<usize, AuthorityBatch>,

/// The size of the executed transactions sequence, used to timestamp the next
/// item in the sequence.
Expand Down