Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jan 12, 2025
1 parent bf5f441 commit 7e3b658
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions packages/protocol/contracts/layer1/based/ITaikoInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ interface ITaikoInbox {
/// @param _batchId The batch ID.
/// @param _tid The transition ID.
/// @return The specified transition.
function getTransitionV3(
function getTransition(
uint64 _batchId,
uint24 _tid
)
Expand Down Expand Up @@ -330,5 +330,5 @@ interface ITaikoInbox {

/// @notice Retrieves the current protocol configuration.
/// @return The current configuration.
function getConfigV3() external view returns (Config memory);
function getConfig() external view returns (Config memory);
}
14 changes: 7 additions & 7 deletions packages/protocol/contracts/layer1/based/TaikoInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
Stats2 memory stats2 = state.stats2;
require(!stats2.paused, ContractPaused());

Config memory config = getConfigV3();
Config memory config = getConfig();
require(stats2.numBatches >= config.forkHeights.pacaya, InvalidForkHeight());

unchecked {
Expand Down Expand Up @@ -194,7 +194,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
Stats2 memory stats2 = state.stats2;
require(stats2.paused == false, ContractPaused());

Config memory config = getConfigV3();
Config memory config = getConfig();
uint64[] memory batchIds = new uint64[](_metas.length);
IVerifier.Context[] memory ctxs = new IVerifier.Context[](_metas.length);

Expand Down Expand Up @@ -319,15 +319,15 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
}

/// @inheritdoc ITaikoInbox
function getTransitionV3(
function getTransition(
uint64 _batchId,
uint24 _tid
)
external
view
returns (Transition memory tran_)
{
Config memory config = getConfigV3();
Config memory config = getConfig();
uint256 slot = _batchId % config.batchRingBufferSize;
Batch storage batch = state.batches[slot];
require(batch.batchId == _batchId, BatchNotFound());
Expand Down Expand Up @@ -362,7 +362,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {

/// @inheritdoc ITaikoInbox
function getBatch(uint64 _batchId) external view returns (Batch memory batch_) {
Config memory config = getConfigV3();
Config memory config = getConfig();
require(_batchId >= config.forkHeights.pacaya, InvalidForkHeight());

batch_ = state.batches[_batchId % config.batchRingBufferSize];
Expand Down Expand Up @@ -394,7 +394,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
view
returns (Transition memory tran_)
{
Config memory config = getConfigV3();
Config memory config = getConfig();

uint64 slot = _batchId % config.batchRingBufferSize;
Batch storage batch = state.batches[slot];
Expand All @@ -406,7 +406,7 @@ abstract contract TaikoInbox is EssentialContract, ITaikoInbox, ITaiko {
}

/// @inheritdoc ITaikoInbox
function getConfigV3() public view virtual returns (Config memory);
function getConfig() public view virtual returns (Config memory);

// Internal functions ----------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/layer1/devnet/DevnetInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "../based/TaikoInbox.sol";
/// @custom:security-contact [email protected]
contract DevnetInbox is TaikoInbox {
/// @inheritdoc ITaikoInbox
function getConfigV3() public pure override returns (ITaikoInbox.Config memory) {
function getConfig() public pure override returns (ITaikoInbox.Config memory) {
return ITaikoInbox.Config({
chainId: 167_001,
maxBatchProposals: 324_000,
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/contracts/layer1/hekla/HeklaInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "../based/TaikoInbox.sol";
/// @dev Labeled in address resolver as "taiko"
/// @custom:security-contact [email protected]
contract HeklaInbox is TaikoInbox {
function getConfigV3() public pure override returns (ITaikoInbox.Config memory) {
function getConfig() public pure override returns (ITaikoInbox.Config memory) {
return ITaikoInbox.Config({
chainId: LibNetwork.TAIKO_HEKLA,
// Never change this value as ring buffer is being reused!!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "./libs/LibFasterReentryLock.sol";
/// @notice See the documentation in {TaikoL1}.
/// @custom:security-contact [email protected]
contract MainnetInbox is TaikoInbox {
function getConfigV3() public pure override returns (ITaikoInbox.Config memory) {
function getConfig() public pure override returns (ITaikoInbox.Config memory) {
// All hard-coded configurations:
// - treasury: the actual TaikoL2 address.
// - anchorGasLimit: 250_000 (based on internal devnet, its ~220_000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract DeployProtocolOnL1 is DeployCapability {
SignalService(signalServiceAddr).authorize(taikoInboxAddr, true);
}

uint64 l2ChainId = taikoInbox.getConfigV3().chainId;
uint64 l2ChainId = taikoInbox.getConfig().chainId;
require(l2ChainId != block.chainid, "same chainid");

console2.log("------------------------------------------");
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/layer1/Layer1Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ contract ConfigurableInbox is TaikoInbox {
__config = _config;
}

function getConfigV3() public view override returns (ITaikoInbox.Config memory) {
function getConfig() public view override returns (ITaikoInbox.Config memory) {
return __config;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/layer1/based/InBoxTest_Params.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contract InBoxTest_Params is InboxTestBase {
external
transactBy(Alice)
{
ITaikoInbox.Config memory config = inbox.getConfigV3();
ITaikoInbox.Config memory config = inbox.getConfig();

// Advance the block number to create the appropriate test scenario
vm.roll(config.maxAnchorHeightOffset + 2);
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/test/layer1/based/InboxTestBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ abstract contract InboxTestBase is Layer1Test {
console2.log("Stats2 - lastUnpausedAt:", stats2.lastUnpausedAt);

// console2.log("stats2.numBatches:", stats2.numBatches);
// console2.log("getConfigV3().maxBatchProposals:", getConfigV3().maxBatchProposals);
// console2.log("getConfig().maxBatchProposals:", getConfig().maxBatchProposals);

uint64 firstBatchId = stats2.numBatches > getConfig().maxBatchProposals
? stats2.numBatches - getConfig().maxBatchProposals
Expand All @@ -177,7 +177,7 @@ abstract contract InboxTestBase is Layer1Test {
console2.log(unicode"│ |── verifiedTransitionId:", batch.verifiedTransitionId);

for (uint24 j = 1; j < batch.nextTransitionId; ++j) {
ITaikoInbox.Transition memory tran = inbox.getTransitionV3(batch.batchId, j);
ITaikoInbox.Transition memory tran = inbox.getTransition(batch.batchId, j);
console2.log(unicode"│ |── transition#", j);
console2.log(
unicode"│ │ |── parentHash:",
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/test/layer1/based/helpers/StubInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract StubInbox is ITaikoInbox {

function getBatch(uint64 _batchId) external view virtual returns (ITaikoInbox.Batch memory) { }

function getTransitionV3(
function getTransition(
uint64 _batchId,
uint24 _tid
)
Expand Down Expand Up @@ -64,5 +64,5 @@ contract StubInbox is ITaikoInbox {

function getStats2() external view returns (Stats2 memory) { }

function getConfigV3() external pure virtual returns (ITaikoInbox.Config memory) { }
function getConfig() external pure virtual returns (ITaikoInbox.Config memory) { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pragma solidity ^0.8.24;
// TokenUnlock private target;
// TaikoToken private taikoToken;

// function getConfigV3() internal pure override returns (ITaikoInbox.Config memory) {
// function getConfig() internal pure override returns (ITaikoInbox.Config memory) {
// return ITaikoInbox.Config({
// chainId: LibNetwork.TAIKO_MAINNET,
// maxBatchProposals: 10,
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/test/layer1/verifiers/SP1Verifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SP1Verifier as SP1RemoteVerifier } from "@sp1-contracts/src/v3.0.0/SP1V
import "../Layer1Test.sol";

contract TaikoStub_ReturnMainnetChainId {
function getConfigV3() external pure returns (ITaikoInbox.Config memory config) {
function getConfig() external pure returns (ITaikoInbox.Config memory config) {
config.chainId = 167_000;
}
}
Expand Down

0 comments on commit 7e3b658

Please sign in to comment.