-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: dev
Are you sure you want to change the base?
Transaction queue #247
Conversation
ablax
commented
Nov 22, 2023
- Create transaction pool
- Create transaction queue
- Prepare for transaction validation
# Conflicts: # src/main/java/com/limechain/network/protocol/transaction/TransactionsEngine.java
@@ -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[]{}) |
There was a problem hiding this comment.
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
src/main/java/com/limechain/network/protocol/transaction/state/TransactionState.java
Outdated
Show resolved
Hide resolved
src/main/java/com/limechain/network/protocol/transaction/state/TransactionState.java
Outdated
Show resolved
Hide resolved
src/main/java/com/limechain/network/protocol/transaction/state/ValidTransaction.java
Outdated
Show resolved
Hide resolved
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@NoArgsConstructor |
There was a problem hiding this comment.
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.
public ValidTransaction(byte[] extrinsic){ | ||
this.extrinsic = extrinsic; | ||
} | ||
|
||
public ValidTransaction(byte[] extrinsic, Validity validity){ | ||
this.extrinsic = extrinsic; | ||
this.validity = validity; | ||
} |
There was a problem hiding this comment.
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 {
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; | ||
} | ||
} |
There was a problem hiding this comment.
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
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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
Quality Gate passedIssues Measures |