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

Documents to the function (irishandler) #3

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

shawayush
Copy link

Still working on it, will commit as soon as wrote more about those.

@@ -256,6 +256,7 @@ func (sc *SecretConnection) SetWriteDeadline(t time.Time) error {
return sc.conn.(net.Conn).SetWriteDeadline(t)
}

// genEphKeys generates Ephemeral key-pair
Copy link
Owner

Choose a reason for hiding this comment

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

This is a library imported from tendermint itself. No need to put commnts support here.

@@ -93,6 +98,10 @@ func RunDataConnect(peerAddr string,
}
}

// dialPeer will check if the Peer has dialed succesfully or not,
// This function is used RunDataConnect, if there are errors
Copy link
Owner

Choose a reason for hiding this comment

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

don't mention caller

@@ -103,6 +112,10 @@ func (h *TendermintHandler) dialPeer() error {
return nil
}

// acceptPeer will check the if the Peer has connected succesfully
// or not, this function is used in RunDataConnect, if there are
Copy link
Owner

Choose a reason for hiding this comment

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

dont mention caller

@@ -120,6 +133,10 @@ func (h *TendermintHandler) acceptPeer() error {
return nil
}

// upgradeConnectionAndHandshake checks if there has been a secret
Copy link
Owner

Choose a reason for hiding this comment

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

rephrase. It ESTABLISHES, not CHECKS

@@ -138,6 +155,12 @@ func (h *TendermintHandler) upgradeConnectionAndHandshake() error {
return nil
}

// handshake function follows the protocol set on amino spec,
// MarshalBinaryLengthPrefixed encodes the object according to the Amino spec
Copy link
Owner

Choose a reason for hiding this comment

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

don't mention exact amino codec setup. We just need to know that how handshake happens

@@ -215,6 +240,13 @@ func (h *TendermintHandler) beginServicing() error {
return nil
}

// Datas are recived by TM Core
// sendRoutine sends PING and PONG message to TM Core
// case h.p2pConnection.pingTimer.C: Sends PING messages to TM Core
Copy link
Owner

Choose a reason for hiding this comment

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

cases are bad in comments, not needed. Mention agenda, not code.

@@ -183,6 +206,8 @@ func (h *TendermintHandler) handshake() error {
return nil
}

// forms a P2P connection with the registered node
// sends and recives routines accordingly
Copy link
Owner

Choose a reason for hiding this comment

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

wrong... it "services" the TM core and not forms the connection...

@@ -643,6 +682,8 @@ func (c *P2PConnection) stopPongTimer() {
// ---------------------- SPAM FILTER INTERFACE --------------------------------

// RunSpamFilter serves as the entry point for a TM Core handler when serving as a spamfilter
// This function also acts as filter at the very begining of the TM Core, spam filter depends
Copy link
Owner

Choose a reason for hiding this comment

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

wrong!. spamfilter is completely different mode. Number of spam filter is wrong. it is number of worker goroutines spawned

@@ -764,6 +809,8 @@ func (h *TendermintHandler) beginServicingSpamFilter(id int) {
}
}

// thoroughMessageCheck is used in beginServicingSpamFilter.
// thoroughMessageCheck verify the Messages from the Marlin Relay
Copy link
Owner

Choose a reason for hiding this comment

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

wrong

Copy link
Author

Choose a reason for hiding this comment

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

Can you tell, What would be the correct Statement here!

@@ -670,6 +711,10 @@ func RunSpamFilter(rpcAddr string,
handler.throughput.presentThroughput(5, handler.signalShutThroughput)
}

// Spam Filter executions begins from beginServicingSpamFilter
// this function will check for all possible spam from TM Core.
Copy link
Owner

Choose a reason for hiding this comment

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

not from TMCore. Spam is always checked at ingress point of marlin relay

@@ -853,6 +903,12 @@ func (h *TendermintHandler) getValidators(height int64) ([]Validator, bool) {
}
}

// spamVerdictMessage used in beginServicingSpamFilter. This function
// is used to store Messages of Marlin and even return the Boolean value
Copy link
Owner

Choose a reason for hiding this comment

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

store messages? it just gives out signal to either allow or deny messages

@@ -876,6 +932,7 @@ var isKeyFileUsed, memoized bool
var keyFileLocation string
var privateKey ed25519.PrivKeyEd25519

//Generates privatekey and publickey
Copy link
Owner

Choose a reason for hiding this comment

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

ED25519 Keypair

@@ -971,7 +1031,7 @@ func getPrivateKey() ed25519.PrivKeyEd25519 {

// ---------------------- COMMON UTILITIES ---------------------------------


//Creates Tendermint Handler between Marlin Relay and TM Core
Copy link
Owner

Choose a reason for hiding this comment

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

creates between relay and TM core? no really... it just creates a handler object

@@ -1028,7 +1089,8 @@ func (t *throughPutData) putInfo(direction string, key string, count uint32) {
}
t.mu.Unlock()
}

// This function display the logs/stats of marlin to
Copy link
Owner

Choose a reason for hiding this comment

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

not related to marlinTo and marlinFrom actually

@@ -120,6 +129,8 @@ type ConsensusMessage interface {
ValidateBasic() error
}

// RegisterConsensusMessages registers the Consensus Messages
Copy link
Owner

Choose a reason for hiding this comment

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

between tendermint and consensus layer? consensus layer is in tendermint

Copy link
Owner

@supragya supragya left a comment

Choose a reason for hiding this comment

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

Kindly resolve issues, comments are mostly not correct, with incorrect descriptions and consistency.

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