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

Remp queue test1 #242

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
ef94a26
Remp message bodies broadcasts, initial release
Feb 1, 2024
52bea5a
Updated manifests, some midroad broadcast changes
Feb 2, 2024
e216167
Proper conversion of RmqMessage (temporary data structure for broadca…
Feb 2, 2024
beb4f2d
Fixed message bodies broadcasts
Feb 8, 2024
f4a7240
Polling and sending broadcasts
Feb 12, 2024
394efb4
Partial updating of message body/origin
Feb 12, 2024
1c1402a
Updated standalone node test
Feb 12, 2024
b92e454
Cosmetic improvement, method renaming
Feb 14, 2024
0363eec
Merge branch 'remp-big-messages' of github.com:tonlabs/ever-node into…
Feb 14, 2024
1d23374
Added remp tests
Feb 14, 2024
d64c0ba
Merged with updated master
Feb 14, 2024
34ae0b7
Better debugging info
Feb 15, 2024
4c0be2e
Cache and debug info improvements
Feb 21, 2024
c32e38e
Additional logs about broadcasts processing
Feb 21, 2024
558c40a
Added broadcast requests
Mar 5, 2024
1595751
Merged with 221 PR
Mar 6, 2024
e53ea81
Fixed infinite loop bug
Mar 11, 2024
b0fa099
Fixed bug - ignoring message if have body
Mar 12, 2024
6ab00dc
Fixed query incorrect reply bug
Mar 14, 2024
95e5ec3
Changed origin adnl_id to remp catchain source adnl_id
Mar 14, 2024
391c2c5
One more bugfix: adding local message body without broadcasts to loca…
Mar 15, 2024
58624e3
Merged with new master
Mar 18, 2024
a2567aa
Changed protocols, repaired tests
Mar 21, 2024
b643220
Updated to reflect new ever-tl library
Mar 26, 2024
82c0203
Merge branch 'master' of github.com:tonlabs/ever-node into remp-big-m…
Mar 26, 2024
cf70ea1
Advanced node version
Mar 26, 2024
2d72c17
Made remp config field nullable
Mar 26, 2024
fb7b81d
Added broadcast skipping if message is already known before Point 0
Mar 26, 2024
d979bcf
Removed senseless consistency checks
Mar 26, 2024
a6e4329
Updated tests, made engine/remp references Weak in remp_service
Apr 9, 2024
8beed5d
Merge branch 'master' of github.com:tonlabs/ever-node into remp-big-m…
Apr 9, 2024
83892c9
Fixed remp tests
Apr 9, 2024
977b29d
Updated remp_simple tests: messages/message bodies are now added sepa…
Apr 10, 2024
8d2e085
Merged and updated Cargo
Apr 11, 2024
9d1309e
Modified polling of new messages
Apr 11, 2024
94d212f
Fixed message cache bug: final to non-final status should be impossible
Apr 16, 2024
38f42f1
Merged with renamed master branch
Apr 22, 2024
cf236c2
Load cells from storing cells cache by id
Sumrachek Apr 23, 2024
6a93140
Merge branch 'master' into remp-big-messages
bvscd Apr 23, 2024
62061d1
Merge branch 'master' of github.com:tonlabs/ever-node into remp-big-m…
Apr 24, 2024
732b8da
Merge branch 'remp-big-messages' of github.com:tonlabs/ever-node into…
Apr 24, 2024
58a3be8
Merge branch 'fix-cells' into remp-big-messages
Sumrachek May 2, 2024
5fa7882
First version with collator queue interface
May 2, 2024
cd0a11d
Merge branch 'remp-big-messages' of github.com:tonlabs/ever-node into…
May 2, 2024
7d9b749
Changed UnixTime to SystemTime for message queue
May 2, 2024
422a106
Merging with the new master
May 2, 2024
7b1dd57
Integrated RempQueueCollatorInterface into collator
Sumrachek May 3, 2024
5d8c4a1
Changed collation behaviour, now it's Remp responsibility
May 7, 2024
f252e12
Fixed tests
May 7, 2024
4949902
Just a test
May 7, 2024
3b5965c
Debug print added
May 8, 2024
3d1399b
Additional debug message
May 8, 2024
6759aff
Remp network performance test
May 14, 2024
84df91a
Small optimization
May 14, 2024
73eddd9
Debug info improved
May 15, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.

## Version 0.58.4

- Load cells from storing cells cache by id
- Added support for due payment fix
- Bump block version

Expand Down
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ name = 'zerostate'
path = 'bin/zerostate.rs'

[dependencies]
adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/everx-labs/ever-adnl.git', tag = '0.10.24' }
arc-swap = '0.3.11'
async-recursion = '0.3.2'
async-trait = '0.1.22'
bitflags = '1.2.1'
catchain = { path = 'catchain' }
chrono = '=0.4.19'
clap = '2.33'
colored = '1.9.3'
Expand All @@ -58,12 +60,18 @@ deflate = '1.0.0'
dirs = '2.0.2'
enum-as-inner = '=0.5.1'
env_logger = '0.7.1'
ever_abi = { git = 'https://github.com/everx-labs/ever-abi.git', tag = '2.5.3' }
ever_block = { git = 'https://github.com/everx-labs/ever-block.git', tag = '1.10.2' }
ever_block_json = { git = 'https://github.com/everx-labs/ever-block-json.git', tag = '0.8.6' }
ever_executor = { git = 'https://github.com/everx-labs/ever-executor.git', tag = '1.17.6' }
ever_vm = { git = 'https://github.com/everx-labs/ever-vm.git', tag = '2.1.5' }
failure = '0.1'
futures = '0.3.1'
futures-timer = '3.0.1'
hex = '0.4'
inflate = '0.4.5'
lazy_static = '1.4.0'
lockfree = { git = 'https://github.com/everx-labs/lockfree.git' }
log = '0.4'
log4rs = '1.2'
log4rs-rolling-file = '0.2.0'
Expand All @@ -82,19 +90,11 @@ serde_json = '1.0.64'
shell-words = '1.0'
spin = '0.7.1'
statsd = { optional = true, version = '0.15' }
storage = { path = 'storage' }
stream-cancel = '0.8.0'
string-builder = '^0.2.0'
tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
tokio-util = '0.7'
adnl = { features = [ 'client', 'node', 'server' ], git = 'https://github.com/everx-labs/ever-adnl.git', tag = '0.10.24' }
catchain = { path = 'catchain' }
ever_abi = { git = 'https://github.com/everx-labs/ever-abi.git', tag = '2.5.3' }
ever_block = { git = 'https://github.com/everx-labs/ever-block.git', tag = '1.10.2' }
ever_block_json = { git = 'https://github.com/everx-labs/ever-block-json.git', tag = '0.8.6' }
ever_executor = { git = 'https://github.com/everx-labs/ever-executor.git', tag = '1.17.6' }
ever_vm = { git = 'https://github.com/everx-labs/ever-vm.git', tag = '2.1.5' }
lockfree = { git = 'https://github.com/everx-labs/lockfree.git' }
storage = { path = 'storage' }
ton_api = { git = 'https://github.com/everx-labs/ever-tl.git', package = 'ton_api', tag = '0.3.79' }
validator_session = { path = 'validator-session' }

Expand Down
6 changes: 3 additions & 3 deletions catchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ name = 'catchain'
version = '0.1.0'

[dependencies]
adnl = { features = [ 'node' ], git = 'https://github.com/everx-labs/ever-adnl.git', tag = '0.10.24' }
chrono = '0.4.10'
crossbeam = '0.7.3'
ever_block = { git = 'https://github.com/everx-labs/ever-block.git', tag = '1.10.2' }
failure = '0.1'
futures = '0.3.4'
hex = '0.4'
Expand All @@ -18,10 +20,8 @@ metrics-util = '0.15.0'
quanta = '0.11.1'
rand = '0.8'
regex = '1.3.1'
tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
adnl = { features = [ 'node' ], git = 'https://github.com/everx-labs/ever-adnl.git', tag = '0.10.24' }
ever_block = { git = 'https://github.com/everx-labs/ever-block.git', tag = '1.10.2' }
storage = { path = '../storage' }
tokio = { features = [ 'rt-multi-thread' ], version = '1.5' }
ton_api = { git = 'https://github.com/everx-labs/ever-tl.git', package = 'ton_api', tag = '0.3.79' }

[dev-dependencies]
Expand Down
29 changes: 1 addition & 28 deletions src/collator_test_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use storage::StorageTelemetry;
use ever_block::{
BlockIdExt, Message, ShardIdent, Serializable, MerkleUpdate, Deserializable,
ValidatorBaseInfo, BlockSignaturesPure, BlockSignatures, HashmapAugType,
TopBlockDescrSet, GlobalCapabilities, OutMsgQueue,
TopBlockDescrSet, OutMsgQueue,
};
use ever_block::{ShardStateUnsplit, TopBlockDescr};
use ever_block::{UInt256, fail, error, Result, CellType, read_boc, read_single_root_boc};
Expand Down Expand Up @@ -1208,19 +1208,6 @@ impl CollatorTestBundle {

pub fn candidate(&self) -> Option<&BlockCandidate> { self.candidate.as_ref() }
pub fn set_notes(&mut self, notes: String) { self.index.notes = notes }

fn get_messages(&self, remp: bool) -> Result<Vec<(Arc<Message>, UInt256)>> {
let remp_enabled = self.states
.get(&self.index.last_mc_state)
.ok_or_else(|| error!("Can't load last ms block to read config"))?
.config_params()?.has_capability(GlobalCapabilities::CapRemp);

if remp_enabled == remp {
Ok(self.external_messages.clone())
} else {
Ok(vec!())
}
}
}

// Is used instead full node's engine for run tests
Expand Down Expand Up @@ -1346,20 +1333,6 @@ impl EngineOperations for CollatorTestBundle {
&self.allocated
}

fn get_remp_messages(&self, _shard: &ShardIdent) -> Result<Vec<(Arc<Message>, UInt256)>> {
self.get_messages(true)
}

fn finalize_remp_messages(
&self,
_block: BlockIdExt,
_accepted: Vec<UInt256>,
_rejected: Vec<(UInt256, String)>,
_ignored: Vec<UInt256>,
) -> Result<()> {
Ok(())
}

async fn check_remp_duplicate(&self, _message_id: &UInt256) -> Result<RempDuplicateStatus> {
Ok(RempDuplicateStatus::Fresh(UInt256::default()))
}
Expand Down
10 changes: 6 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ pub struct TonNodeConfig {
port: Option<u16>,
#[serde(skip)]
file_name: String,
#[serde(default = "RempConfig::default")]
remp: RempConfig,
remp: Option<RempConfig>,
#[serde(default)]
restore_db: bool,
#[serde(default)]
Expand Down Expand Up @@ -599,8 +598,11 @@ impl TonNodeConfig {
pub fn extensions(&self) -> &NodeExtensions {
&self.extensions
}
pub fn remp_config(&self) -> &RempConfig {
&self.remp
pub fn remp_config(&self) -> RempConfig {
match &self.remp {
Some(x) => x.clone(),
None => RempConfig::default()
}
}
pub fn restore_db(&self) -> bool {
self.restore_db
Expand Down
13 changes: 0 additions & 13 deletions src/engine_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,18 +990,6 @@ impl EngineOperations for Engine {
fn new_remp_message(&self, id: UInt256, message: Arc<Message>) -> Result<()> {
self.remp_messages()?.new_message(id, message)
}
fn get_remp_messages(&self, shard: &ShardIdent) -> Result<Vec<(Arc<Message>, UInt256)>> {
self.remp_messages()?.get_messages(shard)
}
fn finalize_remp_messages(
&self,
block: BlockIdExt,
accepted: Vec<UInt256>,
rejected: Vec<(UInt256, String)>,
ignored: Vec<UInt256>,
) -> Result<()> {
self.remp_messages()?.finalize_messages(block, accepted, rejected, ignored)
}
fn finalize_remp_messages_as_ignored(&self, block_id: &BlockIdExt)
-> Result<()> {
self.remp_messages()?.finalize_remp_messages_as_ignored(block_id)
Expand All @@ -1013,7 +1001,6 @@ impl EngineOperations for Engine {
async fn check_remp_duplicate(&self, message_id: &UInt256) -> Result<RempDuplicateStatus> {
self.remp_service()
.ok_or_else(|| error!("Can't get message status because remp service was not set"))?
.remp_core_interface()?
.check_remp_duplicate(message_id)
}

Expand Down
24 changes: 11 additions & 13 deletions src/engine_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,6 @@ pub trait EngineOperations : Sync + Send {
fn new_remp_message(&self, id: UInt256, message: Arc<Message>) -> Result<()> {
unimplemented!()
}
fn get_remp_messages(&self, shard: &ShardIdent) -> Result<Vec<(Arc<Message>, UInt256)>> {
unimplemented!()
}
fn finalize_remp_messages(
&self,
block: BlockIdExt,
accepted: Vec<UInt256>,
rejected: Vec<(UInt256, String)>,
ignored: Vec<UInt256>,
) -> Result<()> {
unimplemented!()
}
fn finalize_remp_messages_as_ignored(&self, block_id: &BlockIdExt) -> Result<()> {
unimplemented!()
}
Expand Down Expand Up @@ -968,6 +956,16 @@ pub enum RempDuplicateStatus {

#[async_trait::async_trait]
pub trait RempCoreInterface: Sync + Send {
async fn process_incoming_message(&self, message_id: UInt256, message: Message, source: Arc<KeyId>) -> Result<()>;
async fn process_incoming_message(&self, message: &RempMessage, source: Arc<KeyId>) -> Result<()>;
fn check_remp_duplicate(&self, message_id: &UInt256) -> Result<RempDuplicateStatus>;
}

#[async_trait::async_trait]
pub trait RempQueueCollatorInterface : Send + Sync {
async fn init_queue(
&self,
master_block_id: &BlockIdExt,
prev_blocks_ids: &[&BlockIdExt]
) -> Result<()>;
async fn get_next_message_for_collation(&self) -> Result<Option<(Arc<Message>, UInt256)>>;
}
7 changes: 4 additions & 3 deletions src/ext_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MESSAGE_LIFETIME: u32 = 600; // seconds
const MESSAGE_MAX_GENERATIONS: u8 = 3;

const MAX_EXTERNAL_MESSAGE_DEPTH: u16 = 512;
const MAX_EXTERNAL_MESSAGE_SIZE: usize = 65535;
pub const MAX_EXTERNAL_MESSAGE_SIZE: usize = 65535;

pub const EXT_MESSAGES_TRACE_TARGET: &str = "ext_messages";

Expand Down Expand Up @@ -460,6 +460,7 @@ pub fn is_finally_accepted(status: &RempMessageStatus) -> bool {
}
}

// To be deleted
pub struct RempMessagesPool {
messages: Map<UInt256, Arc<Message>>,
statuses_queue: lockfree::queue::Queue<(UInt256, Arc<Message>, RempMessageStatus)>,
Expand All @@ -483,7 +484,7 @@ impl RempMessagesPool {

// Important! If call get_messages with same shard two times in row (without finalize_messages between)
// the messages returned first call will return second time too.
pub fn get_messages(&self, shard: &ShardIdent) -> Result<Vec<(Arc<Message>, UInt256)>> {
/*pub fn get_messages(&self, shard: &ShardIdent) -> Result<Vec<(Arc<Message>, UInt256)>> {
let mut result = vec!();
let mut ids = String::new();
for guard in self.messages.iter() {
Expand All @@ -506,7 +507,7 @@ impl RempMessagesPool {
);

Ok(result)
}
}*/

pub fn finalize_messages(
&self,
Expand Down
5 changes: 3 additions & 2 deletions src/tests/test_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,11 +697,12 @@ impl TestEngine {
extra.created_by().clone(),
self.clone(),
Some(extra.rand_seed().clone()),
None,
CollatorSettings::default(),
)?;

let (block_candidate, new_state) = collator.collate().await?;
let (block_candidate, new_state) = collator.collate().await?;

if let Some(res_path) = &self.res_path {

let new_block = Block::construct_from_bytes(&block_candidate.data)?;
Expand Down
Loading