Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test-rollups-echo: build-rust-workspace
test-rollups-honeypot: build-rust-workspace
just -f ./prt/tests/rollups/justfile test-honeypot-all
test-rollups-honeypot-ci: build-rust-workspace
just -f ./prt/tests/rollups/justfile test-honeypot-ci
GAS_LIMIT=15000000 just -f ./prt/tests/rollups/justfile test-honeypot-ci
test-rollups-honeypot-case CASE: build-rust-workspace
just -f ./prt/tests/rollups/justfile test-honeypot-case {{CASE}}
view-rollups-logs:
Expand Down
21 changes: 11 additions & 10 deletions prt/client-rs/core/src/tournament/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,17 @@ impl ArenaSender for EthArenaSender {
new_right_node: Digest,
) -> Result<()> {
let tournament = tournament::Tournament::new(tournament, &self.provider);
let tx_result = tournament
.advanceMatch(
match_id.into(),
left_node.into(),
right_node.into(),
new_left_node.into(),
new_right_node.into(),
)
.send()
.await;
let mut call = tournament.advanceMatch(
match_id.into(),
left_node.into(),
right_node.into(),
new_left_node.into(),
new_right_node.into(),
);
if let Some(limit) = std::env::var("GAS_LIMIT").ok().and_then(|v| v.parse().ok()) {
call = call.gas(limit);
}
let tx_result = call.send().await;
allow_revert_rethrow_others("advanceMatch", tx_result).await
}

Expand Down
4 changes: 2 additions & 2 deletions prt/contracts/src/tournament/Tournament.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ contract Tournament is ITournament {
Time.Instant lastMatchDeleted;

uint256 constant MAX_GAS_PRICE = 50 gwei;
uint256 constant MESSAGE_SENDER_PROFIT = 10 gwei;
uint256 constant PRIORITY_FEE_CAP = 10 gwei;
bool transient locked;

mapping(Tree.Node => Clock.State) clocks;
Expand Down Expand Up @@ -952,7 +952,7 @@ contract Tournament is ITournament {
address(this).balance,
bondValue() * gasEstimate / _totalGasEstimate(),
(Gas.TX + gasBefore - gasAfter)
* (tx.gasprice + MESSAGE_SENDER_PROFIT)
* tx.gasprice.min(block.basefee + PRIORITY_FEE_CAP)
);

(bool status, bytes memory ret) =
Expand Down
2 changes: 1 addition & 1 deletion prt/contracts/src/tournament/libs/Gas.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pragma solidity ^0.8.17;

library Gas {
uint256 constant TX = 21000;
uint256 constant TX = 25000;

uint256 constant ADVANCE_MATCH = 65175 + TX;
uint256 constant WIN_MATCH_BY_TIMEOUT = 86203 + TX;
Expand Down
1 change: 1 addition & 0 deletions prt/contracts/test/Tournament.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ contract TournamentTest is Util {

uint256 tournamentBalanceBefore = address(topTournament).balance;
uint256 callerBalanceBefore = address(this).balance;
vm.txGasPrice(2);
topTournament.eliminateMatchByTimeout(_matchId);
uint256 tournamentBalanceAfter = address(topTournament).balance;
uint256 callerBalanceAfter = address(this).balance;
Expand Down
Loading