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

Transaction queue #247

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open

Transaction queue #247

wants to merge 22 commits into from

Conversation

ablax
Copy link
Member

@ablax ablax commented Nov 22, 2023

  • Create transaction pool
  • Create transaction queue
  • Prepare for transaction validation

@@ -126,7 +142,9 @@ public void writeHandshakeToStream(Stream stream, PeerId peerId) {
public void writeTransactionsMessage(Stream stream, PeerId peerId) {
ByteArrayOutputStream buf = new ByteArrayOutputStream();
try (ScaleCodecWriter writer = new ScaleCodecWriter(buf)) {
writer.write(new TransactionsWriter(), new byte[][]{new byte[]{}, new byte[]{}});
writer.write(new TransactionsWriter(), new Extrinsics[]{
new Extrinsics(new byte[]{}), new Extrinsics(new byte[]{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Add TODO to replace empty transaction messages in future

import java.util.HashMap;
import java.util.Map;

@NoArgsConstructor
Copy link
Member

Choose a reason for hiding this comment

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

No arg constructor is implied if no other constructor is found.

Comment on lines 15 to 22
public ValidTransaction(byte[] extrinsic){
this.extrinsic = extrinsic;
}

public ValidTransaction(byte[] extrinsic, Validity validity){
this.extrinsic = extrinsic;
this.validity = validity;
}
Copy link
Member

Choose a reason for hiding this comment

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

space before opening curly brace {

Comment on lines 14 to 24
public class Validity {
private BigInteger priority;
private byte[][] requires;
private byte[][] provides;
private BigInteger longevity;
private boolean propagate;

public Validity(BigInteger priority){
this.priority = priority;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment explaining what this class represents and how the priority works. If I have priority 1 and someone else has 18, am I with a higher priority or not? Also how are the negative cases handled? Would be nice to have a test for that case as well.

# Conflicts:
#	src/main/java/com/limechain/network/protocol/transaction/TransactionsEngine.java
Copy link

sonarcloud bot commented Nov 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ablax
Copy link
Member Author

ablax commented Jan 19, 2024

Currently blocked, as it depends on Trie

# Conflicts:
#	src/main/java/com/limechain/network/protocol/transaction/TransactionsEngine.java
# Conflicts:
#	src/main/java/com/limechain/rpc/server/RpcApp.java
#	src/main/java/com/limechain/runtime/RuntimeEndpoint.java
Copy link

sonarcloud bot commented Oct 17, 2024

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.

P2P communication: Set up Kademlia DHT running in the web
5 participants