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

rc/barnard #6625

Draft
wants to merge 154 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
892749f
add max gas higher factory accepted to economics toml
sasurobert Jun 18, 2024
9382c6c
adding tests
sasurobert Jun 18, 2024
ec0edab
adding tests
sasurobert Jun 18, 2024
e6f8894
adding tests
sasurobert Jun 18, 2024
df3f271
Merge branch 'feat/economics-gas-improve-v2' into change-penaliseGas
sasurobert Jun 20, 2024
716d67d
activate in new epoch
sasurobert Jun 20, 2024
edfc0a0
fix linter issue
ssd04 Aug 12, 2024
e608d64
Merge pull request #6384 from multiversx/merge-rc-1.7.next1-to-rc-1.8.0
ssd04 Aug 14, 2024
e67616d
Optimize GitHub workflows.
andreibancioiu Oct 3, 2024
cff3c01
Merge pull request #6518 from multiversx/optimize-workflows-barnard
AdoAdoAdo Oct 4, 2024
6c49ad4
Merge branch 'rc/v1.7.next1' into spica-to-barnard-23-okt
sasurobert Oct 23, 2024
8e999de
Merge branch 'rc/v1.7.next1' into spica-to-barnard-23-okt
sasurobert Oct 28, 2024
57301ae
new relayed v3
sstanculeanu Oct 29, 2024
937f10c
Merge branch 'rc/v1.7.next1' of https://github.com/multiversx/mx-chai…
sstanculeanu Oct 29, 2024
905bd78
update deps after merge
sstanculeanu Oct 29, 2024
a36e68c
small fix + fix tests
sstanculeanu Oct 29, 2024
ab06f0b
revert config values modified for local tests
sstanculeanu Oct 30, 2024
09a2751
guarded integration tests
sstanculeanu Oct 30, 2024
7979558
Merge pull request #6553 from multiversx/spica-to-barnard-23-okt
sasurobert Nov 4, 2024
3dc3d84
Merge branch 'rc/barnard' into change-penaliseGas
sasurobert Nov 4, 2024
35bfe14
merges
sasurobert Nov 4, 2024
93a8198
fixing tests
sasurobert Nov 11, 2024
0b6485b
fixing tests
sasurobert Nov 11, 2024
68dbf89
fixes after review
sstanculeanu Nov 11, 2024
bb8ee0f
Merge branch 'rc/v1.7.next1' of https://github.com/multiversx/mx-chai…
sstanculeanu Nov 11, 2024
531aad5
deps update
sstanculeanu Nov 11, 2024
86aaa39
implemented override with array of string and int
axenteoctavian Nov 12, 2024
1a05453
better way for set slice
axenteoctavian Nov 12, 2024
458e04f
rollback some changes
axenteoctavian Nov 12, 2024
8a1e9ed
update test name
axenteoctavian Nov 12, 2024
0fd6ced
update test name
axenteoctavian Nov 13, 2024
6c02c94
further fixes after review
sstanculeanu Nov 13, 2024
f293c96
Merge pull request #6264 from multiversx/change-penaliseGas
sasurobert Nov 14, 2024
065db18
heart beats in chain simulator
miiu96 Nov 15, 2024
38d41ac
fix imports
miiu96 Nov 15, 2024
c1bcc7e
index validators chain simulator
miiu96 Nov 15, 2024
2c33cdf
imports
miiu96 Nov 15, 2024
860f20d
fix linter
miiu96 Nov 15, 2024
89d8c01
Merge branch 'master' of https://github.com/multiversx/mx-chain-go in…
sstanculeanu Nov 15, 2024
c22ee81
Merge pull request #6614 from multiversx/merge_master_into_rc_barnard…
sstanculeanu Nov 15, 2024
327f631
Merge branch 'rc/barnard' into heartbeats-chain-simulator
miiu96 Nov 18, 2024
31bd356
Merge branch 'rc/spica-patch-mempool' into MX-16067-overridable-confi…
sstanculeanu Nov 19, 2024
232874b
Merge branch 'rc/spica-patch-mempool' into relayedv3
sstanculeanu Nov 19, 2024
ea799ab
updated indexer
sstanculeanu Nov 19, 2024
a97147f
chain simulator heartbeat
miiu96 Nov 19, 2024
4df347c
Merge remote-tracking branch 'origin/heartbeats-chain-simulator' into…
miiu96 Nov 19, 2024
ba15dcb
fixes
miiu96 Nov 19, 2024
5e01a06
fixes after review
miiu96 Nov 20, 2024
3094bb0
Merge pull request #6612 from multiversx/heartbeats-chain-simulator
miiu96 Nov 22, 2024
dab1093
proper name for EnableEpoch epoch
sstanculeanu Nov 22, 2024
95fac83
fixes after review
sstanculeanu Nov 25, 2024
b8487af
Merge pull request #6570 from multiversx/relayedv3
sstanculeanu Nov 25, 2024
0c2fe33
fixes after tests: fix validation error + fix txs to meta
sstanculeanu Nov 26, 2024
2c05aa7
proper fix for wrapped error
sstanculeanu Nov 26, 2024
3170be4
extra check for relayer != guardian
sstanculeanu Nov 27, 2024
d23b953
fix typos
sstanculeanu Nov 27, 2024
6ae2337
proper execution of relayed v3
sstanculeanu Nov 28, 2024
2869076
further fixes after review, treat relayed v3 as normal tx
sstanculeanu Dec 2, 2024
980496d
fix tests
sstanculeanu Dec 2, 2024
edc0ff3
fixes after review
sstanculeanu Dec 3, 2024
33568e5
reverted common code in order to keep old logic on errors
sstanculeanu Dec 3, 2024
3c7abd8
Merge pull request #6639 from multiversx/relayedv3_fixes
sstanculeanu Dec 4, 2024
0ac7c16
use proper prevTxHash in case of relayed v1 and v2
sstanculeanu Dec 4, 2024
9a9128e
Merge pull request #6649 from multiversx/relayedv3_fix_prevhash
sstanculeanu Dec 4, 2024
d744ac4
fix transaction/pool endpoint issues
sstanculeanu Dec 5, 2024
9ac1370
fix linter
sstanculeanu Dec 5, 2024
05204b4
Export selection session.
andreibancioiu Dec 5, 2024
392d918
Merge branch 'rc/spica-patch-mempool' into MX-16207-mempool-chain-sim…
andreibancioiu Dec 5, 2024
886df30
Sketch test utils.
andreibancioiu Dec 5, 2024
6ee6f36
Sketch some tests.
andreibancioiu Dec 5, 2024
73c8af3
Merge pull request #6651 from multiversx/mx-16113_fix_transaction_poo…
sstanculeanu Dec 6, 2024
5d301c7
Test adjustments (work in progress).
andreibancioiu Dec 6, 2024
98a029a
Merge branch 'master' of https://github.com/multiversx/mx-chain-go in…
sstanculeanu Dec 9, 2024
3536927
remove old persisters when new already existing
BeniaminDrasovean Dec 10, 2024
aa66f65
add log trace
BeniaminDrasovean Dec 10, 2024
7a79a2d
Merge pull request #6663 from multiversx/merge_master_into_rc_spica_p…
sstanculeanu Dec 10, 2024
8d5400a
Merge branch 'rc/spica-patch-relayedv3' of https://github.com/multive…
sstanculeanu Dec 11, 2024
480ce7e
fixes after merge
sstanculeanu Dec 11, 2024
585d0ea
Merge pull request #6666 from multiversx/merger_rc_spica_patch_relaye…
AdoAdoAdo Dec 11, 2024
0bdd1c3
add unit tests
BeniaminDrasovean Dec 11, 2024
1beb4ca
sort imports
BeniaminDrasovean Dec 11, 2024
0ec0695
Merge branch 'rc/spica-patch-relayedv3' into test-pruning-storer
BeniaminDrasovean Dec 11, 2024
fee796f
fix after review
BeniaminDrasovean Dec 11, 2024
8b39184
Merge branch 'rc/spica-patch-relayedv3' into MX-16067-overridable-con…
axenteoctavian Dec 11, 2024
c5f7e5a
Merge pull request #6599 from multiversx/MX-16067-overridable-configs…
axenteoctavian Dec 12, 2024
05e3a2a
Integrate storage-go.
andreibancioiu Dec 12, 2024
559d93a
Reference storage-go, fix mempool memory tests.
andreibancioiu Dec 13, 2024
8e08e1a
accept relayed tx v3 with sender account non-existent
sstanculeanu Dec 13, 2024
8cf2672
fix after review
sstanculeanu Dec 16, 2024
bd43050
Merge pull request #6671 from multiversx/MX-16294-mempool-selection-r…
sstanculeanu Dec 16, 2024
d245d8b
Merge branch 'feat/relayedv3' into rv3_non_existent_sender
sstanculeanu Dec 16, 2024
6140ea4
Merge pull request #6677 from multiversx/rv3_non_existent_sender
sstanculeanu Dec 16, 2024
f5c7674
Merge branch 'rc/spica-patch-relayedv3' of https://github.com/multive…
sstanculeanu Dec 16, 2024
39b0433
Merge pull request #6678 from multiversx/merge_rc_spica_patch_rv3_int…
sstanculeanu Dec 16, 2024
90ef10c
Merge branch 'rc/spica-patch-relayedv3' into test-pruning-storer
BeniaminDrasovean Dec 16, 2024
6a74c03
Merge pull request #6667 from multiversx/test-pruning-storer
BeniaminDrasovean Dec 18, 2024
5452b88
Merge branch 'rc/spica-patch-relayedv3' of https://github.com/multive…
sstanculeanu Dec 18, 2024
e9c7ccb
Merge pull request #6682 from multiversx/merge_rc_spica_patch_rv3_int…
sstanculeanu Dec 18, 2024
276ffeb
Merge branch 'feat/relayedv3' into MX-16207-mempool-chain-simulator
andreibancioiu Dec 19, 2024
eaf721a
Better mempool tests (chain simulator).
andreibancioiu Dec 19, 2024
0ea8720
fix receipts hash mismatch
sstanculeanu Dec 19, 2024
145806c
fix tests
sstanculeanu Dec 19, 2024
3b3e5cd
Merge pull request #6687 from multiversx/fix_receipts_hash_mismatch
sstanculeanu Dec 20, 2024
eba1fad
extend /block endpoint
miiu96 Dec 23, 2024
6e5bcf5
fix missing tokens from es
miiu96 Dec 27, 2024
175fcc3
Merge branch 'rc/spica-patch-relayedv3' into MX-16386-bug-fix-missing…
miiu96 Dec 27, 2024
a90596c
Merge branch 'rc/spica-patch-relayedv3' into MX-16368-extend-get-bloc…
miiu96 Dec 27, 2024
0683dcc
On Node API, adjust processing type for relayed V3.
andreibancioiu Jan 8, 2025
c56d9e0
Update node/external/transactionAPI/apiTransactionProcessor_test.go
andreibancioiu Jan 8, 2025
c8df156
Update node/external/transactionAPI/apiTransactionProcessor_test.go
andreibancioiu Jan 8, 2025
5456f8d
Update node/external/transactionAPI/apiTransactionProcessor_test.go
andreibancioiu Jan 8, 2025
c3dfab5
Fix after review.
andreibancioiu Jan 8, 2025
5ebab05
Merge pull request #6692 from multiversx/MX-16386-bug-fix-missing-tok…
sstanculeanu Jan 9, 2025
52956d5
Merge branch 'rc/spica-patch-relayedv3' into MX-16368-extend-get-bloc…
sstanculeanu Jan 9, 2025
f661684
Merge pull request #6693 from multiversx/MX-16416-tx-type
andreibancioiu Jan 9, 2025
07627b9
extract forHyperblock from block requests
sstanculeanu Jan 9, 2025
1a2c25d
Merge pull request #6691 from multiversx/MX-16368-extend-get-block-en…
sstanculeanu Jan 9, 2025
6f4945c
Merge branch 'rc/spica-patch-relayedv3' of https://github.com/multive…
sstanculeanu Jan 9, 2025
4bef80d
update deps after merge
sstanculeanu Jan 9, 2025
0ed8bb0
Merge pull request #6699 from multiversx/merge_rc_spica_patch_rv3_int…
sstanculeanu Jan 9, 2025
7092e61
new metric for extra relayed tx gas limit
sstanculeanu Jan 9, 2025
9a6c9e3
Merge pull request #6700 from multiversx/new_metric_extra_gas_relayed
sstanculeanu Jan 9, 2025
611be56
Merge branch 'feat/relayedv3' into MX-16207-mempool-chain-simulator
andreibancioiu Jan 10, 2025
58251d2
fix relayed v3 with relayer one of the participants leading to free txs
sstanculeanu Jan 13, 2025
c8faf1a
also fix for sc call
sstanculeanu Jan 13, 2025
55ac0c9
linter fixes
sstanculeanu Jan 13, 2025
7c3462b
Merge pull request #6704 from multiversx/fix_relayed_by_participants
sstanculeanu Jan 14, 2025
e66a20a
fixed the computed fee for outport for relayed v3
sstanculeanu Jan 14, 2025
545d15e
Merge pull request #6706 from multiversx/fix_computed_fee_on_outport
sstanculeanu Jan 14, 2025
0de4606
fix chain simulator
miiu96 Jan 14, 2025
96b260a
Merge pull request #6707 from multiversx/fix-chain-simulator
miiu96 Jan 15, 2025
054aa1e
count all refunds if more than one scr exists
sstanculeanu Jan 15, 2025
9caaba2
Merge pull request #6708 from multiversx/node_api_fix_multiple_refunds
sstanculeanu Jan 15, 2025
edf2be2
treat multiple scrs outport driver
miiu96 Jan 15, 2025
d9fc071
Merge branch 'feat/relayedv3' into multiple-scrs-with-refund
miiu96 Jan 15, 2025
e6703ec
small fix
miiu96 Jan 15, 2025
e83061a
Merge remote-tracking branch 'origin/multiple-scrs-with-refund' into …
miiu96 Jan 15, 2025
ee6ae21
had refund
miiu96 Jan 16, 2025
ae1e852
Additional test: TestMempoolWithChainSimulator_Selection_WhenInsuffic…
andreibancioiu Jan 16, 2025
189ba98
Refactor.
andreibancioiu Jan 16, 2025
86fdeb9
add continue
miiu96 Jan 16, 2025
f0e500b
Additional test: TestMempoolWithChainSimulator_Selection_WhenUsersHav…
andreibancioiu Jan 16, 2025
b0f6540
Merge branch 'feat/relayedv3' into MX-16207-mempool-chain-simulator
andreibancioiu Jan 16, 2025
c020f20
Fix linter.
andreibancioiu Jan 16, 2025
f937fba
Merge pull request #6709 from multiversx/multiple-scrs-with-refund
miiu96 Jan 16, 2025
ffca7dd
Merge branch 'feat/relayedv3' into MX-16207-mempool-chain-simulator
sstanculeanu Jan 16, 2025
fdfbff6
Adjust timing / sleeps (for slower CI agents).
andreibancioiu Jan 16, 2025
879c890
Merge branch 'MX-16207-mempool-chain-simulator' of ssh://github.com/m…
andreibancioiu Jan 16, 2025
9f12905
Merge pull request #6654 from multiversx/MX-16207-mempool-chain-simul…
andreibancioiu Jan 16, 2025
1476698
updated deps
sstanculeanu Jan 16, 2025
6bd3142
Merge pull request #6710 from multiversx/update_deps
sstanculeanu Jan 16, 2025
4afb0de
Merge pull request #6632 from multiversx/feat/relayedv3
sstanculeanu Jan 16, 2025
9fc690a
Merge branch 'rc/spica-patch-relayedv3' into spica-patch-to-barnard
sasurobert Jan 22, 2025
24cd11a
Merge pull request #6726 from multiversx/spica-patch-to-barnard
sasurobert Jan 23, 2025
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
8 changes: 7 additions & 1 deletion api/groups/blockGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
urlParamTokensFilter = "tokens"
urlParamWithTxs = "withTxs"
urlParamWithLogs = "withLogs"
urlParamForHyperblock = "forHyperblock"
)

// blockFacadeHandler defines the methods to be implemented by a facade for handling block requests
Expand Down Expand Up @@ -219,7 +220,12 @@ func parseBlockQueryOptions(c *gin.Context) (api.BlockQueryOptions, error) {
return api.BlockQueryOptions{}, err
}

options := api.BlockQueryOptions{WithTransactions: withTxs, WithLogs: withLogs}
forHyperBlock, err := parseBoolUrlParam(c, urlParamForHyperblock)
if err != nil {
return api.BlockQueryOptions{}, err
}

options := api.BlockQueryOptions{WithTransactions: withTxs, WithLogs: withLogs, ForHyperblock: forHyperBlock}
return options, nil
}

Expand Down
4 changes: 2 additions & 2 deletions api/groups/blockGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestBlockGroup_getBlockByNonce(t *testing.T) {
t.Parallel()

providedNonce := uint64(37)
expectedOptions := api.BlockQueryOptions{WithTransactions: true}
expectedOptions := api.BlockQueryOptions{WithTransactions: true, ForHyperblock: true}
expectedBlock := api.Block{
Nonce: 37,
Round: 39,
Expand All @@ -107,7 +107,7 @@ func TestBlockGroup_getBlockByNonce(t *testing.T) {
loadBlockGroupResponse(
t,
facade,
fmt.Sprintf("/block/by-nonce/%d?withTxs=true", providedNonce),
fmt.Sprintf("/block/by-nonce/%d?withTxs=true&forHyperblock=true", providedNonce),
"GET",
nil,
response,
Expand Down
30 changes: 30 additions & 0 deletions api/groups/networkGroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,36 @@ func TestNetworkConfigMetrics_GasLimitGuardedTxShouldWork(t *testing.T) {
assert.True(t, keyAndValueFoundInResponse)
}

func TestNetworkConfigMetrics_GasLimitRelayedTxShouldWork(t *testing.T) {
t.Parallel()

statusMetricsProvider := statusHandler.NewStatusMetrics()
key := common.MetricExtraGasLimitRelayedTx
val := uint64(123)
statusMetricsProvider.SetUInt64Value(key, val)

facade := mock.FacadeStub{}
facade.StatusMetricsHandler = func() external.StatusMetricsHandler {
return statusMetricsProvider
}

networkGroup, err := groups.NewNetworkGroup(&facade)
require.NoError(t, err)

ws := startWebServer(networkGroup, "network", getNetworkRoutesConfig())

req, _ := http.NewRequest("GET", "/network/config", nil)
resp := httptest.NewRecorder()
ws.ServeHTTP(resp, req)

respBytes, _ := io.ReadAll(resp.Body)
respStr := string(respBytes)
assert.Equal(t, resp.Code, http.StatusOK)

keyAndValueFoundInResponse := strings.Contains(respStr, key) && strings.Contains(respStr, fmt.Sprintf("%d", val))
assert.True(t, keyAndValueFoundInResponse)
}

func TestNetworkStatusMetrics_ShouldWork(t *testing.T) {
t.Parallel()

Expand Down
32 changes: 17 additions & 15 deletions api/groups/transactionGroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,21 +720,23 @@ func (tg *transactionGroup) getTransactionsPoolNonceGapsForSender(sender string,

func (tg *transactionGroup) createTransaction(receivedTx *transaction.FrontendTransaction) (*transaction.Transaction, []byte, error) {
txArgs := &external.ArgsCreateTransaction{
Nonce: receivedTx.Nonce,
Value: receivedTx.Value,
Receiver: receivedTx.Receiver,
ReceiverUsername: receivedTx.ReceiverUsername,
Sender: receivedTx.Sender,
SenderUsername: receivedTx.SenderUsername,
GasPrice: receivedTx.GasPrice,
GasLimit: receivedTx.GasLimit,
DataField: receivedTx.Data,
SignatureHex: receivedTx.Signature,
ChainID: receivedTx.ChainID,
Version: receivedTx.Version,
Options: receivedTx.Options,
Guardian: receivedTx.GuardianAddr,
GuardianSigHex: receivedTx.GuardianSignature,
Nonce: receivedTx.Nonce,
Value: receivedTx.Value,
Receiver: receivedTx.Receiver,
ReceiverUsername: receivedTx.ReceiverUsername,
Sender: receivedTx.Sender,
SenderUsername: receivedTx.SenderUsername,
GasPrice: receivedTx.GasPrice,
GasLimit: receivedTx.GasLimit,
DataField: receivedTx.Data,
SignatureHex: receivedTx.Signature,
ChainID: receivedTx.ChainID,
Version: receivedTx.Version,
Options: receivedTx.Options,
Guardian: receivedTx.GuardianAddr,
GuardianSigHex: receivedTx.GuardianSignature,
Relayer: receivedTx.RelayerAddr,
RelayerSignatureHex: receivedTx.RelayerSignature,
}
start := time.Now()
tx, txHash, err := tg.getFacade().CreateTransaction(txArgs)
Expand Down
7 changes: 4 additions & 3 deletions cmd/node/config/economics.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@

[FeeSettings]
GasLimitSettings = [
{EnableEpoch = 0, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "1500000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "15000000000", MaxGasLimitPerTx = "1500000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000"},
{EnableEpoch = 1, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "250000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "250000000", MaxGasLimitPerTx = "600000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000"},
{EnableEpoch = 2, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "250000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "250000000", MaxGasLimitPerTx = "600000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000"},
{EnableEpoch = 0, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "1500000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "15000000000", MaxGasLimitPerTx = "1500000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000", MaxGasHigherFactorAccepted = "10"},
{EnableEpoch = 1, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "250000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "250000000", MaxGasLimitPerTx = "600000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000", MaxGasHigherFactorAccepted = "10"},
{EnableEpoch = 2, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "250000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "250000000", MaxGasLimitPerTx = "600000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000", MaxGasHigherFactorAccepted = "10"},
{EnableEpoch = 3, MaxGasLimitPerBlock = "1500000000", MaxGasLimitPerMiniBlock = "250000000", MaxGasLimitPerMetaBlock = "15000000000", MaxGasLimitPerMetaMiniBlock = "250000000", MaxGasLimitPerTx = "600000000", MinGasLimit = "50000", ExtraGasLimitGuardedTx = "50000", MaxGasHigherFactorAccepted = "2"},
]
MinGasPrice = "1000000000" #will yield min tx fee of 0.00005 eGLD
GasPriceModifier = 0.01
Expand Down
3 changes: 3 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@
# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 1

# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions v3 will be enabled
RelayedTransactionsV3EnableEpoch = 2

# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
BLSMultiSignerEnableEpoch = [
{ EnableEpoch = 0, Type = "no-KOSK" },
Expand Down
4 changes: 2 additions & 2 deletions cmd/node/config/external.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
Username = ""
Password = ""
# EnabledIndexes represents a slice of indexes that will be enabled for indexing. Full list is:
# ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts"]
EnabledIndexes = ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts"]
# ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts", "events"]
EnabledIndexes = ["rating", "transactions", "blocks", "validators", "miniblocks", "rounds", "accounts", "accountshistory", "receipts", "scresults", "accountsesdt", "accountsesdthistory", "epochinfo", "scdeploys", "tokens", "tags", "logs", "delegators", "operations", "esdts", "events"]

# EventNotifierConnector defines settings needed to configure and launch the event notifier component
# HTTP event notifier connector integration will be DEPRECATED in the following iterations
Expand Down
26 changes: 26 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package common

import "github.com/multiversx/mx-chain-core-go/data"

// IsValidRelayedTxV3 returns true if the provided transaction is a valid transaction of type relayed v3
func IsValidRelayedTxV3(tx data.TransactionHandler) bool {
relayedTx, isRelayedV3 := tx.(data.RelayedTransactionHandler)
if !isRelayedV3 {
return false
}
hasValidRelayer := len(relayedTx.GetRelayerAddr()) == len(tx.GetSndAddr()) && len(relayedTx.GetRelayerAddr()) > 0
hasValidRelayerSignature := len(relayedTx.GetRelayerSignature()) == len(relayedTx.GetSignature()) && len(relayedTx.GetRelayerSignature()) > 0
return hasValidRelayer && hasValidRelayerSignature
}

// IsRelayedTxV3 returns true if the provided transaction is a transaction of type relayed v3, without any further checks
func IsRelayedTxV3(tx data.TransactionHandler) bool {
relayedTx, isRelayedV3 := tx.(data.RelayedTransactionHandler)
if !isRelayedV3 {
return false
}

hasRelayer := len(relayedTx.GetRelayerAddr()) > 0
hasRelayerSignature := len(relayedTx.GetRelayerSignature()) > 0
return hasRelayer || hasRelayerSignature
}
70 changes: 70 additions & 0 deletions common/common_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package common

import (
"math/big"
"testing"

"github.com/multiversx/mx-chain-core-go/data/smartContractResult"
"github.com/multiversx/mx-chain-core-go/data/transaction"
"github.com/stretchr/testify/require"
)

func TestIsValidRelayedTxV3(t *testing.T) {
t.Parallel()

scr := &smartContractResult.SmartContractResult{}
require.False(t, IsValidRelayedTxV3(scr))
require.False(t, IsRelayedTxV3(scr))

notRelayedTxV3 := &transaction.Transaction{
Nonce: 1,
Value: big.NewInt(100),
RcvAddr: []byte("receiver"),
SndAddr: []byte("sender0"),
GasPrice: 100,
GasLimit: 10,
Signature: []byte("signature"),
}
require.False(t, IsValidRelayedTxV3(notRelayedTxV3))
require.False(t, IsRelayedTxV3(notRelayedTxV3))

invalidRelayedTxV3 := &transaction.Transaction{
Nonce: 1,
Value: big.NewInt(100),
RcvAddr: []byte("receiver"),
SndAddr: []byte("sender0"),
GasPrice: 100,
GasLimit: 10,
Signature: []byte("signature"),
RelayerAddr: []byte("relayer"),
}
require.False(t, IsValidRelayedTxV3(invalidRelayedTxV3))
require.True(t, IsRelayedTxV3(invalidRelayedTxV3))

invalidRelayedTxV3 = &transaction.Transaction{
Nonce: 1,
Value: big.NewInt(100),
RcvAddr: []byte("receiver"),
SndAddr: []byte("sender0"),
GasPrice: 100,
GasLimit: 10,
Signature: []byte("signature"),
RelayerSignature: []byte("signature"),
}
require.False(t, IsValidRelayedTxV3(invalidRelayedTxV3))
require.True(t, IsRelayedTxV3(invalidRelayedTxV3))

relayedTxV3 := &transaction.Transaction{
Nonce: 1,
Value: big.NewInt(100),
RcvAddr: []byte("receiver"),
SndAddr: []byte("sender1"),
GasPrice: 100,
GasLimit: 10,
Signature: []byte("signature"),
RelayerAddr: []byte("relayer"),
RelayerSignature: []byte("signature"),
}
require.True(t, IsValidRelayedTxV3(relayedTxV3))
require.True(t, IsRelayedTxV3(relayedTxV3))
}
7 changes: 7 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ const MetricMinGasLimit = "erd_min_gas_limit"
// MetricExtraGasLimitGuardedTx specifies the extra gas limit required for guarded transactions
const MetricExtraGasLimitGuardedTx = "erd_extra_gas_limit_guarded_tx"

// MetricExtraGasLimitRelayedTx specifies the extra gas limit required for relayed v3 transactions
const MetricExtraGasLimitRelayedTx = "erd_extra_gas_limit_relayed_tx"

// MetricRewardsTopUpGradientPoint is the metric that specifies the rewards top up gradient point
const MetricRewardsTopUpGradientPoint = "erd_rewards_top_up_gradient_point"

Expand Down Expand Up @@ -737,6 +740,9 @@ const (
// MetricFixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non-payable sc is enabled
MetricFixRelayedMoveBalanceToNonPayableSCEnableEpoch = "erd_fix_relayed_move_balance_to_non_payable_sc_enable_epoch"

// MetricRelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions v3 are enabled
MetricRelayedTransactionsV3EnableEpoch = "erd_relayed_transactions_v3_enable_epoch"

// MetricMaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MetricMaxNodesChangeEnableEpoch = "erd_max_nodes_change_enable_epoch"

Expand Down Expand Up @@ -1234,5 +1240,6 @@ const (
FixRelayedBaseCostFlag core.EnableEpochFlag = "FixRelayedBaseCostFlag"
MultiESDTNFTTransferAndExecuteByUserFlag core.EnableEpochFlag = "MultiESDTNFTTransferAndExecuteByUserFlag"
FixRelayedMoveBalanceToNonPayableSCFlag core.EnableEpochFlag = "FixRelayedMoveBalanceToNonPayableSCFlag"
RelayedTransactionsV3Flag core.EnableEpochFlag = "RelayedTransactionsV3Flag"
// all new flags must be added to createAllFlagsMap method, as part of enableEpochsHandler allFlagsDefined
)
6 changes: 6 additions & 0 deletions common/enablers/enableEpochsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,12 @@ func (handler *enableEpochsHandler) createAllFlagsMap() {
},
activationEpoch: handler.enableEpochsConfig.FixRelayedMoveBalanceToNonPayableSCEnableEpoch,
},
common.RelayedTransactionsV3Flag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.RelayedTransactionsV3EnableEpoch
},
activationEpoch: handler.enableEpochsConfig.RelayedTransactionsV3EnableEpoch,
},
}
}

Expand Down
2 changes: 2 additions & 0 deletions common/enablers/enableEpochsHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func createEnableEpochsConfig() config.EnableEpochs {
MultiESDTNFTTransferAndExecuteByUserEnableEpoch: 106,
FixRelayedMoveBalanceToNonPayableSCEnableEpoch: 107,
UseGasBoundedShouldFailExecutionEnableEpoch: 108,
RelayedTransactionsV3EnableEpoch: 109,
}
}

Expand Down Expand Up @@ -448,6 +449,7 @@ func TestEnableEpochsHandler_GetActivationEpoch(t *testing.T) {
require.Equal(t, cfg.FixRelayedBaseCostEnableEpoch, handler.GetActivationEpoch(common.FixRelayedBaseCostFlag))
require.Equal(t, cfg.MultiESDTNFTTransferAndExecuteByUserEnableEpoch, handler.GetActivationEpoch(common.MultiESDTNFTTransferAndExecuteByUserFlag))
require.Equal(t, cfg.FixRelayedMoveBalanceToNonPayableSCEnableEpoch, handler.GetActivationEpoch(common.FixRelayedMoveBalanceToNonPayableSCFlag))
require.Equal(t, cfg.RelayedTransactionsV3EnableEpoch, handler.GetActivationEpoch(common.RelayedTransactionsV3Flag))
}

func TestEnableEpochsHandler_IsInterfaceNil(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions common/reflectcommon/structFieldsUpdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func trySetTheNewValue(value *reflect.Value, newValue interface{}) error {
case reflect.Map:
mapValue := reflect.ValueOf(newValue)

return tryUpdateMapValue(value, mapValue)
return trySetMapValue(value, mapValue)
default:
return fmt.Errorf("unsupported type <%s> when trying to set the value '%v' of type <%s>", valueKind, newValue, reflect.TypeOf(newValue))
}
Expand All @@ -141,7 +141,7 @@ func trySetSliceValue(value *reflect.Value, newValue interface{}) error {
item := sliceVal.Index(i)
newItem := reflect.New(value.Type().Elem()).Elem()

err := trySetStructValue(&newItem, item)
err := trySetTheNewValue(&newItem, item.Interface())
if err != nil {
return err
}
Expand All @@ -167,7 +167,7 @@ func trySetStructValue(value *reflect.Value, newValue reflect.Value) error {
}
}

func tryUpdateMapValue(value *reflect.Value, newValue reflect.Value) error {
func trySetMapValue(value *reflect.Value, newValue reflect.Value) error {
if value.IsNil() {
value.Set(reflect.MakeMap(value.Type()))
}
Expand Down
Loading
Loading