Skip to content

Initial Handshake Implementation#7

Open
AcoSmrkas wants to merge 6 commits intorosen-bridge:devfrom
AcoSmrkas:handshake
Open

Initial Handshake Implementation#7
AcoSmrkas wants to merge 6 commits intorosen-bridge:devfrom
AcoSmrkas:handshake

Conversation

@AcoSmrkas
Copy link
Copy Markdown

Implementation following RCS-003 - https://github.com/rosen-bridge/rcs/tree/master/rcs-003

Comment thread config/default.yaml Outdated
Comment on lines +160 to +162
handshakeScanner:
warnDifference: 2 # warning difference between existing and scanned blocks height
criticalDifference: 10 # critical difference between existing and scanned blocks height
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Please remove these configs.

Comment thread src/config/config.ts Outdated
'observation.confirmation'
);
const blockTime = {
const blockTimeByNetwork: Record<NetworkType, number> = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Revert this change (please avoid unnecessary changes). Adding the new record is sufficient here.

Comment thread src/config/config.ts Outdated
Comment on lines +737 to +738
handshakeScannerWarnDiff: number;
handshakeScannerCriticalDiff: number;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Please remove these 2 variables.

Comment thread src/utils/healthCheck.ts Outdated
Comment on lines +223 to +224
let scannerWarnDiff = currentConfig.healthCheck.scannerWarnDiff;
let scannerCriticalDiff = currentConfig.healthCheck.scannerCriticalDiff;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Please remove these two.

Comment thread src/utils/scanner.ts
Comment on lines +193 to +196
await CreateScanner.instance.createHandshakeScanner(
handshakeConfig,
rosenConfig
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Please pass config.observationStoreRawData to it:

Suggested change
await CreateScanner.instance.createHandshakeScanner(
handshakeConfig,
rosenConfig
);
await CreateScanner.instance.createHandshakeScanner(
handshakeConfig,
rosenConfig,
config.observationStoreRawData
);

Comment thread src/utils/scanner.ts Outdated
Comment on lines +632 to +648
rosenConfig: RosenConfig
) => {
if (!this.observationScanner) {
if (handshakeConfig.rpc) {
this.observationScanner = new HandshakeRpcScanner({
dataSource,
initialHeight: handshakeConfig.initialHeight,
network: createHandshakeRpcNetworkConnectorManager(),
logger: loggers.observationScannerLogger,
});

const observationExtractor = new HandshakeRpcObservationExtractor(
rosenConfig.lockAddress,
dataSource,
TokensConfig.getInstance().getTokenMap(),
loggers.observationExtractorLogger
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Following my previous comment, please add it here too.

Suggested change
rosenConfig: RosenConfig
) => {
if (!this.observationScanner) {
if (handshakeConfig.rpc) {
this.observationScanner = new HandshakeRpcScanner({
dataSource,
initialHeight: handshakeConfig.initialHeight,
network: createHandshakeRpcNetworkConnectorManager(),
logger: loggers.observationScannerLogger,
});
const observationExtractor = new HandshakeRpcObservationExtractor(
rosenConfig.lockAddress,
dataSource,
TokensConfig.getInstance().getTokenMap(),
loggers.observationExtractorLogger
);
rosenConfig: RosenConfig,
observationStoreRawData: boolean
) => {
if (!this.observationScanner) {
if (handshakeConfig.rpc) {
this.observationScanner = new HandshakeRpcScanner({
dataSource,
initialHeight: handshakeConfig.initialHeight,
network: createHandshakeRpcNetworkConnectorManager(),
logger: loggers.observationScannerLogger,
});
const observationExtractor = new HandshakeRpcObservationExtractor(
rosenConfig.lockAddress,
dataSource,
TokensConfig.getInstance().getTokenMap(),
loggers.observationExtractorLogger,
observationStoreRawData
);

Comment thread .gitignore Outdated
@@ -1,3 +1,4 @@
src/config/*.json
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Please revert this change.

Comment thread src/utils/scanner.ts
Comment on lines +34 to +35
import { HandshakeRpcObservationExtractor } from '@rosen-bridge/handshake-observation-extractor';
import { HandshakeRpcScanner } from '@rosen-bridge/handshake-scanner';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 Required Change

Seems you've forgot to install these two packages (they should be included in package.json file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants