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

Missing F08 max packet amount metadata #660

Open
kincaidoneil opened this issue Jun 8, 2020 · 3 comments
Open

Missing F08 max packet amount metadata #660

kincaidoneil opened this issue Jun 8, 2020 · 3 comments
Labels
bug v1.0 Features to be fixed for a 1.0 release

Comments

@kincaidoneil
Copy link

return sourceAccountSettings.maximumPacketAmount()
// if Packet amount is greater-than `maxPacketAmount`, then Reject.
.filter(maxPacketAmount -> sourcePreparePacket.getAmount().compareTo(maxPacketAmount) > 0)
.map(maxPacketAmount -> {
logger.error(
"Rejecting packet for exceeding max amount. accountId={} maxAmount={} actualAmount={}",
sourceAccountSettings.accountId(), maxPacketAmount, sourcePreparePacket.getAmount()
);
return (InterledgerResponsePacket) packetRejector.reject(
LinkId.of(sourceAccountSettings.accountId().value()),
sourcePreparePacket,
InterledgerErrorCode.F08_AMOUNT_TOO_LARGE,
String.format(
"Packet size too large: maxAmount=%s actualAmount=%s", maxPacketAmount,
sourcePreparePacket.getAmount())
);
})
// Otherwise, the packet amount is fine...
.orElseGet(() -> filterChain.doFilter(sourceAccountSettings, sourcePreparePacket));

Release v0.5 does appear to return any metadata in F08s; I imagine this could cause issues for legacy STREAM senders paying into it.

(My sender performs a binary search and was still able to precisely discover the max packet amount in this case 😉)

@sappenin
Copy link
Collaborator

sappenin commented Jun 9, 2020

Can you clarify what you mean by meta-data here?

@kincaidoneil
Copy link
Author

kincaidoneil commented Jun 9, 2020

Encoding the received amount and max packet amount into the data portion of the Reject packet: #260, hyperledger-archives/quilt#186

@sappenin
Copy link
Collaborator

sappenin commented Jun 9, 2020

Oh nice - my bad. Good catch!

@sappenin sappenin added the bug label Sep 3, 2020
@sappenin sappenin added this to To do in v0.6 (Cleanup + bugs) Sep 3, 2020
@sappenin sappenin added the v1.0 Features to be fixed for a 1.0 release label Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v1.0 Features to be fixed for a 1.0 release
Projects
Development

No branches or pull requests

2 participants